Lagrangian and Hamiltonian Dynamics of One Dimensional Systems.

Let’s explore the dynamics of the rotor system introduced in Section 7.2.1. Though the system is a two-dimensional system described by the coordinates θ(t), x(t), we will, as shown below, be able to reduce the dynamical equations into two one-dimensional second-order differential equations.

The Lagrangian of the translating rotor is given by Eq. 7.7
({{({{L=(M+m) ((OverDot[x])^2)/2}}) +  m (L^2) ((OverDot[θ])^2)/2-m (OverDot[θ]) (OverDot[x]) L sin(θ)}})
Since 
({{({{((∂ L)/(∂(OverDot[x])))}})=(M+m) (OverDot[x]) -m (OverDot[θ])  L sin(θ)     ({{((∂ L)/(∂(OverDot[θ])))}})=m (L^2) (OverDot[θ]) -m (OverDot[x]) L sin(θ)     ({{((∂ L)/(∂θ))}})= m (OverDot[θ]) (OverDot[x]) L cos(θ)}})
The Lagrange equations become
({{({{(M+m) (Overscript[x, ¨]) +m ((OverDot[θ])^2)L cos(θ) -  (Overscript[θ, ¨])m L sin(θ)= 0}})}})
({{({{m (L^2) (Overscript[θ , ¨])-m (Overscript[x, ¨]) L sin(θ) + m (OverDot[x])(OverDot[θ])L cos (θ)-  m (OverDot[θ]) (OverDot[x]) L cos(θ)=0}})}})
Or
({{  ({{({{(M+m) (Overscript[x, ¨]) +m ((OverDot[θ])^2)L cos(θ) -  (Overscript[θ, ¨])m L sin(θ)= 0}})
m (L^2) (Overscript[θ , ¨])-m (Overscript[x, ¨]) L sin(θ)=0}})}})

Inserting the expression for (Overscript[x, ¨]) from the first equation into the second we get
({{
({{(Overscript[θ, ¨])+(m/(M+m  (cos^2)θ))}}) (((OverDot[θ]) )^2)cos(θ)sin(θ)=0}})

ClearAll["Global`*"]

We solve Eq. (1) for θ(t),

(* initializing parameters M,m,ω and L *)
M=1;m=1;ω=1;L=1;
solθ=Flatten[NDSolve[{θ''[t]+m/(M+m Cos[θ[t]]^2)( θ'[t])^2 Cos[θ[t]]Sin[θ[t]]==0,θ[0]==0,θ'[0]==ω},θ,{t,0,20Pi/ω}]];
θfun[t_]=θ[t] /. solθ

(* the solution is returned in θfun[t], which we plot below *)
Plot[{θfun[t],ω t},{t,0,20Pi/ω}]

In the figure, the blue line represents the solution for θ(t), whereas the beige line represents the relation θ(t) = ω t. Below we plot the angular velocity (OverDot[θ]). It shows oscillations around a constant mean given by (OverDot[θ]) = ω.

Plot[θfun'[t],{t,0,20Pi/ω},PlotRange->{0,1}]

We now solve for the x(t), representing the motion of the ion.

solx=Flatten[NDSolve[{x''[t]+m/(m+M) θfun'[t]^2 L Cos[θfun[t]]==0,x[0]==0,x'[0]==0},x,{t,0,20Pi/ω}]]

xfun[t_]=x[t] /. solx

We plot the solution xfun[t]

Plot[xfun[t],{t,0,20Pi/ω}]

This plot demonstrates that the ion oscillates around a mean position given by

xmean=NIntegrate[xfun[t],{t,0,20Pi/ω}]/(20 Pi/ω)

Using these results we can re-construct the motion of the electron and the ion. Below the electron is denoted by a red disk, whereas the the larger black disk represents the motion of the center of the ion.

g[t_]:=Graphics[Disk[{xfun[t],0},0.2]]

electron[t_]:={xfun[t]+ L Cos[θfun[t]],L Sin[θfun[t]]}

h[t_]:=Graphics[{Red,Disk[electron[t],0.1]}]

Manipulate[Show[h[t],g[t],PlotRange->{{-5.0,5.0},{-2,2}}],{t,0,20Pi/ω,0.01},SaveDefinitions->True]

Exercise:

Explore the behavior of this dynamical system by adjusting the values of the ratio m/M.