Each of these questions will involve analysis of numerical solutions to the Lorenz equations:
To facilitate the exercises, I’ve posted matlab code on the course website. For example, lorenz_simple.m and rk2.m integrates & plot the Lorenz attractor. Unless otherwise specified, use the standard parameter values , , . In answering each question, include your code and pictures, and comment on what the pictures are telling you.
Problem 1
Question
Modify the box counting dimension code from HW8 to compute the fractal dimension of the Lorenz attractor. In order to get a good estimate, you may need to integrate for awhile, e.g. time units. As in HW8, plot the attractor adjacent to the dimension estimate. You may need to reduce the number of box width divisions to get a good approximation of the dimension, which should be close to 2.06.
ported the hw8 boxcount to 3d using np.histogramdd (same idea: partition the bounding box into cells at step , count occupied cells, fit slope of vs ). lorenz integrated via the rk2 scheme from rk2.m, time units at , transient discared.
the vs points are roughly linear for the first few subdivisions then saturate as box count approaches sample count. this is the finite-data ceiling the problem warned about; at step 7+ you’re asking for cells smaller than the trajectory’s point spacing, so occupied-cell count grows sublinearly. restricting the fit to steps – (the scaling region before saturation) gives
close to the literature value . including saturated tail drags slope down toward , which matches the “reduce the number of box width divisions” hint. widening fit to steps – gives ; pushing past step the estimate collapses.

Answer
, fit over steps – of the 3D box count. consistent with known vals , small undershoot expected result of finite sampling of the log-log curve at fine scales.
Code
Problem 2
Question
After reading section 9.3 in the text, calculate the Lyapunov exponents of the Rössler Attractor. I’ve put code on Teams that does this for the Lorenz Attractor
hw11q2.m,stepit.m,LEcalc.mwhich you can edit to reflect the Rössler differential equation. Use the parameters .The code integrates the appropriate variational equation (9.17 from the book is one-third of it) to determine the matrix that will act on a unit ball every unit in time. Note that it may take a minute or two for the code to run as a lot is happening.
ported stepit.m (RK4) and LEcalc.m to python first using gemini(all edits after done by mysefl). the Rossler flow and its Jacobian are
burn in for time units, then for unit intervals integrate the variational equation together with the state via RK4 at , QR-decompose, and accumulate .
for this gives
matches the textbook values (). the second exponent hovering near zero is the flow direction. confirms chaos. the Kaplan-Yorke dimension
recovers the “looks like a surface” remark from Fig 9.6.

Answer
Lyapunov spectrum , Lyapunov dimension . positive leading exponent means chaotic, middle exponent is the flow direction, strongly negative drives attractor onto a near-2D surface.
Code
Problem 3
Question
An important feature of the Lorenz attractor is its robustness–it persists in the basic form of Figure 9.2 over a significant range of parameters. Fix and plot the largest Lyapunov exponent for a large number of values in the plane, e.g. and by increments of . Can you see a boundary between chaos and stability?
grid points at . full QR-based Ecalc on every point is faaar too slow, so Benettin’s single-vector trick works: evolve state and one tangent together via
renormalize every unit of time and accumulate . vectorize accross all 60k pairs simultaneously in numpy. RK4 at , , then unit intervals.

two main regions emerge, not really clean as the boundary seems to be quite jagged. red strip () is the chaotic parameter band containing the standard parameter point. points on the left (, growing with ) .
chaos in Lorenz isnt a straight edge and instead inhabits a thickly connected region in the plane.
Answer
yes, clear boundary. computed on the full grid via vectorized Benettin iteration. the contour carves out a finite-width chaotic wedge in space; outside it the dynamics relax to a fixed point (either the origin at small or at large ).
Code
Problem 4
Question
Reproduce figures 9.3 and 9.4 from the text. Interpret the -maximum return map considering what you know about the slope-2 Tent map. For the bifurcation diagram, your -axis should be . Describe the physical meaning of the attracting states plotting in this diagram (with respect to the convection experiment discussed in class) as the parameter increases.
integrate Lorenz with RK4 at , detect local maxima of via sign flip of increment. fig 9.3 plots consecutive maxima as the return map vs at . fig 9.4 vectorizes across values of and scatters all observed -maxima.


the return map is almost a tent( i mentioned in class that it looks a bit like a Laplace Distribution ), one rising and one falling branch meeting at a cusp near . both branches have slope magnitude everywhere:
same argument that gives the slope-2 tent . Lorenz return map has same structure. also why Lorenz attractor can be coded by a 1D map.
physical meaning of bifrucation diagram (convection experiment, ):
- (off the plot): pure conduction, fluid motionless. origin globally stable.
- : steady convection rolls. two symmetric fixed points .
- to : the butterfly chaotic attractor. rolls no longer steady; the convection direction flips erratically.
- periodic windows inside the chaotic band (visible around ): locked periodic convection.
- to : period-doubling cascade running in reverse as increases.
- : a single-branch periodic orbit, a stable limit cycle.
reading left to right: rest → steady convection → turbulent reversals → period-halving → clean oscillation
Answer
return map is a near-tent with everywhere, so by the same argument as for slope-2 tent; nearly-1D because of volumetric contraction at rate
Code
Problem 5
Question
Meteorologists have very different jobs depending on where they live. In the US, the spectrum is particularly diverse because of the terrain and climate. Consider, for example, southern California (sunny and 70 all year) and Mount Washington, NH (windiest place on Earth). Imagine you live in the Lorenz attractor and your job is to predict the weather. Where would your job be easiest?
To answer this question, you will make a weather map, plotting the maximum real part of the eigenvalues of the Jacobian matrix for a variety of initial conditions in 2-D planes for , and . The matlab command
scatter(x,y,2,j,’filled’); colorbar(’SouthOutside’);will perform this operation for a set of initial conditions with max real part eigenvalue equal to . Make each slice in for , and for a total of 9 figures.Note: you do not need to integrate the ODE in order to answer this question, you simply need to compute the Jacobian matrix of the Lorenz equations for each point in a grid. Use as many points as your computer can handle. They could be either randomly or uniformly chosen for (same for ).
foreach on a given grid in at each slice, we build the Lorenz Jacobian
and find . positive means local divergence, negative means local contraction.
batched via np.linalg.eigvals on a stack, no ODE integration.

pattern is that the locally stable regions in blue concentrate along a curved strip. locally unstable regions in red are strongest at high and at small . raising enlarges the unstable region. raising tends to quiet things.
where would the meteorologist live? blue pockets near the two convection fixed points . those are the “southern California” of the attractor. at , , sit at , and the map shows deep-blue basins exactly there.
the “Mount Washington” spots are the saturated-red regions, particularly around the outer edges at .
at (top row), most of the plane is blue. by (bottom row) the unstable red regions are large and interpenetrating.
Answer
live near , the blue basins at the eyes of the butterfly lobes. high- fringes and small- regions are the Mount Washingtons: , forecasts decorrelate in fractions of a time unit. raising expands the chaotic red territory; at (pre-bifurcation) nearly the whole plane is predictable.