A Byte of PhysicsLogo

Phase space and stability

Phase space plots state against state: for an oscillator, position on one axis and velocity on the other. It shows changes in system behavior that a position-time curve can hide.

Think like a programmer

Record state snapshots as data rows. A phase plot is a different view of the same solver state, so it should never have its own update rules.

Model checklist

Inputs
Time-series positions and velocities, plus a sampling rule.
State
Ordered phase-space points.
Rule
Append each state pair after integration.
Output
Orbit, spiral, fixed point, or more complex trace.
Check
Undamped ideal motion traces a closed curve within numerical tolerance.

Oscillator state sampler

Change stiffness, damping, and displacement. The force is restoring; damping affects velocity once the system is moving.

Stiffness 20 N/m; damping 1; displacement 0.40 m; acceleration -8.00 m/s²; natural angular frequency 4.47 rad/s; energy 1.60 J.

The plot is a projection of state

For a one-dimensional oscillator, one row of solver state is ((x,v,t)). A phase-space renderer should project only ((x,v)); it must not re-integrate, smooth, or guess missing velocity. That makes the trace a debugger for the same immutable samples that drive the time plot.

The ideal harmonic oscillator obeys:

\[\dot{x}=v, \qquad \dot{v}=-\frac{k}{m}x.\]

Its energy,

\[E=\frac12mv^2+\frac12kx^2,\]

is constant, so the phase trace is a closed ellipse. A fixed point is a row that advances to itself, such as ((0,0)) in the unforced ideal system. This is more useful than recognizing a shape: it supplies concrete regression expectations.

Read a trace as a test result

Use a consistent orientation: horizontal position, vertical velocity, and samples in increasing time order. Mark the first sample, current sample, and a direction cue so a closed curve is not mistaken for a static drawing. Store the sampling interval, coordinate units, integrator, time step, parameters, and any downsampling policy with the trace.

Then classify behavior from measured quantities:

  1. In an undamped oscillator, compare (E(t)) with (E(0)), the final state with the initial state after an integer number of reference periods, and the trace thickness under a smaller step.
  2. With linear damping, expect the energy envelope to decrease and the trajectory to approach a stable fixed point. The radius alone is not energy when axes use different scales.
  3. With a periodic drive, sample once per drive period as well as continuously. The once-per-period points reveal a fixed response, a cycle, or a more complicated attractor without confusing nearby time samples for separate states.
  4. With an unstable equilibrium, start on both sides of the exact state. A single perfectly balanced floating-point run is not evidence of stability.

For every classification, compare the same physical duration at two smaller time steps. Euler-style integration can produce an outward or inward spiral even when the analytic ideal oscillator should close. That artifact is a failure report about the stepper, not a discovery about the physics. Keep a small analytic harmonic fixture, a damped-energy monotonicity fixture, and a fixed-point fixture in automated tests before interpreting a more complicated phase portrait.

Try this experiment

Prediction: Damping turns a closed ideal orbit into an inward spiral.

Name the axes and explain which state property produces the spiral direction.

Where this model breaks

Phase plots depend on correct units and sampling. A too-large time step can create a false spiral or false energy growth.

Summary

Use phase space as a state debugger. Project recorded state rather than inventing a second solver, then test fixed points, energy behavior, time direction, and fixed-duration refinement before giving a trace a physical interpretation.

Glossary

Self-check

  1. Which axes describe an oscillator phase plot?
  2. What does damping do to its trace?
  3. Why record state after integration?

Sources

Model contract

Treat the lesson as a small function before treating it as a fact to memorize. Give every value a unit, keep only the state needed for the next step, and make the output easy to inspect.

\[\text{observable output} = f(\text{inputs},\,\text{state})\]
Inputs
Quantities you set or measure, with units and useful bounds.
State
Values the program must retain to reproduce the next result.
Rule
The relationship or update that turns inputs and state into a result.
Check
A known limit, unit check, invariant, or measured result that can expose a bad model.

Implement the idea as a model

For Phase Space and Stability, write down the quantities you can control, the values your program must retain, and the result a reader could inspect. In Oscillations, the useful program is not the drawing: it is the smallest explicit model that makes a prediction you can test.

Guided experiment

Prediction: changing one declared input while holding the others fixed should change only the outputs that the model connects to that input. Choose one input, predict the direction of change, then check a limiting case such as zero, a symmetric arrangement, or a familiar low-speed or small-change approximation.

Where this model breaks

This lesson is a teaching model, not a complete simulator. Before using it outside the stated question, check which interactions, scales, uncertainties, boundary conditions, and measurement limits it leaves out.

Summary

Treat Phase Space and Stability as a contract: named inputs and units enter a rule, the rule produces an observable result, and a known limit or invariant checks whether the implementation deserves trust.

Glossary

  • Input: a measured value or chosen parameter supplied to a model.
  • State: the smallest set of values needed to continue or reproduce a model.
  • Validation: comparing an output with a known result, limit, invariant, or measurement.

Self-check

  1. Which values are inputs, and which values must remain state?
  2. What observable result would tell you the model is behaving as expected?
  3. Which assumption would you test first before applying the model to a real system?

Model review: turn Phase Space and Stability into a test

Plot oscillator position against velocity to inspect state evolution, damping, and stability.

  1. Name the inputs and units that the oscillations model needs.
  2. Separate the state you must keep from values you can calculate when needed.
  3. Write one rule that maps the current state and inputs to an observable result.
  4. Choose a limiting case, unit check, invariant, or known result before trusting an output.
  5. State one assumption you would change before using this simplified model for a real decision.

Share to: