Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
A_04 SIMPSON'S ONE THIRD(3(I))
PROGRAM SIMPSONS_ONE_THIRD IMPLICIT NONE REAL :: F,DX,A=0.0,B=1.0,N=100,X,S,C INTEGER :: I DX=(B-A)/N S=0 DO I=0,N X=A+I*DX !PRINT *,X IF (X==A .OR. X==B) THEN C=1 ELSEIF (MODULO(I,2)==0) THEN C=2 ELSEIF (MODULO(I,2)==1) THEN C=4 END IF S=S+(DX/3.0)*C*F(X) PRINT *, S END DO PRINT *, S END PROGRAM REAL FUNCTION F(X) IMPLICIT NONE REAL :: X F=(X**2)*EXP(X) END FUNCTION
run
|
edit
|
history
|
help
0
False position
Formatted Output 001
s
Practice am4
4(iii)
Pivot 2
Practice 3
Adams-Bashforth Method for four step
A_03 RUNGE KUTTA METHOD O(4)
Hello / fortran