PROGRAM Lorentz_attractor
PARAMETER(kx=100000)
INTEGER::i,j,n,k
REAL::a,r,b,t(kx),dt,x(kx),y(kx),z(kx) !a=sigma
OPEN(15,FILE="p3.dat",STATUS="unknown")
r=28.0
a=10.0
b=8.0/3.0
x(1)=0.0 !Initial points
y(1)=1.0
z(1)=0.0
dt=(0.001)
t(1)=0.0
DO i=1,kx-1
x(i+1)=x(i)+dt*a*(y(i)-x(i))
y(i+1)=y(i)+dt*(r*x(i)-y(i)-x(i)*z(i))
z(i+1)=z(i)+dt*(x(i)*y(i)-b*z(i))
t(i+1)=t(i)+dt
ENDDO
DO i=1,kx-1
WRITE(15,1)t(i),x(i),y(i),z(i)
ENDDO
1 FORMAT(4(F7.3,1x))
END PROGRAM
PARAMETER(kx=100000)
INTEGER::i,j,n,k
REAL::a,r,b,t(kx),dt,x(kx),y(kx),z(kx) !a=sigma
OPEN(15,FILE="p3.dat",STATUS="unknown")
r=28.0
a=10.0
b=8.0/3.0
x(1)=0.0 !Initial points
y(1)=1.0
z(1)=0.0
dt=(0.001)
t(1)=0.0
DO i=1,kx-1
x(i+1)=x(i)+dt*a*(y(i)-x(i))
y(i+1)=y(i)+dt*(r*x(i)-y(i)-x(i)*z(i))
z(i+1)=z(i)+dt*(x(i)*y(i)-b*z(i))
t(i+1)=t(i)+dt
ENDDO
DO i=1,kx-1
WRITE(15,1)t(i),x(i),y(i),z(i)
ENDDO
1 FORMAT(4(F7.3,1x))
END PROGRAM
Comments
Post a Comment