8.5b Nonlinear oscillation labs
Source: Lab ideas from Computational Physics (Landau, Páez, Bordeianu), §8.5. Original drills. Continues 8.5.
Explorer
Pure Python. No NumPy / VPython.
Formula refresh
Warm up: pick the matching equation among lookalikes (same walk as the theory lesson).
Labs
Activity: Anharmonic micro-step
From , take one RK2 step with and (). Print x v with 10 decimals.
No input.
Write-ups
Using “period”, “amplitude”, and “anharmonic”, explain:
How can you estimate the period of a nonlinear oscillator from a numerical trajectory?
Minimum 3 words. Your answer must include: “period”, “amplitude”, “anharmonic”.
0 words
Meet the writing requirements, then you can open the model answer.
Explorers
# period_detect_sketch.py — original (no textbook dump)
# Integrate RK4 with F=-x**3; record times when x crosses 0 with v>0.
# T ≈ t_cross[i+1] - t_cross[i]; compare T vs amplitude.