Periodic Steady State
Finding a limit cycle directly, instead of integrating until the transient has died away.
The problem with waiting
A driven oscillator settles onto a periodic orbit, but only asymptotically. "Settled" is measured below and lands around fifty periods for the system here — every one of them integrated at the accuracy the final answer needs, purely to be thrown away.
The steady state is a fixed point of the period map
MATHDISPLAY0ENDMATH
the state after integrating exactly one period from MATHINLINE1ENDMATH. Solving MATHINLINE2ENDMATH finds the orbit without passing through the transient at all.
FastSim solves it by Anderson-accelerated shooting: each outer iteration integrates one period and takes an Anderson step on MATHINLINE3ENDMATH. Only function evaluations — no monodromy matrix MATHINLINE4ENDMATH to assemble or factorise.
Simulation.periodic_steady_state() replaces the transient run. On convergence it records one period of the limit cycle in the Scope blocks, so everything downstream reads the same way.
The System
The driven Duffing oscillator — a mass on a spring whose stiffness grows with deflection:
MATHDISPLAY0ENDMATH
The cubic term is what makes it interesting: the response is not a scaled copy of the drive, and the orbit is not an ellipse.
System Parameters
These put the system on a period-1 orbit. The Duffing has parameter ranges with several coexisting attractors and chaotic ones besides; shooting finds a fixed point of the period map, so it is worth checking that the one it finds is the one the system settles onto — which is what the verification below does.
Block Diagram
A SinusoidalSource drives a DynamicalSystem carrying MATHINLINE0ENDMATH.
Solving for the Limit Cycle
periodic_steady_state takes the period and does the rest. It leaves one period of the converged orbit in the Scope.
Results
The orbit is closed and visibly not elliptical — the cubic stiffness flattens it where the deflection is largest.
Verification
Two things have to hold, and neither involves trusting the shooting method.
It is periodic. The state at the end of the recorded period must equal the state at its start. That is the defining property of the answer.
It is the orbit the system actually settles onto. Integrating the transient long enough must arrive at the same cycle — that is the answer the shooting method is a shortcut to. How long "long enough" is, is itself worth measuring.
The transient spirals in from its initial condition; the shooting solution is the orbit it spirals onto, reached without integrating the spiral.