The Clohessy–Wiltshire equations describe the relative motion of one spacecraft in the neighborhood of another that shares a circular orbit, the standard linear model for rendezvous and station-keeping. This example builds that model as an input–output system and brings it to life with real entity data: the Hubble Space Telescope sets the orbit’s mean motion, and Space Shuttle Endeavour on mission STS-61 — the 1993 first servicing flight — plays the chaser. The result ties an abstract control model to an actual rendezvous, and places the relative motion back onto Hubble’s true orbit around the Earth.
The Clohessy-Wiltshire equations:
In[]:=
Columneqns=x''[t]==3x[t]+2ny'[t]+[t]m,y''[t]==-2nx'[t]+[t]m,z''[t]==-z[t]+[t]m,
2
n
u
x
u
y
2
n
u
z
Out[]=
′′ x -6 10 u x ′ y |
′′ y u y ′ x |
′′ z -6 10 u z |
The model labels:
In[]:=
labels={{,,},{x,y,z},{x,x',y,y',z,z'}};
u
x
u
y
u
z
The state space model:
In[]:=
ssm=StateSpaceModel[eqns,{x[t],y[t],z[t]},{[t],[t],[t]},{x[t],y[t],z[t]},t,SystemsModelLabels->labels]
u
x
u
y
u
z
Out[]=
| | u x | u y | u z | |||||
x | 0. | 1. | 0. | 0. | 0. | 0. | 0 | 0 | 0 |
′ x | 3.71772× -6 10 | 0. | 0. | 0.00222642 | 0. | 0. | 0.00012483 | 0 | 0 |
y | 0. | 0. | 0. | 1. | 0. | 0. | 0 | 0 | 0 |
′ y | 0. | -0.00222642 | 0. | 0. | 0. | 0. | 0 | 0.00012483 | 0 |
z | 0. | 0. | 0. | 0. | 0. | 1. | 0 | 0 | 0 |
′ z | 0. | 0. | 0. | 0. | -1.23924× -6 10 | 0. | 0 | 0 | 0.00012483 |
x | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
y | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 |
z | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 |
The mass of the STS-61 Space Shuttle:
In[]:=
m=QuantityMagnitudeUnitConvertMannedSpaceMissionData,"Mass","Kilograms"
Out[]=
8011.0
The Hubble Space Telescope (HST) data:
In[]:=
hubble=SatelliteData
Out[]=
It’s mean motion:
In[]:=
n=2πQuantityMagnitude[UnitConvert[hubble["MeanMotion"],"Revolutions"/"Seconds"]]
Out[]=
0.00111321
Simulate the CW model to obtain the space shuttle’s relative trajectory:
In[]:=
x0={500,0,-10000,-2n500,0,0};
In[]:=
or=OutputResponse[{ssm,x0},{0,0,0},{t,0,2π/n}]
Out[]=
InterpolatingFunction[t],InterpolatingFunction[t],InterpolatingFunction[t]
In[]:=
sts61Orbit=ParametricPlot3Dor,{t,0,2π/n},
Out[]=
The orbital parameters of the HST:
parsHST=Table[SatelliteData[hubble,prop],{prop,{"SemimajorAxis","Inclination","PeriapsisArgument","Eccentricity"}}];
In[]:=
{a,inc,ω,e}=Join[QuantityMagnitude[MapThread[UnitConvert,{Table[parsHST[[i]],{i,3}],{"Meters","Radians","Radians"}}]],{parsHST[[4]]}]
Out[]=
{6.85163×,0.496934,3.02391,0.000164}
6
10
The orbit ellipse in the perifocal frame:
In[]:=
perifocal[ν_]:=With[{r=a(1-)/(1+eCos[ν])},{rCos[ν],rSin[ν],0}]
2
The rotation from the perifocal frame to Earth-centered coordinates:
In[]:=
MatrixForm[q=RotationMatrix[Ω,{0,0,1}].RotationMatrix[inc,{1,0,0}].RotationMatrix[ω,{0,0,1}]/.Ω->1]
Out[]//MatrixForm=
-0.623416 | 0.671138 | 0.401156 |
-0.779884 | -0.570467 | -0.25758 |
0.0559752 | -0.473435 | 0.879049 |
A plot of the HST’s reference orbit around the Earth:
In[]:=
orbit=ParametricPlot3D[q.perifocal[ν],{ν,0,2Pi}]
Out[]=
The Hill-frame axes along Hubble’s orbit, in Earth-centered coordinates:
In[]:=
rHat=q.{Cos[nt],Sin[nt],0};vHat=q.{-Sin[nt],Cos[nt],0};hHat=q.{0,0,1};
A factor to exaggerate the small relative separation:
In[]:=
scale=100;hubbleECI=arHat;shuttleECI=arHat+scale(or[[1]]rHat+or[[2]]vHat+or[[3]]hHat);
The Earth’s radius:
In[]:=
r
Out[]=
6.371009×
6
10
Both spacecraft orbits about the Earth:
bothOrbits=ParametricPlot3D{hubbleECI,shuttleECI},{t,0,2Pi/n},;
In[]:=
earth=Graphics3D[{Blue,Specularity[White,15],Sphere[{0,0,0},]}];
r
In[]:=
Showearth,bothOrbits,
Out[]=
CITE THIS NOTEBOOK
CITE THIS NOTEBOOK
Clohessy-Wiltshire input-output model calibrated to Hubble and Endeavour STS-61 data
by Maher Kuzbari
Wolfram Community, STAFF PICKS, August 26, 2026
https://community.wolfram.com/groups/-/m/t/3787698
by Maher Kuzbari
Wolfram Community, STAFF PICKS, August 26, 2026
https://community.wolfram.com/groups/-/m/t/3787698