PHYSICS · Multi-part · Fermi University Physics · Computational Physics · Oscillations, Waves & Acoustics · Scientific programming for physicists
Scientific Computing for Physicists, Ch Letting the computer do advanced algebra: operators, series and differentiated programs
Problem
A block on a spring obeys x¨+γx˙+ω02x=(F0/m)cos(ωt) with ω0=3rads−1, γ=0.4s−1 and F0/m=2ms−2; ignore the transient and keep only the steady state xp(t)=Acos(ωt−φ) with A=(F0/m)/(ω02−ω2)2+γ2ω2 and phase φ in (0,π) fixed by cosφ=(ω02−ω2)/D and sinφ=γω/D, where D=(ω02−ω2)2+γ2ω2.
((a)) Verify by direct substitution into the ODE that xp(t) solves it for any driving frequency ω, using the stated formulas for A and φ.
((b)) Evaluate A at ω=1.0, 2.9 and 5.0rads−1.
((c)) Evaluating ω02−ω2 suffers cancellation of relative size κ=(ω02+ω2)/∣ω02−ω2∣. Using the chapter's rule for testing generated code, 100κϵmach with ϵmach=2−52, give the relative tolerance to which a generated function for A(ω) should agree with an independently coded evaluation of the same formula at ω=2.9rads−1.