3. Oscillating Systems

Legal Notice, Disclaimer, and Book Ordering Information:

Null

Setup

\(Clear["Global`*`"]; 
Off[General::spell]; 
Off[General::spell1]; 
    \)

3.3 Problems

3.3.1  Linear Oscillations

Problem 4:  Damped Harmonic Oscillator and Driving Force

<< "D:\Mma\Inits\ch3init.m"

Clear["Global`*`"];

Part (a)   Solve for the homogeneous (F=0) solution.

eq1  =  
      x''[t]  +  γ x'[t]  +  ω0^2 x[t]  ==  
        Q0 Cos[ωd t]

\(dsol0 = 
      DSolve[{eq1 /. {Q0 -> 0}, x[0] == x0, \(x'\)[0] == v0}
	, x[t], t] // 
        Flatten\)

\(ωRule = {
        Sqrt[γ^2\  - \ 4\ ω0^2]\  -> \ 2  ω

        		\ \ \ \ , 
        1/Sqrt[γ^2\  - \ 4\ ω0^2]\  -> \ 1/\((2  ω)\)}
        \)

dsol = dsol0 /. ωRule // Simplify

Note:  Use FullSimplify instead of Simplify to get rid of hyperbolic functions and complex factors.

\(homSol = 
      \(\(x[t] /. dsol\) /. {ω -> I\ ωRe}

          		\ \ \ \ \ \ \ \ \ \ \ \ \  // ExpToTrig\) // FullSimplify\)

Part (b)   Assume a particular solution of the form A Cos[ωd t + ϕ] and solve for the amplitude A and phase ϕ.  Write the general form of the solution.

guess  =  {x  ->  (A Cos[ωd #  +  ϕ]&)}

eq2  =  eq1 /. guess

To isolate amplitude and phase, consider two time "snapshots" a quarter of a cycle apart.

\(eq3 = 
      \(({eq2 /. {t -> 0}
	, eq2 /. {\ t -> π/\((2\ ωd)\)}}
              
 //. {Sin[ϕ] -> Tanϕ\ Cos[ϕ]})\) // Simplify
        \)

sol1  =  Solve[eq3, {A, Tanϕ}] // Flatten // Simplify

\(ϕRule\  = \ {ϕ\  -> \ ArcTan[Tanϕ]}; 

    secRule\  = \ {Sec[ArcTan[_x]] :> Sqrt[1\  + \ x^2]}; \)

answerA  = A //. Join[sol1, ϕRule, secRule] // Simplify

answerA = answerA^2 // Simplify // Sqrt // PowerExpand

sol = Join[{A -> answerA}, {sol1[[1]]}, ϕRule]

partSol = x[t] /. guess //. sol

genSol = 
      partSol + homSol /. {ωRe -> ω0^2  -  1/4 γ^2}

values = {A -> 3, Q0 -> 1, ωd -> 1, x0 -> 0, v0 -> 1}

Part (c)   Plot the solution as a function of ω0 and t.  PLot the amplitude A as a function of of ω0 and γ.  Notice the resonance at ω0 = ωd.

\(\(Plot3D[\(genSol /. values\) /. {γ -> 0.1} // Evaluate

      	, {t, 0, 30}
\ \ , {ω0, 0.5, 1.5}
\ \ , PlotPoints -> 40

      	, AxesLabel -> {"Time", "ω0", "x[t]"}
	, 
      FaceGrids -> {{0, 1, 0}, {0, \(-1\), 0}}
	, 
      ViewPoint -> {1,  .4,  .6}
	, ColorFunction -> Hue]; \)\)

\(\(Plot3D[\(A /. sol\) /. values // Evaluate
	, {γ, 0.0001, 4}

      \ \ , {ω0, 0, 2}
\ \ , PlotPoints -> 40
	, 
      PlotRange -> {0, 8}
	, 
      AxesLabel -> {"γ", "ω0", "Amplitude"}
	, 
      FaceGrids -> {{\(-1\), 0, 0}}
	, ViewPoint -> {\(-1\),  .4,  .4}
	, 
      ColorFunction -> Hue]; \)\)

\(\(Plot[
      \(genSol //. values\) //. {γ -> 0.1, ω0 -> 2} // Evaluate
        
	, {t, 0, 80}
, PlotPoints -> 60]; \)\)

\(\(Plot[
      \(genSol //. values\) //. {γ -> 0.1, ω0 -> 2} // Evaluate
        
	, {t, 0, 10}
, PlotPoints -> 60]; \)\)

Part (d)   Pick parameters to illustrate the transcient and steady-state behaviors and polt x[t] and its phase trajectory.

q = genSol //. values //. {γ -> 0.1, ω0 -> 2}

p = D[q, t]

doublePlot[p, q, {t, 0, 80}];