|
Exercise 10: The Lorenz Attractor
|
|
NOTE: Some of you may have disk quota on fys.ku.dk ,
astro.ku.dk or nbi.dk that are close to, or
above
the limit.
-
Use the command "
quota -v " to check that you
are within
limits. Use "df " from your home dir to identify
the
correct file system.
-
Use the command "
du | sort -n " (from your home dir) to
see where most of the file
space is being used.
-
If you are above the limit you have to remove enough files
to get under
your "soft " limit, in order to clear your 'criminal' record
for this time.
- Look for *.x files in previous exercise
directories and remove
those files. Often "make clean" will do the job.
- Cache of Firefox or other browser files can also be a
problem; reduce the
amount of disk cache, and "clear" the cache from within the
browser.
-
If you remain above the soft limit for 7 days, you may be
unable to login
over an X-connection, because the ~/.Xauthority
file cannot
be written.
-
If that happens, use a window on someone elses display,
and login with for example "ssh
userid@fys.ku.dk" to remove files.
|
CVS
|
[about 1 minute]
|
To extract the exercise files for this weeks exercise, do
cd ~/ComputerPhysics
cvs update -d
In case of problems, see the CVS
update help page.
IDL Procedures and
Exercises
|
[about 30 minutes]
|
To avoid problems with "undefined procedures or functions"
make
sure IDL
can find the necessary procedures.
-
Get an example of a solution to the Lorenz problem by running the
lorenz.pro procedure.
-
NOTE: You can copy/paste from this window, but
it may be a better exercise to type the commands manually.
IDL> f=lorenz()
IDL> help,f ; check what type of variable the answer is
-
Plot the time behavior of single coordinates
IDL> plot,f[0,*]
IDL> plot,f[1,*]
-
Plot the xy and xz projections
IDL> plot,f[0,*],f[1,*]
IDL> plot,f[1,*],f[2,*]
-
Set up two 3D perspective transformations and show / animate the
result
IDL> tr=setup(az=30,ax=20,persp=3)
IDL> showtail,f,tr
IDL> showtail,f,tr,wait=0.02 ; slower (0.005 sec default)
-
Note that, by chance, the solution almost retraces earlier orbits,
towards
the end. The default solution has 1000 steps, so if you make one
with 1500
steps you have a chance to see the solutions diverge again:
IDL> f=lorenz(1500)
IDL> tr=setup(az=30,ax=20,persp=3)
IDL> showtail,f,tr,wait=0.01
-
Calculate two solutions, from two slightly different initial values,
and
compare one of the coordinates.
IDL> f1=lorenz(f0=f0)
IDL> f2=lorenz(f0=1.0001*f0)
IDL> plot,f1[0,*]-f2[0,*]
IDL> plot,f1[0,*]
IDL> oplot,f2[0,*],line=2
-
The Lyapunov exponent lambda characterizes the average
exponential
growth. Try a few, with
IDL> f1=lorenz(t=t) ; t is returned
IDL> plot,/ylog,t,abs(f1[0,*]-f2[0,*])
IDL> lambda=... ; take your pick
IDL> oplot,t,1e-4*exp(lambda*t),line=3 ; try it out
3D Visualization
with IDL Object Graphics
|
[about 45 minutes]
|
IDL Object Graphics provides high level graphics functionality, such as
interactive
3-D visualization, with a very small programming effort.
Detailed documentation is available though the IDL online help system,
but you do
not need it to carry out this exercise.
Example 1:
Open the file viz3d_simplest.pro from IDLDE, compile it and run
it.
With just three lines of code it produces an interactive display of the
Lorenz
attractor.
- The expression f=lorenz() produces the {x,y,z} coordinates,
in the form of
an array dimensioned [1000,3].
- The call to obj_new('IDLgrPolyLine',data=f) returns a
"polyline" graphics
object representing the coordinates in 3D.
- The call to xobjview produces an interactive display
showing the object.
- Resize the window to a convenient size.
- Use the three toolbuttons rotate, zoom, and pan
(identified by tooltips when you point at them), and the mouse,
to rotate, zoom, and pan!
The three lines can actually be combined to one. Try this one-liner:
IDL> xobjview,obj_new('IDLgrPolyLine',data=lorenz())
Example 2:
Open the file viz3d_simple.pro from IDLDE, compile it and run it.
Consider how it differs from the previous one.
- The call to obj_new('IDLgrModel') produces an abstract
'container' to
which graphics objects may be added.
- The call to the object method m->Add, o adds the
polyline from the previous
example to it.
- The call to the object method m->Add, bbox(f) adds a
bounding box,
constructed by the bbox.pro procedure.
Example 3:
Open the file viz3d.pro from IDLDE, compile it and run it.
Consider how it again differs from the previous one.
- The color of the background is changed.
- The calls to o->SetProperty, color=[R,G,B] set the
color of
the objects (using red, green, and blue values between 0 and 255).
Task: Given the examples above,
- modify the viz3d.pro procedure so that it
shows two paths, differing for example with a factor 1.0001 in the
initial
conditions.
- show the two paths in different colors
Example 4:
Open the file viz3d_live.pro from IDLDE, compile it and run it.
Consider once again how it differs from the previous one.
- The state is saved, so one can rotate the view and rerun:
- The color of the background is changed.
- Task:
Use pen and paper, or Maple (or Mathematica) to find the point (with
positive
x, y and z) where the "velocity" vanishes; the center of one of the
leafs:
- Task: Given the code that uses bbox to draw a big
box,
- modify the procedure so it shows a (very) small box at that point,
and at the center location [0,0,0]
Mathematica
Notebook
|
[spend about 45 minutes]
|
A Mathematica Notebook about the geometry
of the Lorenz attractor is available in your 10_Lorenz
directory.
The instructions are built into the Notebook; just start Mathematica
("mathematica &" from a UNIX prompt) and open the file
10_Lorenz/Exercise.nb.
As a check that you have been through the notebook, and understand
how to run it; assuming that the Rayleigh number,
r, is set equal to 100 ...
Home Work
|
[about 2 hours]
|
This weeks home work (or non-exercise hours) should bring you up-to-date
with respect to all the exercises. If you still are behind from Project
1
then go back and finish that, as well as Exercise 8 and 9.
You may want to prepare for the lecture next week by reading about
Partial
Differential Equations in Numerical Recipes.
$Id: index.php,v 1.17 2009/07/12 09:50:05 aake Exp $