4. Lagrangians and Hamiltonians

Legal Notice, Disclaimer, and Book Ordering Information:

Null

Setup

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

Needs["Calculus`VectorAnalysis`"]

Needs["Graphics`Graphics`"]

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

Clear["Global`*"];

4.2 Problems

4.2.2  Orbiting Bodies

Problem 2:  Kepler Problem

Part (a)   Define u[ϕ] = 1/r[ϕ] and assume θ=π/2.  Solve for u[ϕ] when the gravitational potential is V = -k/r.  Assume the initial condition u'[0]=0.

eq1 = 
      u''[ϕ] == 
        -u[ϕ] - m f[1/u[ϕ]]/(ℓ u[ϕ])^2

\(forceRule = {V -> \((\(-k\)/#&)\)
		, 
        f[1/u[ϕ]] -> \(-\(V'\)[r]\)
			, r -> 1/u[ϕ]}\)

eq2 = eq1 //. forceRule

\(eq3 = 
      DSolve[{eq2, \(u'\)[0] == 0, u[0] == u0 \((1 + ϵ)\)}

          	, {u[ϕ]}, ϕ] // Flatten\)

u0Rule = 
      Solve[(u[ϕ] /. eq3 /. {Cos[ϕ] -> 0}) == u0, u0] // 
        Flatten

eq4 = eq3 //. u0Rule // Simplify

eq5 = 
      eq4 //. {ℓ -> Sqrt[a k m (1  -  ϵ^2)]}

Part (b)  Plot the elliptical and hyperbolic orbits.

\(Clear[plotOrbit]; 

    plotOrbit[aa_, ee_] := 
	
      PolarPlot[
        \((\(1/u[ϕ] //. eq5\) //. {a -> aa, ϵ -> ee}
			 // 
            Evaluate)\), {ϕ, 0, 4  π}]; \)

\(\(p1 = 
      Table[plotOrbit[1, ϵIn], {ϵIn, 0.1, 0.9, 0.2}]
 // 
        Evaluate; \)\)

Show[p1];

p2 = plotOrbit[1, 1.1];

p3 = plotOrbit[1, 1.7];

\(\(p4 = 
      Table[plotOrbit[1, ϵIn], {ϵIn, 0.1, 1.9, 0.2}]
 // 
        Evaluate; \)\)

Show[p4];

Part (c)   Use the user-defined function diffSeriesOne to get a power series solution for the u[ϕ] equation.  Sum the series to get the exact solution.

initial = {u'[0] -> 0, 
        u[0] -> k m/ℓ^2 (1 + ϵ)}

\(pertSol = 
      \((\(diffSeriesOne[eq2, u, ϕ, 6, initial]
	 // Normal\) // 
          ExpandAll)\)\)

cterm[n_] = 
      (-1)^n (k m ϵ/ℓ^2) 
        ϕ^(2 n) /(2 n)!;

pertSol == (k m/ℓ^2  +  Sum[cterm[i], {i, 0, 3}])

\(\((\(\((k\ m/ℓ^2\  + \ Sum[cterm[i], {i, 0, Infinity}])\)

          			 // PowerExpand\) // Simplify)\)\)