Shape the spacecraft, then fly it
The spacecraft is built from NURBS patches. Each solar panel is a sheet of control points, and the bus is a series of exact circular sections. Dragging a control point updates the panels, the mass, the centre of mass, the inertia and the stability of the spacecraft facing the Earth at once, as previews computed in this page. The program reads the same control points and flies the spacecraft as one rigid body in the Earth’s gravity, with its reaction wheels as bodies of their own.
This page is one of four simulators on the author’s website. It flies the spacecraft at tier B: each of its three reaction wheels is a rigid body of its own on a revolute joint to the bus. Satellite Simulator A flies the same spacecraft at tier A, as one rigid body, and runs six to eight times faster. To begin, open Missions and view a recorded flight, or read the Guide for the model and its equations. The recorded flights, Design and the Guide work for every reader. New flights are run by the author’s solver service, which this public copy leaves out.
Stability in the gravity gradient browser preview
The orbit and the start browser preview
The orbit’s figures are those of an ellipse about a spherical Earth, with the first averaged effect of the oblateness on its plane, and the air’s, for a spacecraft facing the Earth with its panels edge-on to the flow. The program integrates the whole: it states none of these averages apart (Guide, Part II).
Body axes: x along the velocity, y to the left panel and against the orbit’s angular momentum, and z towards the Earth.
Missions
A library of experiments. Choosing one here changes nothing else on the page. View the recorded flight opens the flight stored in this page in Results and leaves your setup in Design and Fly as it is. Load the mission’s setup replaces your setup in Design and Fly, and Fly then offers to restore the setup you had before.
Missions
A mission is a flight that studies one question of orbit or attitude, interrupted by up to two events in which the spacecraft loses a panel, a control fails or sticks on, a wheel’s motor fails, or a storm thickens the air. Choose a question, add events, then either view the flight recorded in this page or load the mission’s setup into Fly. A question or an event alone is a mission too.
Orbit and attitudeOne question to study
Events: a loss, a failure or a stormUp to two, in the order they occur
The flight
The spacecraft starts on the orbit of the elements given here. Facing the Earth, it starts from its trim, a state in which nothing accelerates, which the program finds by an optimization before the flight (Guide, Part III). By default the spacecraft starts along the local vertical and the program solves for the constant torques of the torquers, which then act through the flight beside their pulses. With the trim set to attitude, the torques are zero and the program solves instead for the yaw, the pitch and the roll from the local vertical at which the gravity gradient, the air and the turning of the body balance. Each control then acts once, as a smooth pulse. These values and the spacecraft of Design together form the setup, and Run sends the setup to the machine through the solver service.
Operating conditions
Environment
Model assumptions
Control histories and events
Prescribed inputs: what the setup asks for. Whether the march resolved them is reported with each result.
Numerical settings
The time flown is the horizon of the question and sits under Operating conditions. The densities and the wheels are structure, not numerics; they are set in Design.
Results
One result is shown at a time, with the setup saved alongside it. A result is separate from the setup being edited in Design and Fly. Editing that setup never changes a result, and each result is drawn with its own saved spacecraft.
Full account of this result: origin, executable, trim, orbit, controls, numerics, energy
How the simulator works
The Guide has three parts, each a tab below: the geometry and the mass, the orbit and the attitude, and the equations as the program solves them. The panel on the left lists the sections of the open part. Its figures are of three kinds and each is marked. A browser preview is computed in this page from the current setup of Design and Fly, by the page's own copy of the model. A solver result is drawn from a result the program computed on the machine. An illustration depends on neither.
What the model covers, and what it leaves out
- One rigid spacecraft, and its wheels. The bus and its panels are one rigid body of six degrees of freedom. No part flexes and no fuel is burnt. The three reaction wheels, where there are any, are bodies of their own, each on a revolute joint to the bus.
- The Earth’s gravity, to second order. The potential is that of a point mass, of the Earth’s flattening J₂, and of the spread of the spacecraft’s mass about its centre, which is the gravity gradient. The Moon, the Sun and the higher harmonics are left out.
- Free-molecular air. The molecules strike the spacecraft without striking one another. The density falls exponentially with height about a reference, in an atmosphere that turns with the Earth, and a storm may raise it by a factor.
- No light, no field. There is no pressure of sunlight, no shadow, and no magnetic field: the torquers are torques about the body’s axes, whatever produces them.
- Prescribed controls and events. Each control acts once, as a smooth pulse. An event removes a stretch of a panel, fails a control or a wheel’s motor, or sticks a control on, at the instant of the march nearest its time.
- A trimmed start, facing the Earth. The flight starts where nothing accelerates, found as an optimization on the first two steps: by default along the local vertical with the torquers’ constant torques, or, with the trim set to attitude, at the yaw, pitch and roll of zero torque. With inertial pointing there is no trim.
For every result shown, Results compares the page’s copy of the spacecraft with the program’s own record of it.
Geometry and mass
The control points of Design are the whole description of the spacecraft’s shape. The mass, its centre and the inertia follow from them by integration, exactly as for the aircraft of the same family.
The geometry is NURBS
Each patch is a tensor product of rational B-splines. A point of a sheet at the parameters (u, v) is
with P the control points, w their weights, and N, M the B-spline functions of uniform open knot vectors. Along the span a panel of n stations has the degree min(2, n − 1), so the default panel of two stations, root and tip, is straight. Across, the degree is one. The functions are never negative and sum to one, so a point of the panel is a weighted average of the control points (Figure 1). Add stations to a panel in its row list and it may curve.
The bus has the degree min(2, n − 1) along its n sections and two around each. A section is a circle of nine control points with weights 1 and √2/2. A circle is rational: no polynomial spline can draw it exactly (Figure 2).
Mass, centre and inertia are integrals
Each skin has an areal density ρ_A. Gauss’s rule on every cell of every patch gives
with dA. The bus is an open tube, without end caps, so its skin is its side alone: the default bus of radius 1.1 m and length 1.6 m at 30 kg/m² weighs 2π·1.1·1.6·30 = 331.75 kg, the two panels 34.3 kg, and the point masses 225 kg, together the 591.05 kg that the program records (Figure 3).
The program’s record of the spacecraft leaves out the wheels, whose 4 kg each it carries as bodies of their own. The whole spacecraft with its wheels weighs 603.05 kg, the mass that the burn of Question 6 moves.
Orbit and attitude
The gravity that bends the path into an orbit also turns the body, the thin air takes energy from both, and the wheels turn the bus without any torque from outside.
Gravity, to second order
The program states the potential energy of a body whose centre lies at x, r = |x|, in the Earth’s field:
with μ the Earth’s gravitational parameter, R its equatorial radius, J₂ its flattening, and p = Cx the place of the centre in the body’s axes. The first term bends the path into an ellipse. The second turns an inclined orbit’s plane about the pole, by dΩ/dt = −(3/2) n J₂ (R/p)² cos i on average; at an inclination near 98° and 800 km this turns the plane with the Sun (Question 3). The third is the gravity gradient.
The near end of a long body is pulled harder than its far end. Tilted from the vertical, the body feels a torque back towards it (Figure 4). The program writes no torque: the torque is the derivative of the third term of (4) in the Euler parameters.
Which spacecraft keeps facing the Earth
About the local vertical, with x along the velocity, y against the orbit’s angular momentum and z towards the Earth, the linearized motion depends on the moments only through
Pitch swings at n√(3(I_x − I_z)/I_y) when k₁ > k₃. Roll and yaw are coupled, s⁴ + (1 + 3k₁ + k₁k₃) s² + 4k₁k₃ = 0 in units of n, and stable when both roots in s² are real and negative. Two regions remain (Figure 5): the Lagrange region, where I_y is the largest moment, and the region of DeBra and Delp, a narrow wedge where it is the smallest. The default spacecraft lies in the second: its panels along y make I_y smallest, and its boom raises I_y close to I_z.
The air, molecule by molecule
At 400 km a molecule of air travels kilometres before it strikes another. The spacecraft therefore meets the molecules its area sweeps, and a strip of a panel of area dA and normal n, moving at v = V + ω × r through the air, takes the load
the drag of a flat plate in free-molecular flow, against v, with C_D about 2.2 (Figure 6). Its derivative in ω is that of the integral, so the air’s damping of the attitude is stated nowhere apart. The bus’s drag is −½ρ₀σ C_DA |V| V at the centre of mass. The air turns with the Earth, so V is the velocity relative to it.
The wheels, and the equivalent wheel
A reaction wheel is a disc on a revolute joint to the bus, turned by its motor. The motor’s torque turns the wheel one way and the bus the other: no momentum enters from outside. A wheel symmetric about its axis e enters the bus’s motion only through its momentum about that axis, h = I_a (e·ω_w), and its transverse moment. A wheel of the axial moment kI_a spinning k times slower has the same h, and moves the bus exactly as the wheel does (Figure 7).
The program flies that equivalent wheel, with k the least that brings the wheels’ fastest speed, their limit, to 0.05 rad a step. The march then follows a spin k times slower and takes the bus’s steps, not the wheel’s. The wheel’s own speed and energy are recovered from h:
Reading a run
What the spacecraft does after the first instant is known only from a run. Figure 8 draws two of its measures for the result selected in Results: how far the body’s z axis lies from the nadir, and how far the semi-major axis has moved.
Equations and implementation
The flight is a mechanism of bodies, the spacecraft and its wheels, written as a Lagrangian with virtual work. They are read from satellite_dynamics.f90, orbiting_spacecraft.f90 and the mechanism of multibody_dynamics.f90, which the aircraft shares.
The Lagrangian and the load
The spacecraft’s coordinates are the displacement of its centre of mass and the Euler parameters of its rotation, in the axes of the Earth’s centre, x towards the orbit’s ascending node at the start and z along the pole, which do not turn with the Earth. Its Lagrangian is its kinetic energy less the potential (4), with the virtual work of the load:
where the load is the air’s (6) on the bus and on every strip of the panels, the torques of the torquers, and the thrust of the burn along x at the thruster. Each control is a pulse
whose mean is half its amplitude, so a burn of 20 N for 100 s delivers 1000 N s. The energy changes by the work of the load, less the energy the separated parts take away:
The planet’s potential has no datum, so every phase’s energy is on one scale. A part bound to the Earth has negative energy, so a separation raises the energy of what remains. The program solves for the supply as it does for the motion: its work W is an unknown of the march, with the law W′ = F·v + M·ω from what was supplied before each phase, so that (10) is judged on the solution itself. It is the variational statement (8) tested with the motion’s own velocity as its virtual displacement: the energy’s change equals the supply. After every flight, Results states whether the solution satisfies it: to the rounding of the arithmetic, to the accuracy of the march, or not.
The wheels on their joints
Each wheel is a body of its own, its coordinates like the spacecraft’s, joined to the bus by a revolute joint about its axis. The joint’s conditions hold the wheel’s centre at its place in the bus and its axis along the bus’s, and enter the bodies’ rows only through their reactions. The motor’s torque is a pulse (9) that acts on the wheel and, oppositely, on the bus, by virtual work on both. A wheel whose motor fails spins on with no torque.
Each wheel is attracted as the wheel itself, not as its equivalent: the potential (4) reads the inertia of the spread of the mass, which an equivalent body may state apart from its inertia of motion.
The initial data, from the elements
The spacecraft starts on the orbit of the elements given about a spherical Earth: the perigee’s altitude, the eccentricity e, the inclination, the node, the argument of the perigee and the true anomaly ν, at
with p = a(1 − e²). With J₂ the orbit departs from that ellipse, the elements osculating at the start. The attitude is turned from the local vertical by the yaw, the pitch and the roll, in turn about z, y and x; facing the Earth, it turns with the local vertical at √(μ/p³)(1 + e cos ν)² about −y, and besides at the body rates given.
The trim, as an optimization
Facing the Earth, the flight starts from a state in which nothing accelerates: the gravity gradient, the air’s moment and the gyroscopic moments of the turning body and of its wheels’ momenta balance, so that the spacecraft turns with the local vertical and its wheels gather no momentum. The program does not guess it; it finds it in one of two ways, as the entry trim states. With torquers, the default, the spacecraft starts along the local vertical and the design s is the three constant torques of the torquers, which then act through the whole flight beside their pulses, as an aircraft’s trimmed elevator does; the objective J is the torquers’ effort, half the square of the torques. With attitude, the torques are zero and the design is the yaw, the pitch and the roll of the start, the torque-equilibrium attitude; the objective is the drag D, the air’s force against the airspeed. Either way the design is three numbers, and the trim is a Lagrangian on the first two steps of the flight:
with the objective J of the trim chosen, and its laws that the bus’s mean angular acceleration vanishes. The design iteration starts from the local vertical with no torque, the body rates given left out. Three laws in three designs fix the start where they have an isolated root, and then the objective chooses nothing: it values the laws, π_k being what the k-th law costs in the objective. The torquers’ trim is linear in the torques and always finds them. The program reports the conditions of Karush, Kuhn and Tucker it met, and Results quotes them. A square nonlinear system can have several roots, so no global uniqueness is claimed.
The march, in phases
Each step is solved by the scheme chosen, DIRK(4) by default, the first instant by DIRK(2), which takes no step and bears the initial data; a multistep family is started by the DIRK of its order until it has the instants it reads. Each instant is a block solved by Newton’s method, the tying rows eliminated and the rest by a dense factorization. An event begins a new phase: a spacecraft of its own on its own interval, its motion continued from the motion the phase before ended with.
The step is controlled by phase. Where a block’s Newton iteration does not converge, the phase is marched again from its start with each step divided into 2, then 4, then 8. The instants of the flight remain among the finer ones, so the events and the records keep their times. Only the discretization changes: the scale of the equivalent wheels and the trim remain those of the step stated. A phase that converges at none of the four stops the program, and the page shows the program’s own message. Results states every phase that was refined.
A refined phase equals the same phase flown directly at the finer step with the same scale of the wheels, at every instant to the last digit. What the control does not reach is a block made ill conditioned by that scale itself. Untrimmed at 210 km for a day at 60 s, the bus tumbles, and with the scale of 7.5e5 that the default limit of 6000 rpm sets, no step down to an eighth converges. A limit of 1 rpm, a scale of 126, flies the same day at 60 s unrefined, its wheels below 0.25 rpm. Where the wheels turn far slower than their limit, a lower wheel_limit is therefore the remedy.
One spacecraft at two fidelities, tiers A and B
Fidelity is a choice independent of the vehicle. Every tier models the whole vehicle, and only the model of its bodies changes; no tier isolates one part of it. Two choices set the tier: how many bodies the vehicle is, and whether a body deforms. This page flies tier B by default.
Tier A, one body. The spacecraft is one rigid body. A moving part does not move apart from it: each wheel’s mass and its first and second moments are among the spacecraft’s, and what it exchanges with the bus enters as a load. A symmetric wheel is turned about its axis by its motor alone, so its angular momentum about that axis is known from the motor’s pulse (9) without solving for it,
the bus bearing the motor’s reaction and the turning of the momentum with it, its inertia that of the whole less the wheels’ axial moments, which the momenta carry. Gravity still reads the whole inertia (4).
Tier B, rigid parts. Each wheel is a body of its own on a revolute joint, as in The wheels on their joints, its motion among the unknowns. What tier A took as a load, tier B takes into its unknowns, and the joints’ reactions replace it.
What stays the same. Moving a term from the load into the unknowns changes how the balance is split, not the balance itself. The energy less the work of what remains outside the unknowns is the same constant at both tiers,
a check of one tier against the other by a single number. The tiers are joined by the motion that locks every joint, P, which moves each part rigidly with the bus: tier A’s mass and moments are tier B’s parts locked together, M_A = PᵀM_BP. The entry prediction of Fly uses this at tier B: set to lumped, each step’s Newton iteration begins from the march of the spacecraft at tier A, its bus and wheels placed on the one body.
Measured. Tier A’s mass, centre and inertia equal tier B’s bus and wheels locked together, to 1e-13 of 1361 kg m². Flown at both tiers, the attitude agrees to 2e-10 and the rates to 2e-12 rad/s; a wheel spun at 3000 rpm stiffens the bus alike, to 2e-8 rad/s; the work of the load agrees to 4.5e-8 J. With the supply integrated by the march, the defect of (14) at tier A is at the energy’s rounding in every case flown, 3.1e-5 to 6.4e-5 J against 6.3e-5 J of an orbit of 1.8e10 J. At tier B it is so for a wheel driven alone, whereas with a wheel spun at 3000 rpm it is 4.7e-3 J, the defect of tier B’s equivalent wheel, which tier A does not have. Tier A flies six to eight times faster, and flies untrimmed at 210 km for a day at 60 s, which tier B does not (The march, in phases).
Tier C, flexible bodies, is the axis’s next coordinate: a body that deforms, a beam, a plate or a solid, with the same whole spacecraft and the same check (14).
The scheme’s power, a label
The march solves for the supply as it does for the motion, so the defect of the work-energy theorem, E(t) − E(0) − W(t) + D(t), is energy the scheme itself has created or destroyed. Its rate is the scheme’s power,
in watts, beside the power P = F·v + M·ω of the supply: positive where the scheme creates energy, negative where it destroys it. A device is labelled by what it consumes, measured on a standard cycle, so that one can be chosen against another; a scheme is labelled so by its power. Every result states the power of its own scheme. The labels below were measured with the program on two standard flights of the default spacecraft at tier B, each flown alone. DIRK(4) has the same label at tier A, to the digits shown; the other schemes were measured at tier B alone.
A label gives two numbers, as a device states its mean and its peak consumption: the mean power, the defect at the end over the time flown, which is the scheme’s drift over a long flight; and the largest power over a step, its worst moment.
Idle: the default orbit at 400 km with the Earth’s oblateness, one orbit in 200 steps of 27.8 s, with nothing supplied, so all the power is the scheme’s. The mean and the largest power, and the time the run took:
- DIRK(4): +7.2e-3 W, at most 7.5e-3 W; 12.6 s.
- Adams–Moulton 2, the trapezoidal rule: +8.4e-4 W, at most 54 W; 5.6 s. Its defect swings to 4.5e4 J and back, without accumulating.
- BDF(4): +0.81 W, at most 1.9 W; 6.7 s.
- DIRK(2): +4.6 W, at most 11.5 W; 6.2 s.
- DIRK(3): +122 W, at most 124 W; 7.5 s.
- BDF(3): +619 W; 6.1 s. BDF(2): −620 W; 5.8 s.
- BDF(1): −1.1e6 W; 13.3 s. In one orbit it destroys 6.0e9 J, a third of the orbit’s energy.
About a spherical Earth, on the circular orbit, the trapezoidal rule is at the rounding, at most 4.5e-5 W, and every other label is nearly as above. A cycle that is too special flatters a scheme: the standard idle flight is therefore the default orbit, with the oblateness.
Under load: the burn of 20 N for 100 s, whose power reaches 1.5e5 W, in 555 steps of 10 s. The scheme’s largest power and the time the run took:
- DIRK(4): 6.6e-3 W, a part in 2e7 of the thrust’s power; 28.5 s.
- DIRK(2): 0.97 W; 12.2 s.
- Adams–Moulton 2: 4.8 W; 10.5 s.
- DIRK(3): 5.7 W; 15.3 s.
- BDF(4): 7.5 W; 12.5 s.
- BDF(3): 36 W; 11.7 s. BDF(2): 44 W; 11.0 s.
- BDF(1): 9.0e5 W; 10.5 s.
At equal cost. The cheaper schemes at twice the steps take about the time of DIRK(4) at the step stated. Idle, at 400 steps in 8 to 10 s: BDF(4) 0.026 W, at most 0.093 W; Adams–Moulton 2 2.1e-4 W, at most 13.6 W; DIRK(2) 0.58 W, at most 2.2 W; against DIRK(4)’s 7.2e-3 W, at most 7.5e-3 W, at 200 steps in 12.6 s. Under load, at 1110 steps in 18 to 23 s: DIRK(2) 0.27 W, BDF(4) 0.46 W and Adams–Moulton 2 1.2 W at most, against DIRK(4)’s 6.6e-3 W at 555 steps in 28.5 s.
What the labels show. The order of a scheme does not decide its label. The trapezoidal rule, of order 2, has the smallest mean of all idle, since it is symmetric in time and its defect does not accumulate; yet its peak is the largest but for the backward differences of low order, and under a pulse it does not damp the transient. DIRK(3) is worse than DIRK(2). The backward differences alternate in sign, BDF(2) destroying and BDF(3) creating energy at nearly the same rate, and BDF(1) damps the orbit itself. DIRK(4), the default, has the best peak on both flights and the best mean under load, at about twice the time of the others: over a long idle flight whose energy matters more than its moments, the trapezoidal rule drifts least. Adams–Moulton above order 2 met a singular block in every flight tried, and the program refuses it.
What the program records
A result is the program’s records, as the solver service returns them. Results shows nothing else as a solver result.
| Record | Contents |
|---|---|
setup | every entry of the setup as the program received it |
planet | the gravitational parameter, the equatorial radius, J₂, the Earth’s rate and its angle at the start |
spacecraft | the mass, the centre of mass and the inertia, without the wheels at tier B and with them, less their axial moments, at tier A; and each panel’s area and span |
trim | the yaw, the pitch and the roll of the start, in rad |
incident | at each event: the part, the time, the stretch, the mass, centre and inertia that remain, and the energy before, after and departed |
instant | t; place and velocity of the centre of mass in the Earth’s axes; euler; rates about the body’s axes; altitude; speed; energy; power; wheel_speeds in rpm; work; departed |
balance | the energy change, the work of the load, the energy departed and the largest difference during the march |
The angle from the nadir, the yaw and the orbit’s elements are not recorded. The page computes them from the place, the velocity and the Euler parameters, and says so wherever it shows them.
Architecture, as the code has it
This card is written from the page’s own definitions, so it cannot drift from them. A design is guarded against variability from manufacture, operation and environment, its optimality is in size, shape, topology, trajectory and control, and the physics is a residual R(x, y, u) = 0 with quantities of interest F(x, y). This page instantiates only the deterministic physics.
Three remarks that connect the pieces
- One vehicle, two machines. The aircraft and the spacecraft are the same rigid vehicle of the same mechanism: NURBS patches, point masses, a thruster, controls as pulses, events as phases. Only the potential and the load differ: a uniform field and the strips of a wing against the Earth’s field and the molecules of a thin air.
- Torques that are not written. The gravity gradient is the derivative of the potential (4), and the air’s damping is the derivative of the load (6). Neither is a separate term, so neither can disagree with the physics it comes from.
- The equivalent wheel is exact for the bus. It changes the wheel’s spin and moment together and keeps their product, the only thing the bus feels. Scaling the bus’s inertia instead would be wrong, and the program does not do it.
Using the page
- Design: pick a panel or the bus and a projection. Drag an amber control point; with Mirror on, the other panel follows. Type exact values under the drawing. The ledger is a browser preview and updates as you drag.
- Missions: choose a question and up to two events, then view the flight recorded in this page or load its setup.
- Fly: set the orbit, the air, the pulses and the events. Run is offered once every value passes the program’s declaration.
- Results: one result with its saved setup, recorded in this page or retrieved from the machine by its ID.
The page reaches the machine through the solver service in the service settings. Without it, Design, Missions, the Guide and the recorded flights still work.