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]:

f(x)=rxif x<0.5,f(x)=r(1x)otherwisef(x) = r \cdot x \quad \text{if } x < 0.5, \quad f(x) = r \cdot (1 - x) \quad \text{otherwise}

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 from x0 for n steps, returning a list of n+1 values (including the initial value)
  • tent_lyapunov(r) — return the analytic Lyapunov exponent ln(r)
Python runtime loading...
Loading...
Click "Run" to execute your code.