Program napisany jest w fortranie. Wykorzystuje on metode Eulera- to rozwiniecie w szereg Taylor'a do wyrazu pierwszego rzedu. Ponizszy kod programu ORBIT prezentuje te metode:

program orbit

implicit none

double precision epsilon,T,X,vx,Y,vy,R,ax,ay,vpolx, vpoly

open(20,file='orbit.dat',status='unknown')

open(21,file='metoda_Eulera.dat',status='unknown')

epsilon = 0.01d0

T = 0.0d0

X = 0.5d0

vx = 0.0d0

Y = 0.0d0

vy = 1.63d0

R = dsqrt(X**2+Y**2)

ax = -X/(R**3)

ay = -Y/(R**3)

vpolx= vx + (epsilon/2)*ax

vpoly = vy + (epsilon/2)*ay

write(20,'(f4.2,5(1x,f6.3))')T,X,ax,Y,ay,R

write(21,'(f4.2,4(1x,a,1x,f6.3))')T,'&',X,'&',ax,'&',Y,'&',ay

10 continue

if(T.lt.2500d0) then

T=T+epsilon

X=X+epsilon*vpolx

Y=Y+epsilon*vpoly

R = dsqrt(X**2+Y**2)

aX = -X/(R**3)

aY = -Y/(R**3)

vpolx = vpolx+epsilon*ax

vpoly = vpoly+epsilon*ay

write(20,'(f4.2,5(1x,f6.3))')T,X,ax,Y,ay,R

write(21,'(f4.2,4(1x,a1,1x,f6.3))')T,'&',X,'&',ax,'&',Y,'&',ay

go to 10

endif

close(20)

close(21)

end
Topic revision: r1 - 08 Jan 2005, AgaF
 
This site is powered by FoswikiCopyright © CC-BY-SA by the contributing authors. All material on this collaboration platform is copyrighted under CC-BY-SA by the contributing authors unless otherwise noted.
Ideas, requests, problems regarding Foswiki? Send feedback