main.f90

来自「这是一个可以用来计算洛仑兹方程解的程序」· F90 代码 · 共 31 行

F90
31
字号
program main
implicit none
real*8 lef,rig,f,h,no,t0,i,x0,y0,z0,x1,y1,z1
integer n
!parameter(theta=10,r=24.74,b=8/3)
lef=0      !left of []
rig=20    !rigth of []
no=1.0e4 !number of steps
h=abs(rig-lef)/no ! step length
t0=0
x0=0.1       !start value of x
y0=0.4      !strat value of y
z0=0.5       !strat value of z
open(9,file='test.txt',status='unknown')
do i=1,no
   t0=t0+h
   n=1 
   call rk4(t0,x0,y0,z0,h,n,x1) !caculate the first equation of ode
   x0=x1
   n=2 
   call rk4(t0,x0,y0,z0,h,n,y1) !caculate the second equation of ode
   y0=y1
   n=3
   call rk4(t0,x0,y0,z0,h,n,z1) !caculate the third equation of ode
   z0=z1
   write(9,*)x1,y1,z1
end do
close(9)
end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?