Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
A_04 SIMPSON'S RULE (3(II))
Program Simpsons_rule Implicit none Real::a=1.4,b=2.0,c=1.0,d=1.5,h,x,j1,j2,j3,k1,k2,k3,hx,y,q Real::l,w,f Integer::i,n=50,m=50,j h=(b-a)/n j1=0 j2=0 j3=0 Do i=0,n x=a+i*h hx=(d-c)/m k1=f(x,c)+f(x,d) k2=0 k3=0 Do j=1,m-1 y=c+j*hx q=f(x,y) If(mod(j,2)==0)then k2=k2+q else k3=k3+q End if End do l=(k1+2*k2+4*k3)*(hx/3) If(i==0.or.i==n)then j1=j1+l else if(mod(i,2)==0)then j2=j2+l else j3=j3+l End if End do w=h*(j1+2*j2+4*j3)/3 Print*,w End program Real function f(x,y) Implicit none Real::x,y f=alog(x+2*y) End function
run
|
edit
|
history
|
help
0
Chebyshev practice
A_04 TRAPEZOIDAL RULE (3(II))
Factorial problem
A_02 JACOBI METHOD
A_01 FIXED_POINT_IM(I)
Practice 4(I) recently
expx
নাজমুন নাহার
A_04 FINITE DIFFERENCE METHOD
Y