PROGRAM van_der_Pol_Oscillator
parameter (kx=50000)
integer::i,j,n,k
real::t(kx),x(50,kx),v(50,kx),u
open(15,file="vpolin.dat",status="unknown")
open(25,file="vpolout.dat",status="unknown")
write(*,*) "enter the value of mue"
read(*,*) u
read(15,*) k
dt=0.001
t(1)=0.0
do n=1,k
read(15,*) x(n,1),v(n,1)
enddo
do n=1,k
do i=1,kx-1
x(n,i+1)=x(n,i)+dt*v(n,i)
v(n,i+1)=v(n,i)-dt*u*((x(n,i)**2-4)*v(n,i))-dt*x(n,i)
t(i+1)=t(i)+dt
enddo
enddo
do i=1,kx
write(25,3) t(i),(x(n,i),n=1,k),(v(n,i),n=1,k)
enddo
3 format (20(f7.3,1x))
end
parameter (kx=50000)
integer::i,j,n,k
real::t(kx),x(50,kx),v(50,kx),u
open(15,file="vpolin.dat",status="unknown")
open(25,file="vpolout.dat",status="unknown")
write(*,*) "enter the value of mue"
read(*,*) u
read(15,*) k
dt=0.001
t(1)=0.0
do n=1,k
read(15,*) x(n,1),v(n,1)
enddo
do n=1,k
do i=1,kx-1
x(n,i+1)=x(n,i)+dt*v(n,i)
v(n,i+1)=v(n,i)-dt*u*((x(n,i)**2-4)*v(n,i))-dt*x(n,i)
t(i+1)=t(i)+dt
enddo
enddo
do i=1,kx
write(25,3) t(i),(x(n,i),n=1,k),(v(n,i),n=1,k)
enddo
3 format (20(f7.3,1x))
end
Comments
Post a Comment