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.
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.
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.
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:
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.
Prediction: Damping turns a closed ideal orbit into an inward spiral.
Name the axes and explain which state property produces the spiral direction.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.
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})\]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.
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.
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.
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.
Plot oscillator position against velocity to inspect state evolution, damping, and stability.