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 1:  Analysis of Linear Oscillator

\(Needs["Graphics`FilledPlot`"]; 
Needs["Graphics`Graphics3D`"]; 
    \)

Part (a)   Reduce the linear equation to a first-order differential equation and define its kinetic and potential energies.

Fke  =  m x''[t]

Fpe  =  k x[t]

T  =  Integrate[x'[t] Fke, t]

V  =  Integrate[x'[t] Fpe, t]

energy  =  T  +  V

Part (b)   Plot the potential function and describe the system's behavior.

\(\(FilledPlot[V /. {x[t] -> x, k -> 1, m -> 1}, {x, \(-1\), 1}
, 
      Frame -> True
, 
      FrameLabel -> {"x-axis", "Potential", "V", " "}
, 
      RotateLabel -> False
]; \)\)

Part (c)   Plot phase diagram using ContourPlot,DensityPlot,  and ShadowPlot3D

\(rules = {m -> 1, k -> 1, x[t] -> x, \(x'\)[t] -> v}; 

    en\  = \ energy /. rules\)

\(\(ContourPlot[en, {x, \(-1\), 1}, {v, \(-1\), 1}
\ \ , 
      ColorFunction -> Hue
\ \ , Axes -> True
\ \ , 
      AxesLabel -> {"x[t]", "v[t]"}]; \)\)

Options[ContourPlot]

\(\(DensityPlot[en, {x, \(-1\), 1}, {v, \(-1\), 1}
		, 
      PlotPoints -> 20
\ \ \ \ , ColorFunction -> Hue
\ \ \ \ , 
      Axes -> True
\ \ \ \ , AxesLabel -> {"x[t]", "v[t]"}]; \)\)

Options[DensityPlot]

\(\(ShadowPlot3D[en, {x, \(-1\), 1}, {v, \(-1\), 1}
	, 
      PlotPoints -> 20
	, PlotLabel -> "Energy Surface"
\ \ , 
      ColorFunction -> Hue
\ \ , Axes -> True
\ \ , 
      AxesLabel -> {"x[t]", "v[t]", "energy"}
\ \ , 
      ShadowPosition -> 1]; \)\)

Options[ShadowPlot3D]

Problem 2:  Solution of Linear Oscillator

Needs["Calculus`LaplaceTransform`"];

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

Clear["Global`*`"];

Part (a)   Use DSolve to solve for the motion.   Express the solutions in terms of a phase and amplitude and of the initial conditions x[0] and x'[0].

eq1  =  x''[t]  +  ω^2 x[t]  ==  0

dsol1  =  DSolve[{eq1}, x[t], t] // Flatten

Note: Here DSolve gives the solution in a sinusoidal form rather than the exponential form given in the book.

cRule = {C[1] -> -A Sin[δ], C[2] -> A Cos[δ]}

dsol2  =  dsol1 /. cRule // Simplify

initial  =  {x[0] == x0,  x'[0] == v0}

dsol3  =  DSolve[Join[{eq1}, initial], x[t], t] // Flatten

Note: Here DSolve gives the solution in the desired form immediately.

Part (b)   Solve for the motion by assuming the solution can be expressed as a power series in t.   Sum the series to get the solution in a closed form.

\(dsol4\  = \ 
      diffSeriesOne[eq1, x, t, 9, {x[0] -> x0, \ \(x'\)[0] -> v0}]
	 // 
        Collect[#, {x0, v0}]&\)

\(termX[n_]\  = \ 
      \((\(-1\))\)^n\ \((t\ ω)\)^\((2\ n)\)/\(\((2\ n)\)!\); 

    termV[n_]\  = \ 
      \((\(-1\))\)^n\ 
        \((t\ ω)\)^\((2\ n\  + \ 1)\)/
          \((ω\ \(\((2\ n + 1)\)!\))\); \)

test  =  
      Sum[x0 termX[n]  +  v0 termV[n], {n, 0, 4}] // 
        Collect[#, {x0, v0}]&

test == dsol4

exactSum  =   
      Sum[x0 termX[n]  +  v0 termV[n], {n, 0, Infinity}]

exactSum  =   exactSum // PowerExpand

exactSum  =   exactSum // Apart

Part (c)   Use LaplaceTransform to solve the equation.

lapTx  =  LaplaceTransform[eq1, t, s]

lapSol  =  Solve[lapTx, LaplaceTransform[x[t], t, s]] // Flatten

\(dsol5\  = \ 
      InverseLaplaceTransform[LaplaceTransform[x[t], t, s] /. lapSol
		, 
        s, t]\)

Problem 3:  Damped Linear Oscillator

Clear["Global`*`"];

Part (a)   Solve the equation with the initial conditions x[0]=x0, x'[0]=v0.  Make a plot of the solution as a function of the variables t and 2ω=Sqrt[γ^2-4ω0^2].

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

dsol1  =  
      DSolve[{eq1, x[0] == x0,  x'[0] == v0}, x[t], t] // Flatten // 
        Simplify

wRule  = 
       {(γ^2  -  4 ω0^2)^(1/2)  ->  2  ω, 
         1/(γ^2  -  4 ω0^2)^(1/2)  -> 
          1/( 2  ω)}

dsol2  =  dsol1 //. wRule // Simplify

x[t_] = x[t] /. dsol2

values  =  {x0 -> 1, v0 -> 0,  γ -> 1}

\(\(p0\  = \ 
      Plot3D[Evaluate[\(x[t] //. values\) /. {ω -> Sqrt[ω2]}]

        	\ \ , {ω2, 25, \(-150\)}, {t, 0, 1}
	\ \ , 
        PlotPoints -> 25
		, PlotRange -> {\(-1\), 2}
		, 
        BoxRatios -> {1, 1, 1}
		, ViewPoint -> {\(-4\), 3, 2}
		, 
        AxesLabel -> {"ω2", "t", "x[t]"}
		, 
        ColorFunction -> Hue]; \)\)

Part (b)   Solve for the overdamped case where ω is real: (γ^2 > 4 ω0^2).  Plot the solution.

p1  =  
      Plot[Evaluate[x[t] //. values /. {ω -> +0.6}], {t, 0, 
          10}];

p2  =  
      Plot[Evaluate[x[t] //. values /. {ω -> +0.4}], {t, 0, 
          10}];

Part (c)   Solve for the critically damped case where ω =0: (γ^2 = 4 ω0^2).  Plot the solution.

xlim[t_]  =  Limit[x[t], ω -> 0]

p3  =  Plot[Evaluate[xlim[t] //. values], {t, 0, 10}];

Part (d)   Solve for the underdamped damped case where ω is imaginary: (γ^2 < 4 ω0^2).  Plot the solution.

xud[t_]  = 
      x[t] /. {ω -> I ωRe} // ExpToTrig // FullSimplify

\(\(p4\  = \ 
      Plot[Evaluate[\(xud[t] //. values\) /. {ωRe -> 10}], {t, 0, 10}, 
        
	PlotRange -> All]; \)\)

\(q = \ \(x[t] //. values\) /. {ω -> 10\ I}; 

    p\  = \ \(\(x'\)[t] //. values\) /. {ω -> 10\ I}; \)

doublePlot[p, q, {t, 0.01, 5}];

Part (e)   Overlay the two-dimensional plots and comment on them.

Show[p1, p2, p3, p4];