Shape the aircraft, then fly it
The aircraft is built from NURBS patches. The wing, the tailplane and the fin are each a sheet of control points, and the fuselage is a series of exact circular sections. Dragging a control point updates the surfaces, the mass, the centre of mass and the static margin at once, as previews computed in this page. The program reads the same control points and flies the aircraft at tier B: an airframe with its elevator, rudder and two ailerons as rigid parts of their own, each on a hinge and turned by a servo. Flight Simulator A flies the same aircraft as one rigid body. The orange strips in the drawings are the four control surfaces, each the part of its chord behind the hinge that its effectiveness implies: about 16% for the elevator and the rudder, and about 1.5% for the ailerons.
This page is one of four simulators on the author’s website. It flies the aircraft at tier B, so that it also reports the hinge moments and the work of the servos. Flight Simulator A flies the same aircraft at tier A, as one rigid body. 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.
Longitudinal static stability browser preview
The start and its trim browser preview
The program starts each flight from its trim: the pitch, the elevator deflection and the thrust at which the aircraft accelerates neither forward nor up and does not begin to pitch (Guide, Part III). Those are three of the six accelerations of a rigid body. The sideways, roll and yaw accelerations are not trimmed, and vanish only for an aircraft symmetric about its vertical plane. The page computes the same trim with its own copy of the strip model and lists all six. The last group lists the loads of level flight at the stated thrust, which the trim removes.
Body axes: x forward, y to port and z up. A positive pitching moment M_y turns the nose down.
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 stability, interrupted by up to two events in which the aircraft loses a part or a control. 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.
StabilityOne question to study
Events: loss of a part or a controlFlown at tier A only, on Flight Simulator A
The flight
The aircraft starts from its trim. Before the flight, the program solves an optimization for the pitch, the constant elevator deflection and the thrust at which the aircraft accelerates neither forward nor up and does not begin to pitch (Guide, Part III). Sideways, roll and yaw are not trimmed, so the start is an equilibrium only for a symmetric aircraft with no control acting in the first two steps. The thrust entered here is where that search begins. Each control then moves once, as a smooth pulse about the trim. These values and the geometry 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 thrust here is the trim’s initial guess, which the trim replaces; a different guess could select a different root. The time flown is the horizon of the question and sits under Operating conditions. The skin densities are structure, not numerics. They are set in Design, under Skin densities.
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 geometry.
Full account of this result: origin, executable, trim and its optimizer, balance at the start, controls, numerics, energy
How the simulator works
The Guide has three parts, each a tab below: the geometry and the mass, the aerodynamics and the flight, 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 the result selected in Results, which the program computed on the machine. An illustration depends on neither.
What the model covers, and what it leaves out
- Rigid parts on hinges (tier B). The aircraft is an airframe and four control surfaces, the elevator, the rudder and the two ailerons, each a rigid body of its own. A part is the stretch of its surface behind the hinge chord that its effectiveness implies by thin-airfoil theory, on a revolute joint along its hinge. A servo turns it to its deflection, and the servo's hinge moment does work that joins the supply. No part flexes, and the point masses stay where they are placed, so no fuel is burnt.
- Incidents at tier A only. The program flies the loss of a surface at one body. This page therefore runs no incident; Flight Simulator A runs them.
- Quasi-steady strips. The load of each strip of a lifting surface follows from its velocity at that instant alone, by (4) and (5). There is no unsteady aerodynamics: no lag of the lift and no apparent mass.
- No stall. The lift coefficient is linear in sin α without limit, the profile drag coefficient is constant, and the induced drag takes a fixed efficiency e = 0.8.
- No interaction between the surfaces. The finite span enters only through each surface's own aspect ratio, in the lift slope of (4) and in the induced drag of (5). The wing's downwash and wake at the tail are not solved. Each strip of the tail sees the rigid body's velocity and nothing of the wing. The fuselage contributes a drag area, and no lift or moment.
- A plain engine and plain air. The thrust is constant and acts along the body's x at the engine. The air is still and of one density, and gravity is uniform at 9.81 m/s². There is no ground.
- Prescribed controls. Each control moves once, as the pulse (15), and adds aτδ to the lift coefficient of its surface, with τ = 0.15 for the ailerons and τ = 0.5 for the elevator and the rudder.
- A trimmed start, found in three design variables. The flight starts from its trim: the pitch of the start, a constant deflection of the elevator and the thrust, found so that the aircraft accelerates neither forward nor up and does not begin to pitch (17)–(19). Those are three of a rigid body's six accelerations. The sideways, roll and yaw accelerations are not trimmed: they vanish for an aircraft symmetric about its vertical plane and for no other, so an asymmetric aircraft leaves straight flight from its trim without any disturbance. The trim is found on the first two steps with the flight's control pulses acting, so a pulse inside those steps enters the trim. An event scheduled inside those steps does not enter it: the trim is that of the whole aircraft, and the program flies the loss at the instant of the march nearest its time. The speed is stated, not found, and the angle of attack is not bounded.
These statements describe the model as the page's copy of it and the laws (13) and (14) state it: the load reads only the airspeed, the turning rate and the controls. For every result shown, Results compares the page's copy with the program's own record of the aircraft, and with its trim, or for a result without one, the power at the first instant.
Geometry and mass
The control points of Design are the whole description of the aircraft's shape. The mass, its centre and the inertia follow from them by integration.
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 surface of n stations has the degree min(2, n − 1): two for the wing and the tailplane, and one for the fin, whose two stations leave room for a straight line only. Along the chord the degree is one, so that every section is a straight chord. The functions are never negative and sum to one, so a point of the surface is a weighted average of the control points. Figure 1 shows the weights along the wing's span.
The fuselage 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, all of whose weights are equal, can draw it exactly (Figure 2). Twist, taper, sweep and dihedral are nothing but the places of control points.
- Control point
- A point that pulls the surface toward itself (Figure 1). The surface passes through the end points and near the others. Its weight sets how strongly it pulls (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 integral is taken on the parameter square and carried to the surface by the map (1): Figure 3 shows the same Gauss points in both places. Moving a control point moves the points of the surface and their areas, which is why the centre of mass in the drawing moves as you drag.
The point masses (engine, pilot, fuel) are added at their places. The inertia (3) is taken about the centre of mass, so that the rotation and the translation of the rigid body separate.
Aerodynamics and flight
The air's load on the lifting surfaces, the motion it drives, and what the Design view and a run can and cannot say about stability.
The air's load, strip by strip
At each Gauss point u along the span, a strip has its quarter-chord point x, chord vector c, span tangent s and normal n. It moves at v; v_p is the part normal to the span, and
Here α is the angle of attack of the strip, and κ₀ is the wing's lift offset: a number added to sin α, positive for a cambered section, and zero for the tailplane and the fin. It is the entry the program calls zero_lift_angle, but it is not that angle. With the control neutral the lift of a wing strip vanishes at α = −asin κ₀, which is −2.01° for the default 0.035. The program's name remains in the program and the value is sent unchanged. Only the page's label and symbol differ.
Figure 4 shows one strip from its side: the angle of attack is the angle between the chord and the strip's own velocity, the lift is perpendicular to that velocity and the drag is along it.
The aspect ratio A of each surface comes from its own span and area. Because v includes ω × r, the loads that depend on the turning rate come out of the same integral: no stability derivative is typed in anywhere. Whether a motion dies away is then a property of a run, not an input. Summed along the span, the strips give the loading of Figure 5.
- Elevator, ailerons, rudder
- The controls of pitch, roll and yaw. Here each changes the lift coefficient of its surface by aτδ, on opposite sides for the ailerons.
The flight is a Lagrangian with virtual work
The airframe and each of its four control surfaces is a rigid body: the displacement u of its centre of mass and the Euler parameters (η, ε) of its rotation. The hinges join them into one assembly. Gravity has a potential, but lift, drag and thrust have none, so they enter by the principle of Lagrange and d'Alembert:
Figure 6 draws these loads at the trimmed start of a flight. In the plane of symmetry they balance there: the forces along x and z and the pitching moment about the centre of mass vanish, which is what the trim (17)–(19) asks. It asks nothing of the side force or of the rolling and yawing moments, which vanish only by symmetry. The page finds the trim of its own copy of the model by the same three laws, and Design lists all six accelerations at it.
The airspeed and turning rate in the body's axes, and the load itself, are unknowns of their own, each with its law. The load's expression is therefore written once, as the laws (13) and (14), and the motion rows read it through F and M instead of repeating it (Figure 7). Written once is not evaluated once: at every instant Newton's method evaluates all the residuals, and their linearization, at each of its iterations, and a DIRK step does so at each of its stages.
The work of the load changes the energy E = T + V of the body:
where the load is the air's and the engine's together. The program solves for the supply as it does for the motion: the work W of the load is an unknown of the march, with the law W′ = F·v + M·ω from what was supplied before each phase, so that (7) is judged on the solution itself. It is the principle of virtual work 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, and plots both sides and their difference.
Longitudinal static stability
The Design view reports one measure of stability, and it is a static one. In the axes of the page, x forward, y to port and z up, a positive pitching moment M_y about the centre of mass turns the nose down. At one operating point, the speed of Fly with no turning rate and the controls neutral, the page changes the angle of attack by ±0.01 rad and takes the central differences of the normal force F_z and of M_y:
- Neutral point
- The point along x about which the aircraft's pitching moment does not change with the angle of attack.
- Static margin
- The distance from the neutral point forward to the centre of mass, divided by the wing's mean chord S/b (Figure 8). It is positive when the centre of mass lies ahead of the neutral point. Then, with the normal force growing with the angle of attack, ∂M_y/∂α > 0 in these axes: a nose-down moment that grows with the angle of attack. This is the condition written C_mα < 0 in the usual convention, where y points to starboard.
- Static and dynamic stability
- A positive static margin states the initial tendency after a small change of the angle of attack, at that operating point. It does not state that the motion which follows dies away. That is dynamic stability, a property of the response in time, and an aircraft of positive static stability can still have an oscillation that grows. The FAA's Pilot's Handbook of Aeronautical Knowledge (FAA-H-8083-25, on the aerodynamics of flight) draws the same distinction. The page therefore concludes nothing about damping from the margin: fly the aircraft and read the result.
Reading a run
What the aircraft does after the first instant is known only from a run. Figure 9 draws the height and the speed of the result selected in Results. The same result is replayed and plotted there with its saved setup.
- Phugoid
- The slow exchange of speed for height of an aircraft disturbed from steady flight. Lanchester's estimate of its period is π√2·V/g, from energy alone, with the lift taken as proportional to the square of the speed. It is quoted under the figure for comparison, not as a property of this model.
Equations and implementation
The flight is five rigid bodies, the airframe and its four control surfaces, written as differential equations of the first order and algebraic laws. The airframe alone has 36 unknowns at each instant and 36 equations to match; each part brings the rows of a rigid body of its own, and its hinge brings its conditions and their reactions. They are read from mechanism % body and mechanism % virtual_work in multibody_dynamics.f90, and from the laws of flight_dynamics.f90.
The unknowns
| Symbol | Count | Meaning |
|---|---|---|
| q = (u, η, ε) | 7 | the displacement of the centre of mass, and the Euler parameters of the rotation |
| v | 7 | the rates of q |
| a | 7 | the rates of v |
| λ, μ, ν | 3 | the reactions that keep η² + |ε|² = 1 |
| V, Ω | 3 + 3 | the airspeed and the turning rate, in the body's axes |
| F, M | 3 + 3 | the force and the moment of the air and the engine, in the body's axes |
The differential equations
The states are q and v, fourteen in all. For each k = 1, …, 7:
The motion rows are the Euler–Lagrange equations with the virtual work of (6). Their terms:
- The Lagrangian L = T − V, with T and V = −m g·u.
- The angular velocity in the body's axes, ω = 2(η v_ε − v_η ε − ε × v_ε).
- The norm's gradient G = ∂c/∂q, where c = η² + |ε|² − 1.
- The weights W_k: the mass m for the three rows of the displacement, and 4 tr(J)/3 for the four of the Euler parameters. They only scale the rows, so that each multiplier pairs with its row as work.
- The generalized force of the load: Q_{1:3} = R F, the force turned into the ground's axes, the columns of R being the body's axes; and Q_{4:7} = 2 Eᵀ M.
The rate d/dt ∂L/∂v_k is expanded in the accelerations a, so the motion rows are algebraic in a.
The algebraic laws
Fifteen rows. First the norm of the Euler parameters, at three levels, which removes the index of the constraint:
Then the airspeed and the turning rate in the body's axes, i = 1, 2, 3:
Then the load, the force and its moment about the centre of mass:
Here dF is the strip load (5), and the controls are the pulses
The initial data and the classical form
Sixteen conditions at t = 0:
so that the aircraft starts flying horizontally, pitched by the trim's θ₀ (17), positive nose up, with ω₀ = 0. Its angle of attack at the start is then θ₀ too.
The program never writes the classical form: it writes the rows of the Lagrangian above. They are equivalent to the thirteen Newton–Euler equations that most textbooks give:
The rotation rows are Euler's equations in the body's axes.
The trim, as an optimization
The flight starts from a state in which three accelerations vanish: forward, vertical and pitch. For an aircraft symmetric about its vertical plane, with no control or event acting yet, that is the state in which nothing accelerates. The program does not guess it. It finds it by the same machinery as any design: a Lagrangian with an objective and laws, made stationary by the design iteration. The design is three numbers, s = (θ₀, δ₀, T): the pitch of the start (16), a constant elevator deflection added to the pulse (15), and the thrust. The Lagrangian lives on the first two steps of the flight, an interval of length Δ:
The objective is the thrust. The laws (18) say that the centre of mass accelerates neither forward nor up, and that the body does not start to pitch, each on average over the two steps. They are three laws for a body of six degrees of freedom. No law is written for the sideways acceleration, the roll or the yaw, and no design is free to meet one: the ailerons, the rudder, the bank and the sideslip are not designs. A converged trim is therefore an equilibrium only where symmetry makes those three vanish of themselves. An aircraft with its centre of mass off the plane of symmetry meets (18) to rounding and still rolls from the first instant. The average over the two steps also takes in whatever the flight's own control pulses do there: a pulse that begins at once shifts the trim, by an amount that changes with the step. An event scheduled within the two steps does not shift the trim; the program flies it at the instant of the march nearest its time. Each is a functional of the state, an integral over the manifold, so its gradient in s costs one reverse sweep, not a finite difference. The bounds (19) keep the elevator within its travel and the thrust positive.
Stationarity reads three ways. In the multipliers it returns the flight's laws and (18). In the state it returns the adjoint equations, one sweep backwards over the two steps. In the design it returns
Started from the untrimmed design s = (0, 0, 800 N), the default aircraft at 50 m/s needs four iterates:
| Iterate | θ₀ (deg) | δ₀ (deg) | T (N) | largest |c| |
|---|---|---|---|---|
| 1 | 0 | 0 | 800 | 1.24 |
| 2 | −0.5146 | 2.8717 | 727.06 | 9.8 × 10⁻⁴ |
| 3 | −0.515090 | 2.873118 | 732.2830 | 8.6 × 10⁻⁸ |
| 4 | −0.515089 | 2.873118 | 732.2830 | 2.5 × 10⁻¹⁴ |
The violation squares at every iterate. That is Newton's method: with three laws in three designs, each step solves the linearized laws exactly. The multipliers are π = (−612.9, −26.7, 9.94), and −π_k is the rate at which the thrust grows when the k-th law asks for one unit of its acceleration instead of zero. The first is close to −m = −611.5 kg, as it should be: one more newton of thrust buys 1/m of forward acceleration, and the rest is the thrust's share in the lift and the moment through the engine's offset. The bounds are not active, so μ = 0. The page solves the same three laws with its own copy of the model, by Newton's method, and shows the result in Design's card of the start and in Figure 6. Flown for 60 s from the trim, the program holds the height and the speed, and the energy changes by 4 × 10⁻⁶ J.
Two remarks. First, three laws in three designs do not by themselves leave a single feasible point: a square nonlinear system can have several roots, a continuum of them, or none. The trim found is locally isolated where the Jacobian of the laws in the designs is nonsingular there, which Results checks in the page’s copy of the model; no global uniqueness is claimed, and another initial guess could converge to another root. Near an isolated root the objective T selects nothing yet. It starts to choose once a fourth design is free, the speed or the angle of climb: then the trim is the cheapest of many steady flights. Second, the angle of attack is not bounded. At this trim it is −0.515°, far from the stall.
Architecture, as the code has it
This card is written from the page’s own definitions, so it cannot drift from them. Its principles are those of the author’s website: 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), on which uncertainty and sensitivity analyses build. This page instantiates only the deterministic physics.
The control surfaces as parts
At tier B each control surface is a rigid body of its own, with the rows (8)–(11) of a body: its place, its Euler parameters, their rates and accelerations, and the norm of its rotation. The airframe is the aircraft less its parts, so the mass, the centre and the inertia of the airframe and its parts recompose those of Part I. A revolute joint along the hinge holds the part to the airframe: its hinge point stays on the airframe's hinge point, and its hinge axis on the airframe's. A servo then states the turn about that axis. With θ the relative turn of the part and δ(t) the commanded deflection (15),
The multiplier λ of the servo's law is its reaction, and gives the hinge moment H. The servo's power P joins the supply of the theorem (7), beside the work of the air. Each flap bears its share of the lift of the strips its control deflects, by thin-airfoil theory from the same hinge chord, and the airframe bears the rest.
Under the rigid servo the airframe and its flaps move as one assembly, so the share moves the hinge moment and not the motion of the whole aircraft. That is why tier B agrees with tier A to the flap's own small first moment about its hinge, and it is also why tier B is worth flying: it tells the hinge moment and the servo's work, which tier A cannot represent. On the default aircraft the air's moment about the elevator's hinge is −4.58 N m at the trim, and the elevator's servo does up to 0.196 J of work at a power up to 0.881 W during its pulse.
The trim (17)–(19) is the same at both tiers. Its laws read the airframe's acceleration, and the trims of the two tiers agree to 1 part in 10⁷. Tier B pitches the airframe about its own centre of mass and turns each flap by the trim's deflection, so the assembly's centre starts 0.28 mm higher than at tier A; uniform gravity makes that a translation of the whole flight.
Three remarks that connect the pieces
- Potential against virtual work. Gravity has a potential, so it enters through L. Lift, drag and thrust have none, so they enter only through Q. That one difference is why the library needed
mechanism % virtual_work, and it is why the energy is not conserved but changed by the load's work (7). - Unknowns, not formulas. V, Ω, F and M are unknowns with laws of their own, not substituted formulas. Substituting them made the expression tree copy the body's rotation into every strip: 5.6 GB and 25 s for ten steps. As unknowns, the same physics takes 0.44 s with the same digits.
- Euler parameters, not Euler angles. The rotation has no singularity at 90 degrees of pitch. The cost is one constraint, c = 0, imposed at three levels (11) with its three reactions λ, μ, ν.
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 |
aircraft | the mass, the centre of mass, the inertia, and each surface's area, span and lift slope |
instant | at each recorded instant: t; place, the centre of mass in the ground's axes; euler, the Euler parameters; speed, |V|; alpha, which is −Vz/|V| in the body's axes and has no unit; energy, E; power, F·v + M·ω |
balance | the energy change, the work of the load and the largest difference between them during the march |
Two quantities are not in the records, and the page does not make them up.
- The aircraft's angle of attack. With x forward, y to port and z up it is α = atan2(−V_z, V_x). The record
alphais −V_z/|V|: the sine of that angle only when the sideslip V_y is zero, and never the angle itself. Since V_x and V_y are not recorded, Results plots the recorded quantity under its own name and converts nothing. Should the program record the airspeed in the body's axes, as three numbers namedairspeed_bodyat each instant, the page plots the angle of attack and reports the sideslip angle from it. - The work of the load at each instant. The program records the power at each instant and the work at the end only. Results rebuilds the curve of the work from the recorded power by the trapezoid rule, and says how its end compares with the program's own figure. Where a result is recorded at a stride of the solver's steps, the two differ, and the page says so. Should the program record a series named
work, the page plots that instead.
Using the page
- Design: pick a patch and a projection. Drag an amber control point. With Mirror on, its partner on the other side follows. Type exact values in the fields under the drawing. The ledger on the right is a browser preview and updates as you drag.
- Fly: set the speed, the thrust and the pulses. Design and Fly together are the setup. Run is offered once every value of the setup passes the program's declaration, and it sends the setup to the machine.
- Results: one result with the setup saved with it, either a flight recorded in this page or a flight run retrieved from the machine by its ID. The page says where the current setup differs from that result’s, and remembers the result you chose when the page is opened again in this browser.
The page reaches the machine through the solver service in the service settings. Without it, Design, the Guide and the recorded result still work. A run of another application on the machine is neither shown nor stopped by this page.