8.5 Nonlinear oscillation solutions
Source: Ideas from Computational Physics (Landau, Páez, Bordeianu), §8.5. Original wording. Continues 8.4b. Labs: 8.5b.
Same stepper, new force
Once is in dynamic form, swapping potentials is a one-line change in :
or the soft model . Integrate with RK2/RK4 exactly as for the harmonic case.
What changes physically
- Period vs amplitude. For , larger energy ⇒ different period. Measure by detecting successive crossings with (or peaks of ).
- Energy still checks the ODE. For autonomous conservative , should stay flat if the algorithm is accurate — even when is not .
- Soft . Start with small amplitude; push past and watch escape.
Slide amplitude and softness below: the measured period stretches away from the harmonic as grows.
Energy as a diagnostic
For the harmonic benchmark, compare Euler vs RK2 energy drift at fixed final time. Nonlinear runs reuse the same plot idea with the matching .