A block on a spring obeys with

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)\ddot{x}+\gamma\dot{x}+\omega_0^2x=(F_0/m)\cos(\omega t) with ω0=3 rad s−1\omega_0=3\,\mathrm{rad\,s^{-1}}, γ=0.4 s−1\gamma=0.4\,\mathrm{s^{-1}} and F0/m=2 m s−2F_0/m=2\,\mathrm{m\,s^{-2}}; ignore the transient and keep only the steady state xp(t)=Acos⁡(ωt−φ)x_p(t)=A\cos(\omega t-\varphi) with A=(F0/m)/(ω02−ω2)2+γ2ω2A=(F_0/m)/\sqrt{(\omega_0^2-\omega^2)^2+\gamma^2\omega^2} and phase φ\varphi in (0,π)(0,\pi) fixed by cos⁡φ=(ω02−ω2)/D\cos\varphi=(\omega_0^2-\omega^2)/D and sin⁡φ=γω/D\sin\varphi=\gamma\omega/D, where D=(ω02−ω2)2+γ2ω2D=\sqrt{(\omega_0^2-\omega^2)^2+\gamma^2\omega^2}. ((a)) Verify by direct substitution into the ODE that xp(t)x_p(t) solves it for any driving frequency ω\omega, using the stated formulas for AA and φ\varphi. ((b)) Evaluate AA at ω=1.0\omega=1.0, 2.92.9 and 5.0 rad s−15.0\,\mathrm{rad\,s^{-1}}. ((c)) Evaluating ω02−ω2\omega_0^2-\omega^2 suffers cancellation of relative size κ=(ω02+ω2)/∣ω02−ω2∣\kappa=(\omega_0^2+\omega^2)/|\omega_0^2-\omega^2|. Using the chapter's rule for testing generated code, 100 κ ϵmach100\,\kappa\,\epsilon_{\rm mach} with ϵmach=2−52\epsilon_{\rm mach}=2^{-52}, give the relative tolerance to which a generated function for A(ω)A(\omega) should agree with an independently coded evaluation of the same formula at ω=2.9 rad s−1\omega=2.9\,\mathrm{rad\,s^{-1}}.

Browse the problem library