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: 'cgArm',
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.
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.limits(weight);
// get the normal category weight limit
const maxWeight = envelope.weightLimit('normal');
// 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 cgArm units are assumed if it is unspecified in info.output.
infoPtable constructor info parameter. The object must specify the following keys in the inputs property:categorycgLimitweightinfo.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)
Return an array containing the interpolated [forward, aft] arm limits at a given G-load category and weight. If the weight is outside the forward or aft limt, then the corresponding array element contains a StateVarError instance.
categoryweightAn a array containing the following two elements:
StateVarError instance.StateVarError instance.category()category(cg)
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.A G-load category string.
pctArm()pctArm(category, cg)
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 forward limit.
categorycgCgPoint instance or an object with both weight and arm properties to query for the arm limits.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 forward 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)
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.
categorycgCgPoint instance or an object with both weight and arm properties to query for the weight limits. bewbew.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)
Return an array of CgPoint instances that represent the envelope for a category. 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.
categorycgCgPoint instance or an object with both weight and arm properties to query for the weight limits. bewbew.An array CgPoint instances representing a center of gravity envelope diagram.
weightLimit (category) {
weightLimits()weightLimits(category)
Return an array containing the [lower, upper] weight limits at a given G-load category. 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.
categoryAn a array containing the following two elements:
maxTowThe maximum takeoff weight: The maximum weight in any category.