X

Help Articles are product support tips and information straight from the NV5 Geospatial Technical Support team developed to help you use our products to their fullest potential.



4440 Rate this article:
No rating

Lorenz Attractor in IDL

This IDL program creates a interactive 3D plot of the Lorenz Attractor, one of the classic symbols of complexity theory. Its unpredictable yet coherent behavior is complex in apprearance - but easy to create.

The Lorenz equation was published in 1963 by a meteorologist and mathematician from MIT called Edward N. Lorenz. The paper containing the equation was titled "Deterministic non-periodic flows'' and was published in the Journal of Atmospheric Science. What drove Lorenz to find the set of three dimentional ordinary differential equations was the search for an equation that would "model some of the unpredictable behavior which we normally associate with the weather''. The Lorenz equation represents the convective motion of a fluid cell which is warmed from below and cooled from above. The same system can also apply to dynamos and lasers. In addition, some of its popularity can be attributed to the beauty of its solution. It is also important to state that the Lorenz equation has enough properties and interesting behavior that whole books are written analyzing results. 

Code example:

FUNCTION dfdt,t,f

	; The Lorenz system of ODEs
	df=fltarr(3,/nozero)
	df(0) = 10.*(f(1)-f(0))
	df(1) = -f(0)*f(2) + 28.*f(0) - f(1)
	df(2) = f(0)*f(1) - (8./3.)*f(2)
	return,df

END

PRO rk4,t,dt,f

	; The classical Runge-Kutta Method
	dt1= 0.5*dt
	d1 = dfdt(t, f)
	f1 = f + dt1*d1
	d2 = dfdt(t+dt1, f1)
	f2 = f + dt1*d2
	d3 = dfdt(t+dt1, f2)
	f3 = f + dt*d3
	d4 = dfdt(t+dt, f3)
	f  = f + (dt/6.)*(d1+d2+d2+d3+d3+d4)
	t  = t + dt

END

FUNCTION Lorenz,n,f0=f0,dt=dt,t=t

	; Return a solution of the Lorenz system
	if n_elements(n ) eq 0 then n=1000
	if n_elements(dt) eq 0 then dt=0.01
	if n_elements(f0) eq 0 then f0=[10.,10.,10.]
	t=0.0
	f=fltarr(3,n)
	f(*,0)=f0
	ff=f0
	for it=1,n-1 do begin
		rk4,t,dt,ff
		f(*,it)=ff
	end
	t = dt*indgen(n)
	return,f

END

PRO Lorenz_Test

	a=fltarr(3000,3)
	a=lorenz(3000, f0=[1.,10.,10.],dt=0.01,t=1000)
	xplot3d, reform(a[0,*]), reform(a[1,*]), reform(a[2,*]), color=[0,0,255], $
		 xtitle='X(t)', ytitle='Y(t)', ztitle='Z(t)'

END
Please login or register to post comments.
Featured

End-of-Life Policy Enforcement for ENVI 5.3 / IDL 8.5 and Earlier Versions

5/6/2024

April 1, 2024 Dear ENVI/IDL Customer,  We are reaching out to notify you of our supported... more »

How to Upgrade licenses to ENVI 6.x / IDL 9.x

12/5/2023

What is the new Upgrade function? Starting with ENVI 6.0 and IDL 9.0, we have implemented an... more »

What to do if the 'License Administrator - License Server' for the Next-Generation License Server does not start?

6/13/2023

Background: With the release of ENVI 5.7 & IDL 8.9 and the corresponding Next-Generation licensing... more »

Next-Generation Licensing FAQ

4/28/2023

  NV5 Geospatial has adopted a new licensing technology for all future releases of our ENVI, IDL... more »

The IDL Virtual Machine

6/6/2013

What is the IDL Virtual Machine? An IDL Virtual Machine is a runtime version of IDL that can... more »