Lesson 1 of 15
The Tent Map
The Tent Map
The tent map is one of the simplest chaotic dynamical systems. It is a piecewise-linear map defined on [0,1]:
For the parameter value r = 2, the tent map is exactly chaotic: almost every initial condition produces a trajectory that never settles into a periodic orbit. The map is a foundational example because its Lyapunov exponent — the average rate of exponential divergence between nearby trajectories — can be computed analytically.
Because |f'(x)| = r everywhere (except at x = 0.5), the Lyapunov exponent is simply ln(r). For r = 2, λ = ln(2) ≈ 0.693, confirming exponential sensitivity to initial conditions.
Implement the following functions:
tent_map(x0, r, n)— iterate the tent map starting fromx0fornsteps, returning a list ofn+1values (including the initial value)tent_lyapunov(r)— return the analytic Lyapunov exponent ln(r)
Python runtime loading...
Loading...
Click "Run" to execute your code.