Van der Pol / Duffing
Explore nonlinear oscillators with precise initial states, live parameters, phase portraits and drive-period sections.
About this tool
Compare oscillator behaviour
Select a model or preset and Run. Preparation computes the warm-up and initial trace; Cancel stops it. Live coefficient edits preserve position, velocity and drive phase. Initial values and numerical settings start a new experiment. Pause, One step and the four views let you inspect it; changing view preserves the trace. One step advances exactly Δt.
Equations and reference cases
Van der Pol: ẋ=v, v̇=μ(1−x²)v−x. μ=0 is a harmonic oscillator; positive μ can approach a limit cycle. No constant amplitude is reported as a measured result. Dashed nullclines are v=0 and v=x/[μ(1−x²)], with separate branches; at μ=0 the second is x=0.
Duffing: ẋ=v, v̇=γcosθ−δv−αx−βx³, θ̇=ω. Live frequency changes preserve θ. α<0,β>0 gives a double-well potential; α>0,β>0 a hardening spring. Preset names do not certify chaos. Without a drive, no period section is offered.
Plots and exports
Phase portraits use equally scaled x/v axes. Time plots show true model time. Drive sections interpolate once at θ=2πk, including after frequency changes. They can include transients and are not proof of an attractor. Mechanical E=v²/2+x²/2 for Van der Pol and E=v²/2+αx²/2+βx⁴/4 for Duffing. It is conserved only in appropriate unforced undamped cases. Live parameter edits can also change the potential energy.
All states and times are dimensionless. RK4 uses fixed Δt; reduce it to assess numerical error. Warm-up is in steps; up to1800 recent trace samples and400 period points are retained. Playback can slow under load and suspends while hidden. Escape stops at the last valid state. PNG pauses and saves current pixels and final parameters; live coefficient changes make it a snapshot, not a full reproduction log. CSV stores each retained row with its own coefficients, phase and chosen initial values. Neither export includes the complete discarded history.
Keep an experiment
Raw inputs, fractions and inactive coefficients are retained. Each trajectory point retains its own historical coefficients, so old energy plots and CSV data are not relabelled after live edits. No replay with current coefficients is used. An invalid active input pauses playback and keeps the last valid experiment. Files are bounded to 1 MiB and checked; a rejected import preserves the current experiment. The shared local storage limit is unchanged. Unfinished preparation is not resumed.
Only input values are remembered in this browser. Calculated results and experiment histories are not saved.