Lesson 3 of 15

Fixed Points and Stability

Fixed Points and Stability

A fixed point (or equilibrium) of a dynamical system is a state that does not change over time. Understanding their stability tells us whether the system returns to equilibrium after a small perturbation.

1D Systems

For x˙=f(x)\dot{x} = f(x), a fixed point xx^* satisfies f(x)=0f(x^*) = 0.

Stability criterion:

  • f(x)<0f'(x^*) < 0stable (perturbations decay)
  • f(x)>0f'(x^*) > 0unstable (perturbations grow)

We estimate the derivative numerically using the central difference:

f(x)f(x+h)f(xh)2hf'(x) \approx \frac{f(x+h) - f(x-h)}{2h}

2D Systems

For x˙=f(x,y)\dot{x} = f(x, y) and y˙=g(x,y)\dot{y} = g(x, y), stability is determined by the Jacobian matrix at the fixed point:

J=(f/xf/yg/xg/y)J = \begin{pmatrix} \partial f/\partial x & \partial f/\partial y \\ \partial g/\partial x & \partial g/\partial y \end{pmatrix}

The eigenvalues of JJ determine the behaviour. From the characteristic polynomial λ2τλ+Δ=0\lambda^2 - \tau\lambda + \Delta = 0 (where τ=J11+J22\tau = J_{11}+J_{22} is the trace and Δ=J11J22J12J21\Delta = J_{11}J_{22} - J_{12}J_{21} is the determinant):

λ1,2=τ±τ24Δ2\lambda_{1,2} = \frac{\tau \pm \sqrt{\tau^2 - 4\Delta}}{2}

ConditionClassification
Δ<0\Delta < 0Saddle point (always unstable)
τ<0, Δ>0, τ2>4Δ\tau < 0,\ \Delta > 0,\ \tau^2 > 4\DeltaStable node
τ<0, Δ>0, τ2<4Δ\tau < 0,\ \Delta > 0,\ \tau^2 < 4\DeltaStable spiral
τ>0\tau > 0Unstable
τ=0, Δ>0\tau = 0,\ \Delta > 0Centre (neutrally stable)

Your Task

Implement:

  • numerical_derivative(f_func, x, h=1e-6) — central difference approximation of f(x)f'(x)
  • is_stable_1d(f_func, x_star) — returns True if the fixed point is stable
  • jacobian_eigenvalues(J11, J12, J21, J22) — returns (lambda1, lambda2) as real floats (the real parts, sorted descending); for complex eigenvalues return the real part τ/2\tau/2
Python runtime loading...
Loading...
Click "Run" to execute your code.