FISH.





Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/virtwww/w_beloshenko-org-ua_e2c5fc46/http/topp.php on line 8

Warning: include(http://www.beloshenko.org.ua/panel.html) [function.include]: failed to open stream: no suitable wrapper could be found in /home/virtwww/w_beloshenko-org-ua_e2c5fc46/http/topp.php on line 8

Warning: include() [function.include]: Failed opening 'http://www.beloshenko.org.ua/panel.html' for inclusion (include_path='.:') in /home/virtwww/w_beloshenko-org-ua_e2c5fc46/http/topp.php on line 8







Numerical integration. (FORTRAN)


Beloshenko + 2007

-------------------------- Use common -------------------------------------
main.for
integer N
common /P/ N,x0,x1,sumL,sumR,sumTrap,sumMiddle
real*4 x0,x1
real*4 sumL,sumR,sumTrap,sumMiddle
open(unit=1, file='IntRes.txt', status='OLD')
N=5000
x0=0
x1=1.570796
call Obchisl
write(1,2)sumL,sumR,sumTrap,sumMiddle
2 format(F 8.5, 2X, F 8.5, 2X, F 8.5, 2X F 8.5)
close(1)
end

subrout.for
subroutine Obchisl
common /P/ N,x0,x1,sumL,sumR,sumTrap,sumMiddle
integer i
double precision xi,xi1
double precision delta
xi=x0
xi1=0
sumL=0
sumR=0
sumTrap=0
sumMiddle=0
delta=(x1-x0)/N
do 1 i=1,N-1
xi1=xi+delta
sumL=sumL+sin(xi1)
sumMiddle=sumMiddle+sin(xi1-delta/2)
xi=xi1
1 continue
sumMiddle=(sumMiddle+sin(x1-delta/2))*delta
sumR=sumL
sumTrap=sumL
sumL=sumL+sin(x0)
sumR=sumR+sin(x1)
sumL=((x1-x0)/N)*sumL
sumR=((x1-x0)/N)*sumR
sumTrap=(2*sumTrap+sin(x0)+sin(x1))*(x1-x0)/(2*N)
return
end

IntRes.txt
0.99984 1.00016 1.00000 1.00000


FREE VIRAL OF YOU SITE.

 









Click Here for Free Traffic!

FISH.