Welcome back. We now have the physical rule needed for the simplest orbital model: in an Earth-centred inertial frame, a satellite at position has acceleration
That rule alone does not yet specify an orbit. To obtain a particular trajectory, we must state where the satellite is and how it is moving at one chosen time, then formulate the problem in the form a numerical solver can evolve.
This lesson turns the second-order Newtonian equation into a first-order state-space initial-value problem. This is the interface behind essentially every ODE solver you will use later: a function takes the present state and returns its instantaneous rate of change.
From Newton's law to an initial-value problem
Newton's second law for a satellite of mass is
For the fixed-Earth point-mass model, the only force is gravity. Dividing by gives
The double dot means a second derivative with respect to time:
The equation is second order because its highest time derivative is . In three dimensions, it represents three coupled scalar equations:
These are nonlinear equations: the right-hand side is not a fixed matrix times the coordinate vector, because the denominator depends nonlinearly on the present position.
A differential equation describes which curves are physically allowed. An initial-value problem selects one particular allowed curve by declaring the state at an initial time :
Thus the complete restricted two-body initial-value problem is
The initial position supplies three scalar values, and the initial velocity supplies another three. That is exactly the amount of initial information required for three second-order equations.
It is worth distinguishing this from a boundary-value problem. In an initial-value problem, all known conditions occur at one time, such as launch time. In a boundary-value problem, one might instead prescribe a position at launch and another position at a later arrival time. Orbital propagation is naturally an initial-value problem: given a state estimate now, predict its future evolution.
What counts as the state?
A system's state is the smallest collection of quantities that, together with the governing model, determines its instantaneous future evolution.
For the satellite, position alone is not enough. Two spacecraft can occupy exactly the same point in space while travelling with different velocities, and their subsequent paths will differ. Acceleration is not an independent part of the state in this model, because it is already determined by position through the gravitational law.
Define the six-dimensional state vector
The set of possible states is called state space, or, in mechanics, phase space. Here it is effectively six-dimensional position-velocity space, excluding the singular state , where the point-mass gravitational acceleration is undefined.

At time , the initial state is simply
For example, using kilometres and seconds, a possible initial state might be assembled as
This specifies a satellite initially km from Earth's centre on the positive -axis, travelling initially in the positive -direction. At this stage, regard it as an input state rather than trying to classify its resulting orbit. Later, you will derive how position and velocity determine such features as eccentricity and semi-major axis.
Converting the second-order equation to first-order state space
The conversion is conceptually simple but foundational. Introduce velocity as a separate state variable:
This gives one first-order equation:
The gravitational law gives the other:
Stacking these equations yields
Equivalently, in the standard numerical-analysis notation,
where, for this autonomous gravitational model,
The function is called autonomous because its formula does not depend explicitly on time. It depends only on the current state. A solver conventionally still passes as an argument because many physically important models do depend explicitly on time: thrust schedules, time-varying forcing, or a prescribed rotating frame are examples.
In scalar components, the same first-order system is
Notice the structure:
| Entries of | Their time derivatives |
|---|---|
| Position | Velocity |
| Velocity | Acceleration |
That is the whole reduction. A second-order problem has not been approximated or simplified physically; it has been rewritten exactly in a form that exposes all quantities needed to continue the motion from the current state.
More generally, any second-order vector equation
can be written using as
This general pattern is part of the general-purpose applied-mathematics toolkit: it applies to mechanical systems, coupled oscillators, electrical circuits expressed through suitable state variables, and many nonlinear dynamical systems.
Two-Body Numerical Solution in an Inertial Frame
Read the sections “The State Vector” and “Transforming the System of Ordinary Differential Equations” from Orbital Mechanics & Astrodynamics. They show the same state-space conversion for the full two-body system, where both masses are allowed to move.
In “The State Vector,” read from the state-vector layout. The author uses twelve entries because two bodies have two positions and two velocities. Compare this with our present six-entry fixed-Earth state. Then read “Transforming the System of Ordinary Differential Equations,” beginning at the conversion discussion, and continue through the displayed derivative of the state vector. Focus on the structural fact that derivatives of position entries are velocity entries, while derivatives of velocity entries are acceleration entries.
The reading's twelve-component formulation is not a competing notation for the current model. It is the model you will reach in the next module when Earth is no longer held fixed. The state-space architecture already scales cleanly:
- fixed central body and one satellite: state components;
- two freely moving bodies: state components;
- freely moving point masses: state components.
Only the force calculation changes substantially.
A compact Python representation
Your right-hand-side function should implement the mathematical object . It does not advance time itself. It answers a narrower question:
Given the current state, what is its instantaneous derivative?
import numpy as np
def earth_orbit_rhs(t, state, mu):
"""
Return d(state)/dt for a test satellite orbiting a fixed point mass.
state = [x, y, z, vx, vy, vz]
position units: km
velocity units: km / s
mu units: km**3 / s**2
"""
position = state[:3]
velocity = state[3:]
r2 = np.dot(position, position)
if r2 == 0.0:
raise ValueError("Point-mass gravitational acceleration is undefined at r = 0.")
acceleration = -mu * position / (r2 * np.sqrt(r2))
return np.concatenate((velocity, acceleration))
The returned array is
not the next position and velocity. This distinction is crucial. An ODE integrator will later call this function repeatedly, combining derivative evaluations according to a particular numerical method.
You can construct an initial state in the same ordering:
r0 = np.array([7000.0, 0.0, 0.0]) # km
v0 = np.array([0.0, 7.5, 0.0]) # km / s
state0 = np.concatenate((r0, v0))
A useful unit audit of the return value is:
It is normal for a state vector to contain quantities with different units. Its derivative correspondingly contains velocity units for the position entries and acceleration units for the velocity entries.
Three implementation errors are especially common:
-
Reversing the blocks. Returning is wrong for the declared ordering . The first three derivatives must be velocities.
-
Using position alone as the initial state. A position gives the gravitational acceleration, but it does not determine the orbit. The velocity vector is equally necessary.
-
Treating the state equation as linear. A linear system can be written as for a constant matrix . Gravity cannot: its acceleration coefficient changes with .
Converting a Higher Order ODE Into a System of First Order ODEs
Gregg Waterman’s “Converting a Higher Order ODE Into a System of First Order ODEs” gives a compact worked example of the same reduction, including how initial conditions become one initial state vector.
Watch the IVP conversion. Track the definitions of the new variables and the final assembly of the two initial conditions into one vector. The example is linear and explicitly time-dependent, so its matrix form is not the gravitational equation; use it to reinforce the general conversion procedure, not as a template for gravity's right-hand side.
Why this form is the computational boundary
The state-space equation establishes a clean separation between three tasks:
-
The physical model determines . Here, it is the inverse-square gravitational acceleration.
-
The initialisation determines . Here, it is an initial position and velocity in a clearly specified inertial frame and unit system.
-
The numerical method estimates the trajectory from the initial-value problem. We have deliberately not chosen that method yet.
This separation is valuable for scrutiny. If an orbit looks wrong, you can ask a more precise question: was the force law coded incorrectly, were the initial conditions inconsistent, or did the integrator introduce excessive numerical error? Those are distinct failure modes, and a well-structured simulator makes them distinguishable.
There is also a mathematical domain condition. The right-hand side is smooth for every state with
but it becomes singular at the origin. Given a valid initial state away from that singularity, the deterministic model specifies the local future rate of change uniquely. A physical Earth-orbit simulation should additionally stop or change its model before a trajectory reaches Earth's surface; the point-mass equation alone is not a collision or atmospheric-entry model.
Key takeaways
Newtonian orbital motion in the fixed-Earth model begins as a second-order vector equation:
A specific orbit requires six initial scalar values:
Defining the state vector as
converts the equation exactly into the first-order state-space form
This right-hand-side function is the central software boundary for your simulator: it maps a current state to its instantaneous derivative, while a later integrator will decide how to use those derivatives to move through time.
Next, we will nondimensionalise the gravitational model. That will reveal its natural orbital timescale and give you a cleaner way to reason about parameter magnitudes, timestep choices, and simulations of systems far beyond Earth.
Can't find a good explanation? Sign up and we'll make it for you
Sign up