Physics Library
 An open source physics library
Encyclopedia | Forums | Docs | Random |  
Login
create new user
Username:
Password:
forget your password?
Main Menu
Sections

Meta

Talkback

Downloads

Information
[parent] Celestial Mechanics: Initial-Value Orbital Motion - Worked Problems and Complete Solutions (Example)

Celestial Mechanics: Initial-Value Orbital Motion - Worked Problems and Complete Solutions

CM03 converted Newton’s gravitational force law into the point-mass orbital equation

|----------|
¨r =  − μ r-.
--------r3--
(1)

The equation determines acceleration from position, but it does not by itself select a unique trajectory. An orbital initial-value problem also requires

---------------------------
|                          |
-r(t0)-=-r0,-----v(t0) =-v0.|
(2)

This companion article develops that idea through complete worked examples. It begins with direct evaluation of gravitational acceleration, then treats circular motion and minimum-energy escape as special initial conditions. It next works a fully three-dimensional Cartesian state, decomposes velocity into radial and transverse parts, constructs a short-time state estimate, treats the exact Earth–Moon two-body relative equation, and closes with a numerical Runge–Kutta propagation experiment.

The goal is not yet to derive orbital elements. Instead, the emphasis is the physics of the differential equation: given position and velocity now, what can we say immediately about acceleration, energy class, and subsequent motion? [1, 2, 3, 4, 5].

Unless otherwise stated, use

μ  = 3.986004418  × 1014m3 ∕s2,     R  =  6.371 ×  106m.
 E                                   E
(3)

For Earth–Moon examples use

                 −11  3  − 1 −2
G =  6.67430  × 10   m  kg   s  ,
(4)

                  24                          22
ME  =  5.9722 ×  10  kg,     MM  =  7.3477 × 10  kg,
(5)

and

                    8
dEM  = 3.84400 × 10  m.
(6)

Part I: Exercises

Exercise 1: acceleration from a Cartesian position

A spacecraft is at

r0 = (6771 ^x) km
(7)

relative to Earth’s center.

  1. Compute the distance r0 from Earth’s center.
  2. Use Newton’s orbital equation to compute the acceleration vector a0.
  3. Find its magnitude.
  4. Explain why the acceleration is not small even though the spacecraft is in low Earth orbit.

Exercise 2: circular orbit as a special initial condition

A spacecraft is at altitude

h = 400 km
(8)

above Earth’s mean surface. At t0 let

r0 = r0^x,     v0 = v0^y.
(9)

  1. Derive the speed required for a circular orbit by equating Newtonian gravitational acceleration to centripetal acceleration.
  2. Evaluate the circular speed numerically.
  3. Compute the orbital acceleration magnitude.
  4. Derive and evaluate the circular period.
  5. Write the complete six-component initial state.

PIC

Figure. A circular initial condition has v0 ⊥ r0 with exactly the speed required for gravity to provide the inward centripetal acceleration.

Exercise 3: minimum-energy radial escape trajectory

At the same 400 km altitude, launch a particle directly radially outward. Neglect atmosphere and all bodies except Earth.

  1. Starting from conservation of specific mechanical energy, derive the minimum escape speed at radius r0.
  2. Evaluate the escape speed numerically.
  3. Write a Cartesian initial state for a radial outward escape beginning on the +x axis.
  4. Compute the initial gravitational acceleration vector.
  5. Explain what happens to the speed as r →∞ at the exact escape threshold.

PIC

Figure. Minimum escape corresponds to zero total specific mechanical energy: the positive launch kinetic energy exactly cancels the negative gravitational potential at the initial radius.

Exercise 4: a sub-escape radial launch and turnaround radius

A particle is launched radially outward from Earth’s mean surface at

v0 = 9.00km/s.
(10)

  1. Compute its initial specific mechanical energy.
  2. Determine whether it escapes.
  3. At the maximum radius the radial speed is zero. Use energy conservation to derive the turnaround radius rmax.
  4. Compute the maximum altitude above Earth’s mean surface.

Exercise 5: a super-escape launch and hyperbolic excess speed

A particle is launched radially outward from Earth’s mean surface at

v0 = 12.0km/s.
(11)

  1. Compute the initial specific mechanical energy.
  2. Show that the motion is unbound.
  3. Derive the speed v∞ remaining as r →∞.
  4. Evaluate v∞ numerically.

Exercise 6: a fully general Cartesian initial state

Consider the Earth-centered state

r0 = (7000^x − 1200 ^y + 1800^z )km,
(12)

v0 = (1.0^x + 7.2^y + 2.0^z)km/s.
(13)

  1. Compute r0 = |r0| and v0 = |v0|.
  2. Compute the gravitational acceleration vector.
  3. Write the six-state derivative dx∕dt|t0.
  4. Compute the specific mechanical energy 𝜖 and determine whether the state is energetically bound or unbound.

PIC

Figure. In a general Cartesian state, the velocity need not be radial or tangential. Newton’s equation determines acceleration solely from the instantaneous position.

Exercise 7: radial and transverse velocity components

Use the Cartesian state from Exercise 6.

  1. Construct the radial unit vector r0.
  2. Compute the radial velocity
    vr = v0 ⋅^r0.
    (14)

  3. Compute the magnitude of the velocity perpendicular to r0 from
         ∘  -------
v⊥ =    v2−  v2.
         0    r
    (15)

  4. Is the spacecraft instantaneously moving inward or outward?
  5. Explain why the gravitational acceleration has no transverse component in the radial-transverse decomposition.

Exercise 8: short-time propagation from the initial state

Again use the state from Exercise 6 and a short interval

Δt = 60 s.
(16)

Assume the acceleration remains approximately equal to a0 over this short interval.

  1. Use
                      1-    2
r1 ≈ r0 + v0Δt +  2a0Δt
    (17)

    to estimate the new position.

  2. Use
    v1 ≈ v0 + a0 Δt
    (18)

    to estimate the new velocity.

  3. Explain why repeatedly using one fixed acceleration would eventually become inaccurate.

PIC

Figure. A short-time Taylor step uses the acceleration evaluated at the initial position. Accurate orbit propagation requires continuously updating the acceleration as the position changes.

Exercise 9: energy classification for several initial speeds

At 400 km altitude, suppose the velocity is perpendicular to the radius. For each speed below, compute

     v2-  μE-
𝜖 =  2 −   r
(19)

and classify the state as negative-energy bound, zero-energy escape threshold, or positive-energy unbound:

  1. v = 7.00 km/s;
  2. v = vcirc;
  3. v = 9.00 km/s;
  4. v = vesc;
  5. v = 12.0 km/s.

Explain why energy classification alone does not tell us the complete geometric shape or orientation of the orbit.

Exercise 10: changing velocity without changing instantaneous gravity

Two spacecraft occupy exactly the same position

r0 = (7000 ^x) km
(20)

but have different velocities:

vA =  (0^x + 7.5^y)km/s,
(21)

vB  = (2.0^x + 7.5^y)km/s.
(22)

  1. Compute the instantaneous acceleration of each spacecraft.
  2. Are the accelerations equal?
  3. Are the future trajectories the same?
  4. What does this demonstrate about the role of initial velocity in a second-order orbital differential equation?

Exercise 11: exact Earth–Moon relative acceleration

Treat Earth and Moon as two point masses separated by dEM.

  1. Compute the Moon’s acceleration toward Earth from Earth’s gravity alone.
  2. Compute Earth’s acceleration toward the Moon.
  3. Add the magnitudes appropriately to obtain the relative acceleration magnitude.
  4. Verify the exact relative-motion formula
         G (ME  + MM  )
|¨r| = ------2-------.
          dEM
    (23)

  5. Explain why using only GME is an approximation to the exact relative problem.

Exercise 12: barycentric circular initial conditions for Earth and Moon

Assume, for this exercise, a perfectly circular Earth–Moon two-body orbit of fixed separation dEM.

  1. Compute the distances rE and rM of Earth and Moon from their common center of mass.
  2. Derive the common angular speed
        ∘  ---------------
n =    G(ME--+--MM--).
           d3EM
    (24)

  3. Compute the corresponding Earth and Moon barycentric speeds.
  4. Compute the orbital period of this idealized circular two-body system.
  5. Write one set of barycentric Cartesian initial position and velocity vectors that gives counterclockwise circular motion in the xy plane.

Exercise 13: write the orbital equation as a six-state first-order system

Define

x = [x  y  z  v   v   v ]T .
               x   y   z
(25)

  1. Write all six scalar first-order differential equations equivalent to
            r
¨r =  − μ r3.
    (26)

  2. Identify which state components determine the instantaneous gravitational acceleration.
  3. Explain why this form is convenient for numerical ODE solvers.

Exercise 14: Julia RK4 propagation of a circular initial state

Use the 400 km circular initial state from Exercise 2.

  1. Write a Julia function that computes dx∕dt from the six-state vector.
  2. Implement one classical fourth-order Runge–Kutta step.
  3. Propagate exactly one theoretical circular period using N = 1000 equal steps.
  4. Compare the final numerical position and velocity with the initial values.
  5. Compute the specific mechanical energy before and after propagation and use the difference as one numerical quality check.

Part II: Complete Worked Solutions

Solution 1: acceleration from a Cartesian position

The given position is already along the positive x axis:

                6
r0 = (6.771 × 10 x^)m.
(27)

Therefore

               6
r0 = 6.771 × 10  m.
(28)

Newton’s orbital equation is

          r0
a0 = − μE r3.
           0
(29)

Because the position lies along +x,

a0 = − μE-^x.
       r20
(30)

Numerically,

μE-
r20 =                  14
3.986004418-×--10--
  (6.771 × 106)2 (31)
≈ 8.6943 m/s2. (32)

Thus

|--------------------2-|
-a0 ≈-(− 8.6943-^x)m/s-.-
(33)

Its magnitude is

|----------------|
|a0| ≈ 8.69m/s2. |
------------------
(34)

This is only modestly smaller than surface gravity. Low Earth orbit is therefore not a region in which gravity has disappeared. Orbital motion is continuous free fall under a still-strong gravitational acceleration.

Solution 2: circular orbit as a special initial condition

The orbital radius is

r0 = RE + h (35)
= 6.371 × 106 + 4.00 × 105 (36)
= 6.771 × 106 m. (37)

For uniform circular motion, the required centripetal acceleration is

     v2c-
ac = r .
      0
(38)

Gravity supplies that acceleration:

v2c    μE
---=  -2-.
r0    r0
(39)

Multiply by r0:

     μ
v2c = --E.
      r0
(40)

Therefore

|-----∘------|
|        μE- |
|vc =    r0 .|
-------------
(41)

Numerically,

|------------------|
-vc-≈-7.6726-km/s.-|
(42)

The acceleration magnitude is

|------------------------|
|     μE-              2 |
|ac =  r20 ≈ 8.6943 m/s  .|
-------------------------
(43)

The circumference is 2πr0, so the period is

    2 πr0
T = -----.
      vc
(44)

Substituting vc = ∘ ------
  μE ∕r0 gives

|-------∘------|
|          r30- |
|T =  2π   μ  .|
------------E--|
(45)

Numerically,

T ≈  5544.9s ≈ 92.41 min.
(46)

One convenient initial state is

|----⌊------------⌋--------------⌊------⌋------|
|      6.771 × 106                   0         |
|r = ⌈      0     ⌉ m,     v  =  ⌈7672.6⌉ m/s. |
| 0                          0                 |
------------0------------------------0----------
(47)

The velocity is perpendicular to the radius, and its magnitude is exactly the value required for circular motion.

Solution 3: minimum-energy radial escape trajectory

The specific mechanical energy is

    v2-   μE-
𝜖 =  2 −  r  .
(48)

For minimum escape, the particle reaches infinity with zero remaining speed. Therefore

𝜖∞ =  0.
(49)

Energy conservation requires

v2esc-  μE-
 2  −  r  = 0.
        0
(50)

Hence

|--------------|
|      ∘ -2μ-- |
|vesc =    --E-.|
-----------r0--
(51)

At 400 km altitude,

|--------------------|
|vesc ≈ 10.8507 km/s. |
---------------------
(52)

For a radial outward launch from the positive x axis, one suitable initial state is

|-----⌊-----------⌋--------------⌊--------⌋------|
|      6.771 × 106                 10850.7       |
|r  = ⌈     0     ⌉ m,      v  = ⌈    0   ⌉ m/s. |
| 0                          0                   |
------------0-------------------------0----------|
(53)

The initial acceleration is still determined only by position:

|-----⌊--------⌋-------|
|      − 8.6943        |
|a ≈  ⌈    0   ⌉ m/s2. |
| 0                    |
-----------0------------
(54)

The velocity points outward while gravity points inward, so the particle slows continuously. At the exact escape threshold,

v →  0     as    r →  ∞.
(55)

The particle never reaches a finite turnaround radius; it asymptotically approaches zero speed at infinite distance.

Solution 4: a sub-escape radial launch and turnaround radius

At Earth’s surface,

r0 = RE  = 6.371 × 106 m
(56)

and

v0 = 9.00 × 103 m/s.
(57)

The specific energy is

𝜖 =   2
v0-
 2 −μE--
RE (58)
≈−2.2065 × 107 J/kg. (59)

Thus

|------|
|𝜖 < 0,|
-------
(60)

so the launch does not escape.

At the maximum radius, the radial speed is zero. Therefore

𝜖 = − -μE-.
      rmax
(61)

Solve for rmax:

|--------μE---|
rmax = − ---. |
----------𝜖---|
(62)

Numerically,

rmax ≈ 1.8065 ×  107m  = 18065 km.
(63)

Therefore the maximum altitude is

hmax = rmax − RE (64)
≈ 11694 km. (65)

Thus

|----------------------|
|hmax ≈ 1.17 × 104 km. |
-----------------------
(66)

This is a useful reminder that a very large launch speed can still correspond to a bound trajectory if it remains below local escape speed.

Solution 5: a super-escape launch and hyperbolic excess speed

At the surface,

     2
𝜖 = v0-− -μE-.
     2   RE
(67)

With v0 = 12.0 km/s,

𝜖 ≈ 9.435 × 106 J/kg > 0.
(68)

Thus the motion is unbound.

At infinity, gravitational potential tends to zero, so

    v2∞-
𝜖 =  2 .
(69)

Equating the initial and final energies gives

v2    v2    μE
-∞- = -0-−  ---.
 2     2    RE
(70)

Using

 2     2μE
vesc =  ----,
       RE
(71)

we obtain

|-----∘-----------|
v   =   v2 − v2 . |
-∞-------0----esc--
(72)

With

v   (R   ) ≈ 11.1861 km/s,
 esc  E
(73)

we find

|------------------|
-v∞--≈-4.344km/s.--|
(74)

This residual speed is often called the hyperbolic excess speed in astrodynamics.

Solution 6: a fully general Cartesian initial state

Convert the state to SI units:

     ⌊ 7.000 × 106 ⌋
     ⌈            6⌉
r0 =  − 1.200 × 106   m,
       1.800 × 10
(75)

     ⌊     ⌋
       1000
v0 = ⌈ 7200⌉ m/s.
       2000
(76)

The radius magnitude is

r0 = ∘ ---------6-2-------------6-2-----------6-2
  (7.0 × 10 ) + (− 1.2 × 10 ) + (1.8 × 10 ) (77)
≈ 7.32666 × 106 m. (78)

Thus

|----------------|
r0 ≈ 7326.66 km. |
------------------
(79)

The speed is

v0 = √ -----2-------2-------2
  1000  + 7200  + 2000 (80)
≈ 7539.23 m/s. (81)

Therefore

|------------------|
v0 ≈ 7.53923 km/s. |
--------------------
(82)

Now evaluate

a0 = − μE r0.
          r30
(83)

The result is approximately

|----------------------|
|     ⌊− 7.0944⌋       |
|     ⌈        ⌉     2 |
|a0 ≈   1.2162   m/s  .|
-------−-1.8243---------
(84)

The six-state derivative is therefore

|--------⌊--------⌋--|
|           1000     |
|        |  7200  |  |
|   ||    ||        ||  |
|dx-| =  |  2000  | ,|
|dt |t0   ||− 7.0944||  |
|        ⌈ 1.2162 ⌉  |
|         − 1.8243   |
----------------------
(85)

where the first three entries have units of m/s and the final three have units of m/s2.

The specific mechanical energy is

𝜖 = v2
-0-
 2 −μ
-E-
r0 (86)
≈−2.5984 × 107 J/kg. (87)

Thus

|------|
|𝜖 < 0,|
-------
(88)

so the ideal two-body trajectory is energetically bound.

Solution 7: radial and transverse velocity components

The radial unit vector is

     r
^r0 = -0.
     r0
(89)

Using the values from Exercise 6,

|--------------------------------------|
|^r0 ≈ 0.95541^x −  0.16379 ^y + 0.24568^z. |
---------------------------------------
(90)

The radial speed is

vr = v0 ⋅r0 (91)
≈ 267.5 m/s. (92)

Thus

|--------------------|
|vr ≈ +0.2675 km/s.  |
---------------------
(93)

The positive sign means that the spacecraft is instantaneously moving outward.

The perpendicular speed is

v⊥ = ∘ -------
  v2 − v2
   0    r (94)
≈ 7534.5 m/s. (95)

Hence

|------------------|
|v⊥ ≈ 7.5345 km/s. |
--------------------
(96)

The gravitational acceleration is

a = − μE-^r,
       r2
(97)

so it is purely radial. Its transverse component is exactly zero for an ideal central point-mass gravity field.

Solution 8: short-time propagation from the initial state

Use

Δt =  60s
(98)

and the acceleration from Exercise 6.

The second-order position estimate is

                  1-    2
r1 ≈ r0 + v0Δt +  2a0Δt  .
(99)

Evaluating component by component gives approximately

|-----⌊--------⌋-----|
|      7047.23       |
|r1 ≈ ⌈− 765.81⌉ km. |
|      1916.72       |
----------------------
(100)

The first-order velocity estimate is

v1 ≈ v0 + a0Δt,
(101)

which gives

|-----⌊------⌋-------|
|      0.5743        |
v  ≈  ⌈7.2730⌉ km/s. |
| 1                  |
-------1.8905---------
(102)

The new position magnitude is about

|r1| ≈ 7343.3km.
(103)

The approximation eventually fails if we keep the same a0 because gravitational acceleration changes in both magnitude and direction as r changes. Numerical orbit propagation therefore repeatedly evaluates

a(r) = − μE-r
           r3
(104)

at updated positions.

Solution 9: energy classification for several initial speeds

At 400 km altitude,

r = 6.771 × 106m
(105)

and

  μ
− --E ≈ − 5.88688 × 107 J/kg.
   r
(106)

For v = 7.00 km/s,

𝜖 ≈ − 3.43688 × 107 J/kg,
(107)

so the state is bound.

For the circular speed vc ≈ 7.6726 km/s,

|--------------------------|
|𝜖c ≈ − 2.94344 × 107J/kg. |
---------------------------
(108)

This is also

𝜖c = − μE
       2r
(109)

for a circular orbit.

For v = 9.00 km/s,

                  7
𝜖 ≈ − 1.83688 × 10  J/kg,
(110)

so the state is still bound.

For v = vesc ≈ 10.8507 km/s,

|------|
-𝜖 =-0,|
(111)

which is the escape threshold.

For v = 12.0 km/s,

𝜖 ≈ 1.31312 × 107 J/kg > 0,
(112)

so the state is unbound.

The sign of energy classifies bound versus threshold versus unbound motion, but it does not determine the full orbit. The direction of v and the angular momentum are also required to determine orbital geometry and orientation.

Solution 10: changing velocity without changing instantaneous gravity

Both spacecraft have exactly the same position:

                6
r0 = (7.000 × 10 x^)m.
(113)

The point-mass acceleration depends only on position:

          r0
a0 = − μE -3.
          r0
(114)

Therefore both spacecraft have

|------------------------------|
|aA =  aB = − ------μE------^x. |
--------------(7.000-×-106)2---|
(115)

Numerically,

|----------------------------|
|aA = aB ≈  (− 8.1347 ^x)m/s2.|
------------------------------
(116)

Their accelerations are equal at that instant, but their future trajectories are not the same because their initial velocities differ. A second-order differential equation needs both position and velocity initial conditions. Position fixes the instantaneous gravitational acceleration; velocity determines how the state begins moving through the acceleration field.

Solution 11: exact Earth–Moon relative acceleration

The Moon’s acceleration toward Earth is

aM  =  GME--.
       d2EM
(117)

Numerically,

|--------------------------|
|                 − 3    2 |
-aM--≈-2.6976-×-10---m/s--.
(118)

Earth’s acceleration toward the Moon is

      GMM
aE  = --2---,
       dEM
(119)

so

|----------------------2--|
aE-≈--3.3189-×-10−5-m/s-.--
(120)

The accelerations point toward one another. For the relative coordinate

r = rM  − rE,
(121)

its second derivative is the difference of the individual acceleration vectors. Because the vectors are opposite in the inertial frame, the relative acceleration magnitude is the sum of the two magnitudes:

|r| = aM + aE (122)
≈ 2.7308 × 10−3 m/s2. (123)

Directly,

G(ME  +  MM  )                    2
------2-------≈  2.7308 ×  10−3m/s  ,
    d EM
(124)

which verifies

|-----------------------|
|                   -r  |
¨r-=-−-G-(ME--+-MM--)r3.-|
(125)

Using only GME neglects Earth’s motion and is therefore a test-particle approximation. It is often useful because MM ≪ ME, but it is not the exact two-body relative equation.

Solution 12: barycentric circular initial conditions for Earth and Moon

Let the center of mass be the origin. The two distances from the barycenter satisfy

rE + rM  = dEM
(126)

and

MErE   = MM  rM .
(127)

Therefore

|----------------------|
|             MM       |
|rE =  dEM ----------, |
-----------ME--+-MM----
(128)

|----------------------|
|          ----ME----- |
|rM =  dEM M   + M    .|
-------------E------M--
(129)

Numerically,

|--------------|
-rE-≈-4672-km,--
(130)

|----------------|
rM  ≈ 379728 km. |
------------------
(131)

For circular relative motion,

  2       G-(ME--+-MM--)
n  dEM  =      d2       ,
                EM
(132)

so

|----∘-----------------|
|       G(ME--+--MM--) |
|n =        d3        .|
--------------EM-------|
(133)

Numerically,

               −6
n ≈ 2.6653 × 10   rad/s.
(134)

The barycentric speeds are

vE = nrE ≈  12.45m/s,
(135)

and

vM =  nrM  ≈ 1012.10 m/s.
(136)

The period is

     2π-
T =   n ≈  27.28days.
(137)

One counterclockwise set of barycentric initial conditions is

|--------------------------------------------|
|rE(0) = (− rE,0,0),     vE (0 ) = (0,− vE, 0),
---------------------------------------------
(138)

|----------------------------------------------|
|rM (0) = (+rM ,0,0),     vM (0) = (0,+vM  ,0).|
-----------------------------------------------
(139)

These choices keep the center of mass at rest and make both bodies rotate counterclockwise about it.

Solution 13: write the orbital equation as a six-state first-order system

Let

    ∘  ------------
r =    x2 + y2 + z2.
(140)

The kinematic equations are

x˙=  vx,    y˙= vy,     ˙z = vz.
(141)

The acceleration components are

˙vx = − ------μx--------,
       (x2 + y2 + z2)3∕2
(142)

˙vy = − ------μy--------,
       (x2 + y2 + z2)3∕2
(143)

and

˙vz = − ------μz--------.
       (x2 + y2 + z2)3∕2
(144)

Thus

|------------------|
|      ⌊   vx   ⌋  |
|      |        |  |
|      ||   vy   ||  |
|dx-=  |   vz   | .|
|dt    ||− μx ∕r3||  |
|      ⌈− μy ∕r3⌉  |
|       − μz ∕r3   |
-------------------
(145)

Only the position components x,y,z determine the instantaneous point-mass gravitational acceleration. The velocity components are still essential because they determine the complete state and therefore which trajectory is followed through the field.

Most general-purpose numerical ODE integrators are designed for systems of first-order equations. Writing orbital dynamics in six-state form therefore allows the same standard algorithms used for many other dynamical systems to propagate an orbit.

Solution 14: Julia RK4 propagation of a circular initial state

A compact Julia implementation is:

using LinearAlgebra
using Printf

const muE = 3.986004418e14
const RE  = 6.371e6
const h   = 400e3
const r0mag = RE + h
const vc = sqrt(muE / r0mag)
const T  = 2pi * sqrt(r0mag^3 / muE)

function rhs(x)
    r = x[1:3]
    v = x[4:6]
    rn = norm(r)
    a = -muE .* r ./ rn^3
    return vcat(v, a)
end

function rk4_step(x, dt)
    k1 = rhs(x)
    k2 = rhs(x .+ (0.5 * dt) .* k1)
    k3 = rhs(x .+ (0.5 * dt) .* k2)
    k4 = rhs(x .+ dt .* k3)
    return x .+ (dt/6.0) .* (k1 .+ 2 .* k2 .+ 2 .* k3 .+ k4)
end

function specific_energy(x)
    r = x[1:3]
    v = x[4:6]
    return dot(v,v)/2 - muE/norm(r)
end

x0 = [r0mag, 0.0, 0.0, 0.0, vc, 0.0]
x = copy(x0)

N = 1000
dt = T / N
E0 = specific_energy(x0)
                                                                                         
                                                                                         

for k in 1:N
    x = rk4_step(x, dt)
end

Ef = specific_energy(x)

dr = norm(x[1:3] - x0[1:3])
dv = norm(x[4:6] - x0[4:6])

@printf("period = %.6f s\n", T)
@printf("dt = %.6f s\n", dt)
@printf("position closure error = %.6e m\n", dr)
@printf("velocity closure error = %.6e m/s\n", dv)
@printf("specific-energy change = %.6e J/kg\n", Ef-E0)

The theoretical circular period is

T ≈ 5544.8551 s.
(146)

With N = 1000,

Δt ≈  5.54486 s.
(147)

A representative RK4 run gives a position closure error on the order of

|------------|
1.6 × 10− 3m |
--------------
(148)

and a velocity closure error on the order of

|---------------|
1.8 × 10−6 m/s. |
-----------------
(149)

The specific-energy change is approximately

|--------------------|
|             −5     |
|Δ-𝜖| ∼-5 ×-10--J/kg--
(150)

for this step size and one-orbit propagation.

The exact numbers depend on floating-point arithmetic and implementation details, but the important check is that the propagated state closes closely after one theoretical period and that the conserved energy changes only slightly. Later numerical celestial-mechanics lessons will compare general-purpose Runge–Kutta methods with symplectic integrators designed for long-term hamiltonian motion.

1 What CM03E1 adds to the series

CM03 established the initial-value problem

¨r = − μ r-,    r(t0) = r0,    v (t0) = v0.
        r3
(151)

CM03E1 shows how to use it in practice.

For circular motion,

|----------|
|     ∘ -- |
|vc =   μ-.|
--------r--
(152)

For minimum escape,

|------∘-----|
|        2μ- |
|vesc =    r .|
--------------
(153)

For a completely general Cartesian state, the acceleration is still simply

|-------r--|
a =  − μ--,|
--------r3--
(154)

while the velocity supplies independent initial data that selects the actual trajectory.

The problem set also introduced the useful energy classifier

|------------|
|    v2   μ  |
|𝜖 = ---− --,|
-----2----r--
(155)

without yet deriving the full conic orbit. The next theory lessons can now expose the deeper conservation structure hidden in Newton’s equation, beginning with angular momentum and planar motion.

References

[1]   J. M. A. Danby, Fundamentals of Celestial Mechanics, 2nd ed., Willmann-Bell, 1988.

[2]   Roger R. Bate, Donald D. Mueller, and Jerry E. White, Fundamentals of Astrodynamics, Dover Publications, 1971.

[3]   John R. Taylor, Classical Mechanics, University Science Books, 2005.

[4]   Herbert Goldstein, Charles P. Poole, and John L. Safko, Classical Mechanics, 3rd ed., Addison-Wesley, 2001.

[5]   Bradley W. Carroll and Dale A. Ostlie, An Introduction to Modern Astrophysics, 2nd ed., Pearson Addison-Wesley, 2007.


"Celestial Mechanics: Initial-Value Orbital Motion - Worked Problems and Complete Solutions" is owned by bloftin.
(view preamble)
View style:
Other names:  CM03E1
Keywords:  orbital initial value problem, Newton orbital equation, Cartesian state vector, circular orbit, escape trajectory, radial motion, two body problem, gravitational acceleration, numerical integration, RK4, celestial mechanics, worked problems, complete solutions

This object's parent.

Cross-references: hamiltonian, dynamical systems, algorithms, kinematic, relative motion, second-order differential equation, angular momentum, field, uniform circular motion, function, scalar, system, center of mass, formula, masses, unit vector, kinetic energy, speed, magnitude, vector, energy, differential equation, velocity, works, motion, position, acceleration, force, CM03

This is version 1 of Celestial Mechanics: Initial-Value Orbital Motion - Worked Problems and Complete Solutions, born on 2026-09-25.
Object id is 1276, canonical name is CelestialMechanicsInitialValueOrbitalMotionWorkedProblemsAndCompleteSolutions.
Accessed 3 times total.

Classification:
Physics Classification: 45.50.Pk (Celestial mechanics )
 95.10.Ce (Celestial mechanics )
 95.30.Sf (Relativity and gravitation (see also section 04 General relativity and gravitation; 98.80.Jk Mathematical and relativistic aspects of)
Pending Errata and Addenda
None.
Discussion
Style: Expand: Order:

No messages.

Interact
rate | post | correct | update request | add example | add (any)