A driven oscillator receives energy from an external time-varying force. Its response becomes large near a frequency set by mass, stiffness, and damping, but “near resonance” is a measured frequency-response result—not a claim based on the largest animation frame. A drive must be a timestamped force input with a phase convention and an energy-transfer ledger.
Think like a programmer
Inject drive as an explicit pure function of time. Sweep frequency using the same initial-state policy, duration, step schedule, transient-removal rule, amplitude estimator, and units for every point. Record both drive work and damping loss. Do not choose a peak from startup motion; measure a late-window amplitude, RMS response, or fitted sinusoid after the declared transient policy.
Model checklist
Inputs
m, k, c, drive amplitude F0, angular frequency ω, drive phase, initial state, sweep grid/order, start/end time, step/integrator, transient-removal window, response estimator, and output units.
Evaluate Fdrive(t) with a stated phase; integrate combined spring/damping/drive force; discard or separately label transient samples; apply one fixed estimator to the retained window.
Output
Frequency-response curve, peak estimate and uncertainty/resolution, energy-transfer ledger, transient flag, and refinement/sweep-order comparison.
Check
Zero drive gives the corresponding free response; identical settings reproduce identical response; changing phase convention changes timestamped force but not a settled linear amplitude magnitude; late-window measurement differs from startup peak when transients exist; smaller step and denser frequency sweep stabilize the reported peak within tolerance.
\[m\ddot{x}+c\dot{x}+kx=F_0\cos(\omega t)\]
Oscillator state sampler
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.
In the ideal linear model, steady response can be described by an amplitude function after transients decay. Damping limits the peak and makes its width meaningful; finite sweep spacing can miss the maximum entirely. Keep frequency units clear: ω is radians per second, while ordinary frequency f is cycles per second and ω = 2πf.
The amplitude formula is a reference for a linear, sinusoidally driven, settled system. Use it at selected frequencies to test a solver, then refine both time step and frequency grid. Record whether amplitude means half peak-to-peak, RMS times √2, or a fitted coefficient; different estimators can disagree in a transient or non-sinusoidal signal.
Try this experiment
Prediction: Damping broadens and lowers a resonance peak, while a peak selected before transients decay can be misleading.
Sweep a declared frequency grid at fixed F0, m, and k. Discard a named number of periods or use a convergence criterion, then measure late-window amplitude with one estimator. Repeat with higher damping and a denser grid. Compare selected points with the analytic linear reference and report drive work versus damping loss over the retained window.
Where this model breaks
Nonlinear springs can shift resonance and create multiple response states. Large drives may invalidate the linear model. Finite duration, imperfect transient removal, sweep hysteresis, numerical damping, noisy forcing, coupled modes, and an ambiguous amplitude estimator can all distort a response curve.
Summary
Model resonance as a measured late-window frequency response from an explicit drive, with fixed amplitude estimator, energy ledger, time-step/frequency-grid refinement, and the linear-reference scope clearly stated.
Glossary
Drive: external force supplying energy.
Resonance: strong response near a characteristic frequency.
Transient: early behavior before long-term response settles.
Response estimator: reproducible rule for extracting amplitude or RMS from a time window.
Sweep resolution: frequency spacing that bounds how precisely a peak can be located.
Self-check
What function supplies driving force?
Why must every frequency share the same transient policy?
How does damping change the ideal response curve?
What two refinements support a reported resonance peak?
Sources
S. H. Strogatz, Nonlinear Dynamics and Chaos.
OpenStax, University Physics Volume 1, driven oscillations.
Model contract
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.
Quantities you set or measure, with units and useful bounds.
State
Values the program must retain to reproduce the next result.
Rule
The relationship or update that turns inputs and state into a result.
Check
A known limit, unit check, invariant, or measured result that can expose a bad model.
Implement the idea as a model
For Driven Systems and Resonance, 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.
Guided experiment
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.
Where this model breaks
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.
Summary
Treat Driven Systems and Resonance 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.
Glossary
Input: a measured value or chosen parameter supplied to a model.
State: the smallest set of values needed to continue or reproduce a model.
Validation: comparing an output with a known result, limit, invariant, or measurement.
Self-check
Which values are inputs, and which values must remain state?
What observable result would tell you the model is behaving as expected?
Which assumption would you test first before applying the model to a real system?
Model review: turn Driven Systems and Resonance into a test
Measure oscillator frequency response from an explicit periodic driving-force function.
Name the inputs and units that the oscillations model needs.
Separate the state you must keep from values you can calculate when needed.
Write one rule that maps the current state and inputs to an observable result.
Choose a limiting case, unit check, invariant, or known result before trusting an output.
State one assumption you would change before using this simplified model for a real decision.