Demo entry 2774211

Attrattore

   

Submitted by anonymous on Sep 29, 2015 at 11:51
Language: Fortran. Code size: 639 Bytes.

Program Attrattore_implicito
implicit none
real(8)::x0,y0,z0,x,y,z,xp,yp,zp,dt,eps,err
integer::i,tempo,n,cont

tempo=250000
dt=0.0002
eps=0.0000

x0=0.5+eps
y0=0.1
z0=0.3

n=tempo/dt

open(unit=1,file="Attrattore_implicito_pdf_4.txt",status='replace')

do i=1,n

x=x0
y=y0
z=z0

err=1
cont=0

do while (err>1E-5 .AND. cont<10)
cont=cont+1

xp=x
yp=y
zp=z

x=x0+dt*10*((y0+yp)*0.5-(x0+xp)*0.5);
y=y0+dt*(35*(x0+xp)*0.5-(y0+yp)*0.5-(x0+xp)*0.5*(z0+zp)*0.5);
z=z0+dt*(-(8/3)*(z0+zp)*0.5+(x0+xp)*0.5*(y0+yp)*0.5);

err=max(x-x0,y-y0,z-z0)

end do

x0=x
y0=y
z0=z

if(mod(i,1000) .EQ. 0) then
write(1,*) i*dt,x,y,z
end if

end do

end program

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).