4. Lagrangians and Hamiltonians

Legal Notice, Disclaimer, and Book Ordering Information:

Null

Setup

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

Needs["Calculus`VectorAnalysis`"]

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

Clear["Global`*"];

4.2 Problems

4.2.2  Orbiting Bodies

Problem 1:  Equivalent One-Body Problem

Part (a)   Express the relative position vector r[t] in terms of spherical coordinates (r,θ,ϕ) and derive the equations of motion.

eq1 = {mt == m1 + m2,  μ == m1 m2/mt}

mSol = Solve[eq1, {m1, m2}][[1]]

\(eq2 = {R[t] == \((m1\ r1[t]\  + \ m2\ r2[t])\)/mt
		, \ \ \ \ \ \ 
        r[t] == r1[t] - r2[t]}\)

\(\(sol1 = 
      \((\((\(\((Solve[eq2, {r1[t], r2[t]}] // Flatten)\)
					 //. 
                Rule -> Equal\)
				\ \  //. {mt -> m1 + m2})\)

          	\ \ \ \ \ \ \ \ \  // MapAll[Apart, #]&)\)
\)\)

\(rSol = {r1 -> \((\((\ \((\((m2\ r[#])\)/\((m1 + m2)\))\) + R[#])\)&)\), 
        
		\ \ \ \ \ \ \ \ \ \ \ 
        r2 -> \((\((\(-\((\((m1\ r[#])\)/\((m1 + m2)\))\)\) + R[#])\)&)\)}
        \)

T = m1/2 r1'[t]^2  +  m2/2 r2'[t]^2

L = (T - V[r0[t]]) //. Join[rSol, mSol] // Simplify

\(rRule = 
      r -> \((\((
              CoordinatesToCartesian[

                  					{r0[#], θ[#], ϕ[#]}, Spherical]

                			 // Evaluate)\)&)\)\)

\(r /: VectorQ[r] = True; 
R /: VectorQ[R] = True; \)

\(\(vectorRule = {x_\ [t_]^2\  :> \ x\ [t] . x\ [t]\  /; \ VectorQ[x], 

        		\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 
        \(x_'\)[t_]^2\  :> \ \(x'\)[t] . \(x'\)[t]\  /; \ VectorQ[x]}; \)\)

L //. vectorRule

\(L1 = 
      \((\(\(L //. vectorRule\) //. rRule
			 // Simplify\) // TrigExpand)
            \)
\ \ \ \ \ \  //. {Cos[x_]^2 -> 1 - Sin[x]^2}
	 // 
        Simplify[#, Trig -> False]&\)

rRule2 = {R -> ({Rx[#], Ry[#], Rz[#]}&)}

L2 = L1 //. rRule2

Lag[{Rx, Ry, Rz}, L2]

L3 = L2 /. {Rx -> (0&), Ry -> (0&), Rz -> (0&)}

eqMotion0 = Lag[{r0, θ, ϕ}, L3] // FullSimplify

Part (b)   Place the orbit in the θ=π/2 plane and derive expressions for the conservation of energy and angular momentum.

θRule = θ -> ((π/2)&)

eqMotion = eqMotion0 //. θRule

ϕEq  =  eqMotion[[3]]

dSol = 
      DSolve[{ϕEq, 
            r0[0] == Sqrt[ℓ/(μ ϕ'[0])]}, {r0[t]}, 
          t][[2]]

ϕRule = 
      Solve[dSol /. {Rule -> Equal}, ϕ'[t]] // Flatten

rEq = eqMotion[[1]] /. ϕRule

energy = Integrate[rEq[[1]] r0'[t], t]

Part (c)   let u=1/r and derive an equation for u[ϕ].

uRule = {r0 -> (1/u[ϕ[#]]&)}

eq3 = rEq //. {V'[x_] -> -f[x]} //. uRule // Simplify

ϕRule2 = {ϕRule, D[ϕRule, t]} //. uRule // Flatten

Solve[eq3 //. ϕRule2, u''[ϕ[t]]] // Flatten // 
      Simplify