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







Solving equations numerically. Dichotomy method. (FORTRAN)

Beloshenko + 2007

------------------------------------------------------------------------------
dichotom.for

program Dichotom
real a,c,b,eps
open(unit=1, file='Data.txt', status='old')
open(unit=2, file='Res.txt', status='new')
read(1,2)a
read(1,2)b
2 format(f4.2)

eps=0.001

if (f(a)*f(b).GE.0) goto 1

4 if ((b-a).LE.eps) goto 3
c=(b+a)/2
if (f(c)*f(b).GE.0) goto 6
a=c
goto 4
6 b=c
goto 4
3 continue write(2,5)a
5
format(f5.3)
close(2)
close(1)
1
stop end
------------------------------------------------------------------------------ f.for function f(x)
f=SIN(x)+x-1
return end ------------------------------------------------------------------------------ Res.txt 0.511 ------------------------------------------------------------------------------ Data.txt -0.1 1.1





Click Here for Free Traffic!

FISH.