A CgEnvelope extends the Ptable class and represents an aircraft center of gravity envelope. The table data captures the envelopes for different categories (e.g., Normal, or Utility) as well as the forward and aft limits of each envelope. The table can then interpolate the values between the limit points. Here's an example of a Cessna 182B envelope:
new CgEnvelope({
title: `CG envelope`,
inputs: ['category', 'cgLimit', 'weight'],
output: 'arm',
a: [
{p:'normal', a:[
{p:'forward', a:[
{p:0, v:33.5},
{p:2100, v:33.5},
{p:2650, v:40.0},
]},
{p:'aft', a:[
{p:0, v:45.8},
{p:2650, v:45.8},
]},
]},
],
})
In the above example, the category key only accepts 'normal'. A type or modification that supports other categories can add another set of entries. The cgLimit key specifies which limit is being interpolated. Lastly, the weight specifies the weight to interpolate the limit.
An aircraft whose limits differ between takeoff and landing adds an optional phase key, with 'tko' and 'ldg' entries, ahead of cgLimit. The Kodiak oversize tires are the example: they raise the maximum landing weight and publish a Loading Envelope for Landing of their own, while ramp and takeoff keep the standard limits. An envelope that does not vary by phase omits the key and answers every phase with its one set of limits, so the phase an aircraft page asks for never has to be conditional:
new CgEnvelope({
title: `CG envelope`,
inputs: ['category', 'phase', 'cgLimit', 'weight'],
a: [
{p:'normal', a:[
{p:'tko', a:[ {p:'forward', a:[...]}, {p:'aft', a:[...]} ]},
{p:'ldg', a:[ {p:'forward', a:[...]}, {p:'aft', a:[...]} ]},
]},
],
})
Note that the above data could be used with an ordinary Ptable; however, CgEnvelope adds specialized methods for exploring the envelope. Here are some examples:
// get the forward and aft limits at a particular weight
const [fwdArmLimit, aftArmLimit] = envelope.armLimits('normal', weight);
// get the normal category weight limit
const maxWeight = envelope.weightLimits('normal')[1];
// get the category associated with a particular aircraft loading
const cg = new CgPoint(2500, 42);
const cgCategory = envelope.category(cg);
new CgEnvelope(info)
Constructs a new CgEnvelope instance for an aircraft envelope. The input data must have three keys: category, cgLimit, and weight. The category parameter data can have any supported G-load category string. The cgLimit parameter must contain values for both forward and aft strings. The weight parameter can be in any units of weight, but the default Ptable weight units are assumed if it is unspecified in info.inputs. The values can be in any units of length, but the default Ptable arm units are assumed if it is unspecified in info.output. If info.output is not provided, it defaults to 'arm'.
The constructor asserts that the table is well formed:
weight must be the last input key.category parameter must be valid for 'normal' or 'utility'.cgLimit parameter must be valid for both forward and aft.phase must be valid for both 'tko' and 'ldg'.forward and aft entries must match so that interpolation is allowed across the full weight range.infoPtable constructor info parameter. The object must specify the following keys in the inputs property:categoryphase (optional, ahead of cgLimit)cgLimitweightinfo.a array must be provided, and it must contain at least one object entry with a p property corresponding to a G-load category string and an a array property with two object entries. One object must contain a p property with forward and the other with aft. The a properties in theses these entries contain an array of objects for each weight point on the forward or aft CG envelope. The p property contains the weight for the point, and the v property contains the arm.armLimits()armLimits(category, weight, phase)
Return an array containing the interpolated [forward, aft] arm limits at a given G-load category, weight and flight phase. If the weight is outside the forward or aft limt, then the corresponding array element contains a StateVarError instance.
categorycategory is 'normal' but the table has no normal category, 'utility' is used instead.weightphase'tko' or 'ldg', defaulting to 'tko'. An envelope that does not declare the phase input ignores it; one that does must declare the phase asked for.An a array containing the following two elements:
StateVarError instance.StateVarError instance.category()category(cg, phase)
Return the G-load category string for a given CgPoint. If the cg is outside the envelope, return ''.
cgCgPoint instance specifying the weight and arm to query for the category.phase'tko' or 'ldg', defaulting to 'tko'. An envelope that does not declare the phase input ignores it; one that does must declare the phase asked for.A G-load category string.
minFuelUsed()minFuelUsed(category, used, maxUsed, ldgCgAt, step)
Return the least fuel that must be burned for the landing point to lie within the landing envelope, searching upwards from used and never going beyond maxUsed. An envelope that does not declare the phase input charts one envelope for every phase and returns used unchanged.
An envelope with a tighter landing chart can make the maximum landing weight the lesser constraint: its forward limit falls with weight faster than burning fuel moves the CG forward, so a load that is legal for takeoff can need fuel burned before it is legal to land. That assumes burning fuel moves the CG toward the limit it is outside of, which holds where the fuel is aft of the CG.
categoryusedmaxUsedldgCgAtfn(used) returning the landing CgPoint with that much fuel burned.stepThe fuel burn, in the caller's fuel units.
pctArm()pctArm(category, cg, phase)
Return the fraction of the span between the arm limits for a given weight and arm in cg.
The returned value is 0 if the cg is at the forward limit and 1 if the cg is at the aft limit.
categoryarmLimits(), 'normal' falls back to 'utility' if the table has no normal category.cgCgPoint instance or an object with both weight and arm properties to query for the arm limits. phase'tko' or 'ldg', defaulting to 'tko'. An envelope that does not declare the phase input ignores it; one that does must declare the phase asked for.A number or StateVarError instance. The value is 0 if the cg is at the forward limit and 1 if the cg is at the aft limit. If the cg is outside the arm limits then values less than 0 or greater than one is returned. If the cg is outside the weight limits, then a StateVarError instance is returned.
pctWeight()pctWeight(category, cg, bew, phase)
Return the fraction of the span between the weight limits for a given weight and arm in cg. The lower weight limit is the maximum of the lower weight limit in the table data for the category and the basic empty weight specified by bew. The returned value is 0 if the cg is at the lower weight limit and 1 if the cg is at the upper weight limit.
categoryarmLimits(), 'normal' falls back to 'utility' if the table has no normal category.cgCgPoint instance or an object with both weight and arm properties to query for the weight limits. bewbew. phase'tko' or 'ldg', defaulting to 'tko'. An envelope that does not declare the phase input ignores it; one that does must declare the phase asked for.A number whose value is 0 if the cg is at the lower weight limit and 1 if the cg is at the upper limit.
points()points(category, bew, phase)
Return an array of CgPoint instances that represent the envelope for a category and flight phase. bew is the lower weight cutoff. The points() method is used to draw the envelope. The returned array is ordered such that drawing lines between successive CgPoint instances and connecting the final point with the first will draw a CG envelope diagram.
categorybewbew. phase'tko' or 'ldg', defaulting to 'tko'. An envelope that does not declare the phase input ignores it; one that does must declare the phase asked for.An array CgPoint instances representing a center of gravity envelope diagram.
weightLimits()weightLimits(category, phase)
Return an array containing the [lower, upper] weight limits at a given G-load category and flight phase. The lower weight limit is the lowest weight parameter value in the table for the category. It may be above or below the basic empty weight of the aircraft.
categoryarmLimits(), 'normal' falls back to 'utility' if the table has no normal category.phase'tko' or 'ldg', defaulting to 'tko'. An envelope that does not declare the phase input ignores it; one that does must declare the phase asked for.An a array containing the following two elements:
hasPhasetrue when the table declares the phase input, i.e. when its limits differ between takeoff and landing. The weight & balance diagram uses it to decide whether to draw a second, dashed landing envelope.
maxTowThe maximum takeoff weight: The maximum weight in any category.