numerical programming - - ap6
numerical programming - - ap6
f(x) is the derivative of the system at the current state, delta t is time step size.
3. Lorenz system simulation
steps include derivative function (lorenz_deriv) computes derivatives of the system as a given
state. function trbdf2_step implements trbdf2 method, including prediction step ad solution of the
implicit system using newton's method. newton_method function solves implicit equation using
numerical Jacobian and iterative refinement. and the function simulate_lorenz_trbdf2 simulates
Lorenz system over time and generates plots of the output.
3d plot trajectory shows chaotic nature of system, spirals around the attractor. starting from initial
condition(1.0,1.0,1.0,1.0). parameters used (σ = 10.0, β = 2.6667, ρ = 28.0) are typical for the Lorenz
system, demonstrating the classic butterfly-shaped attractor.
logarithmic distance plot shows distance between trajectory and initial condition over time.
demonstrates exponential divergence of trajectories in chaotic system. early on, distance remains
small, but as time progresses, it increases rapidly. This exponential divergence is a manifestation of
sensitive dependence on initial conditions, a key feature of chaotic systems.
all in all, regarding toy model, I use the Lorenz system, a well-known toy model in chaos theory. it is a
simplified set of equations that describe atmospheric convection and chaotic behavior. This model is
chosen because of its ability to demonstrate the sensitive dependence on initial conditions, of chaotic
systems.