3. Oscillating Systems

Legal Notice, Disclaimer, and Book Ordering Information:

Null

Setup

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

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

Clear["Global`*`"];

3.3 Problems

3.3.2  Nonlinear Oscillations

Problem 4:  Motion of a Damped, Forced Nonlinear Pendulum

Part (a)  Illustrate the nonlinear effects by letting ω0=1, ωd=1, γ=0.01, and F0=0.2.

eq1=θ''[t]+γ θ'[t]+ω(0^2) Sin[θ[t]]==f0 Cos[ωd t]

eq2=eq1/.{θ'[t]->dθ[t],θ''[t]->(dθ)'[t]};
eq3={eq2,θ'[t]==dθ[t]}

linearEq = 
      Normal[(Map[Series[#1, {θ[t], 0, 1}]&, #1, {3}]&)[eq3]]

values = {ω0 -> 1, ωd -> 1, 
        γ -> 0.01, f0 -> 0.2};

initial = {θ[0] == 0.9 π, dθ[0] == 0};

ndsol1 = 
      NDSolve[
          Evaluate[Join[eq3, initial] //. values], {θ[t], 
            dθ[t]}, {t, 0, 100}, MaxSteps -> 1000]
          [[1]]

\(θ1[t_] = θ[t] //. ndsol1; 

    dθ1[t_] = dθ[t] //. ndsol1; \)

ndsol2 = 
      NDSolve[
          Evaluate[Join[linearEq, initial] //. values], {θ[t], 
            dθ[t]}, {t, 0, 100}, MaxSteps -> 1000]
          [[1]]

\(θ2[t_] = θ[t] //. ndsol2; 

    dθ2[t_] = dθ[t] //. ndsol2; \)

Part (b)  Graph the solutions for the linear and nonlinear equations.

Plot[{θ1[t], θ2[t]}, {t, 0, 100}, 
      PlotStyle -> {{Thickness[0.010]}, {Thickness[0.005]}}];

Part (c)  Graph the frequency spectrum for the linear and nonlinear equations.

\(\(fplot1 = 
      Show[fftSpectrum[θ1[t], t, 100], 
        PlotRange -> {{0, 30}, {0, 25}}

        	\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ , DisplayFunction -> Identity]; 
    \)\)

\(\(fplot2 = 
      Show[fftSpectrum[θ2[t], t, 100], 
        PlotRange -> {{0, 30}, {0, 25}}

        	\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ , DisplayFunction -> Identity]; 
    \)\)

\(\(Show[GraphicsArray[{fplot1, fplot2}]

      	\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ , 
      DisplayFunction -> $DisplayFunction]; \)\)

Part (d)  Plot the phase trajectories for the linear and nonlinear equations.

doublePlot[θ1[t], dθ1[t], {t, 0, 100}];

doublePlot[θ2[t], dθ2[t], {t, 0, 100}];