Skip to content

Commit

Permalink
Separate thrust limit between aircraft
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueberryKing committed Nov 24, 2024
1 parent 929e385 commit 2292049
Show file tree
Hide file tree
Showing 10 changed files with 134 additions and 106 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const engineModelParams: EngineModelParameters = {
maxThrust: 27120,
numberOfEngines: 2,
fuelBurnFactor: 1.0,
n1ClimbLimit: [
cn1ClimbLimit: [
[0, 2000, 5000, 8000, 12000, 15000, 17000, 20000, 24000, 27000, 31000, 35000, 39000, 41500],
[-54.0, 71.8, 73.6, 75.5, 76.8, 78.1, 78.9, 80.1, 81.5, 81.6, 83.0, 83.6, 83.7, 83.3],
[-50.0, 72.5, 74.3, 76.2, 77.5, 78.8, 79.6, 80.9, 82.2, 82.4, 83.8, 84.4, 84.5, 84.0],
Expand Down
94 changes: 47 additions & 47 deletions fbw-a32nx/src/systems/fmgc/src/flightplanning/A380AircraftConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,37 +61,37 @@ const engineModelParams: EngineModelParameters = {
* @param j col index (pressure altitude, ft)
* @returns Corrected N1 (CN1)
*/
n1ClimbLimit: [
cn1ClimbLimit: [
[0, 2000, 5000, 8000, 12000, 15000, 17000, 20000, 24000, 27000, 31000, 35000, 39000, 41500],
[-54.0, 71.8, 73.6, 75.5, 76.8, 78.1, 78.9, 80.1, 81.5, 81.6, 83.0, 83.6, 83.7, 83.3],
[-50.0, 72.5, 74.3, 76.2, 77.5, 78.8, 79.6, 80.9, 82.2, 82.4, 83.8, 84.4, 84.5, 84.0],
[-46.0, 73.1, 75.0, 76.9, 78.2, 79.5, 80.3, 81.6, 83.0, 83.1, 84.5, 85.1, 85.3, 84.8],
[-42.0, 73.8, 75.6, 77.6, 78.9, 80.2, 81.0, 82.3, 83.7, 83.8, 85.3, 85.9, 86.0, 85.5],
[-38.0, 74.4, 76.3, 78.2, 79.6, 80.9, 81.7, 83.0, 84.4, 84.6, 86.0, 86.6, 86.7, 86.3],
[-34.0, 75.0, 76.9, 78.9, 80.3, 81.6, 82.4, 83.7, 85.1, 85.3, 86.7, 87.3, 87.5, 87.0],
[-30.0, 75.7, 77.6, 79.6, 80.9, 82.2, 83.1, 84.4, 85.8, 86.0, 87.5, 88.1, 88.2, 87.7],
[-26.0, 76.3, 78.2, 80.2, 81.6, 82.9, 83.8, 85.1, 86.5, 86.7, 88.2, 88.8, 88.9, 88.4],
[-22.0, 76.9, 78.8, 80.9, 82.2, 83.6, 84.4, 85.8, 87.2, 87.4, 88.9, 89.5, 89.6, 89.1],
[-18.0, 77.5, 79.5, 81.5, 82.9, 84.2, 85.1, 86.5, 87.9, 88.1, 89.6, 90.2, 90.0, 89.5],
[-14.0, 78.1, 80.1, 82.1, 83.5, 84.9, 85.8, 87.1, 88.6, 88.8, 90.3, 90.0, 89.2, 88.7],
[-10.0, 78.7, 80.7, 82.8, 84.2, 85.6, 86.4, 87.8, 89.3, 89.5, 91.0, 89.2, 88.4, 87.9],
[-6.0, 79.3, 81.3, 83.4, 84.8, 86.2, 87.1, 88.5, 90.0, 90.1, 91.1, 88.5, 87.7, 87.1],
[-2.0, 79.9, 81.9, 84.0, 85.5, 86.8, 87.7, 89.1, 90.6, 90.8, 90.2, 87.7, 86.9, 86.4],
[2.0, 80.5, 82.5, 84.6, 86.1, 87.5, 88.4, 89.8, 91.3, 90.3, 89.5, 87.0, 86.2, 85.6],
[6.0, 81.1, 83.1, 85.3, 86.7, 88.1, 89.0, 90.4, 90.5, 89.5, 88.8, 86.3, 85.5, 84.9],
[10.0, 81.6, 83.7, 85.9, 87.3, 88.7, 89.7, 90.0, 89.6, 88.7, 88.1, 85.6, 84.8, 84.2],
[14.0, 82.2, 84.3, 86.5, 87.9, 89.4, 89.3, 89.1, 88.7, 87.9, 87.5, 84.8, 83.9, 83.3],
[18.0, 82.8, 84.9, 87.1, 88.5, 88.6, 88.4, 88.3, 87.9, 87.2, 86.8, 86.8, 86.8, 86.8],
[22.0, 83.4, 85.5, 86.9, 88.0, 87.8, 87.7, 87.5, 87.2, 86.5, 86.1, 86.1, 86.1, 86.1],
[26.0, 83.9, 85.7, 86.2, 87.2, 87.1, 87.0, 86.8, 86.5, 85.8, 85.4, 85.4, 85.4, 85.4],
[30.0, 84.5, 84.9, 85.4, 86.5, 86.4, 86.3, 86.1, 85.8, 85.1, 85.1, 85.1, 85.1, 85.1],
[34.0, 83.8, 84.2, 84.7, 85.8, 85.7, 85.6, 85.5, 85.1, 85.1, 85.1, 85.1, 85.1, 85.1],
[38.0, 83.0, 83.4, 83.9, 85.1, 85.0, 84.9, 84.8, 84.8, 84.8, 84.8, 84.8, 84.8, 84.8],
[42.0, 82.2, 82.6, 83.1, 84.4, 84.4, 84.3, 84.3, 84.3, 84.3, 84.3, 84.3, 84.3, 84.3],
[46.0, 81.4, 81.8, 82.4, 83.7, 83.7, 83.7, 83.7, 83.7, 83.7, 83.7, 83.7, 83.7, 83.7],
[50.0, 80.6, 81.1, 81.6, 83.0, 83.0, 83.0, 83.0, 83.0, 83.0, 83.0, 83.0, 83.0, 83.0],
[54.0, 79.9, 80.4, 80.4, 80.4, 80.4, 80.4, 80.4, 80.4, 80.4, 80.4, 80.4, 80.4, 80.4],
[58.0, 79.2, 79.2, 79.2, 79.2, 79.2, 79.2, 79.2, 79.2, 79.2, 79.2, 79.2, 79.2, 79.2],
[-54, 82.6, 84.6, 86.8, 88.3, 89.7, 90.7, 92.1, 93.7, 93.8, 95.4, 97.1, 99.1, 100.5],
[-50, 82.6, 84.6, 86.8, 88.3, 89.7, 90.7, 92.1, 93.7, 93.8, 95.4, 97.1, 99.1, 100.5],
[-46, 82.6, 84.6, 86.8, 88.3, 89.7, 90.7, 92.1, 93.7, 93.8, 95.4, 97.1, 99.1, 100.5],
[-42, 82.6, 84.6, 86.8, 88.3, 89.7, 90.7, 92.1, 93.7, 93.8, 95.4, 97.1, 99.1, 100.5],
[-38, 82.6, 84.6, 86.8, 88.3, 89.7, 90.7, 92.1, 93.7, 93.8, 95.4, 97.1, 99.1, 100.5],
[-34, 82.6, 84.6, 86.8, 88.3, 89.7, 90.7, 92.1, 93.7, 93.8, 95.4, 97.1, 99.1, 100.5],
[-30, 82.6, 84.6, 86.8, 88.3, 89.7, 90.7, 92.1, 93.7, 93.8, 95.4, 97.1, 99.1, 100.5],
[-26, 82.6, 84.6, 86.8, 88.3, 89.7, 90.7, 92.1, 93.7, 93.8, 95.4, 97.1, 99.1, 100.5],
[-22, 82.6, 84.6, 86.8, 88.3, 89.7, 90.7, 92.1, 93.7, 93.8, 95.4, 97.1, 99.1, 100.5],
[-18, 82.6, 84.6, 86.8, 88.3, 89.7, 90.7, 92.1, 93.7, 93.8, 95.4, 97.1, 99.1, 100.5],
[-14, 82.6, 84.6, 86.8, 88.3, 89.7, 90.7, 92.1, 93.7, 93.8, 95.4, 95.6, 97.2, 98.4],
[-10, 82.6, 84.6, 86.8, 88.3, 89.7, 90.7, 92.1, 93.7, 93.8, 95.4, 94.1, 95.4, 96.3],
[-6, 82.6, 84.6, 86.8, 88.3, 89.7, 90.7, 92.1, 93.7, 93.8, 95.4, 92.6, 93.6, 94.2],
[-2, 82.6, 84.6, 86.8, 88.3, 89.7, 90.7, 92.1, 93.7, 93.8, 94.0, 91.2, 91.7, 92.1],
[2, 82.6, 84.6, 86.8, 88.3, 89.7, 90.7, 92.1, 93.7, 92.5, 92.6, 89.7, 89.9, 90.0],
[6, 82.6, 84.6, 86.8, 88.3, 89.7, 90.7, 92.1, 92.3, 91.2, 91.2, 88.2, 88.0, 87.9],
[10, 82.6, 84.6, 86.8, 88.3, 89.7, 90.7, 90.8, 90.9, 89.9, 89.8, 86.7, 86.2, 85.8],
[14, 82.6, 84.6, 86.8, 88.3, 89.7, 89.4, 89.6, 89.6, 88.6, 88.3, 85.2, 84.3, 83.7],
[18, 82.6, 84.6, 86.8, 88.3, 88.5, 88.2, 88.3, 88.2, 87.2, 86.9, 83.8, 82.5, 81.7],
[22, 82.6, 84.6, 85.6, 87.1, 87.3, 87.0, 87.0, 86.8, 85.9, 85.5, 82.3, 80.7, 79.6],
[26, 82.6, 84.6, 84.5, 85.9, 86.0, 85.8, 85.7, 85.5, 84.6, 84.1, 80.8, 78.8, 77.5],
[30, 82.6, 83.4, 83.3, 84.7, 84.8, 84.6, 84.4, 84.1, 83.3, 82.7, 79.3, 77.0, 75.4],
[34, 81.4, 82.1, 82.1, 83.5, 83.5, 83.3, 83.2, 82.7, 81.9, 81.3, 77.9, 75.1, 73.3],
[38, 80.2, 80.8, 80.9, 82.3, 82.3, 82.1, 81.9, 81.4, 80.6, 79.9, 76.4, 73.3, 71.2],
[42, 79.0, 79.6, 79.7, 81.1, 81.1, 80.9, 80.6, 80.0, 79.3, 78.5, 74.9, 71.4, 69.1],
[46, 77.8, 78.3, 78.5, 79.9, 79.8, 79.7, 79.3, 78.6, 78.0, 77.1, 73.4, 69.6, 67.0],
[50, 76.6, 77.0, 77.3, 78.7, 78.6, 78.5, 78.1, 77.3, 76.7, 75.6, 72.0, 67.8, 64.9],
[54, 75.4, 75.7, 76.2, 77.5, 77.3, 77.2, 76.8, 75.9, 75.3, 74.2, 70.5, 65.9, 62.9],
[58, 74.2, 74.5, 75.0, 76.3, 76.1, 76.0, 75.5, 74.5, 74.0, 72.8, 69.0, 64.1, 60.8],
],
/**
* Table 1502 - CN2 vs CN1 @ Mach 0, 0.2, 0.9
Expand Down Expand Up @@ -164,23 +164,23 @@ const engineModelParams: EngineModelParameters = {
[0, 0.015, -0.15, 0, 0, 0, 0, 0, 0, 0, 0],
[20, 0.1286, -0.008, 0.015, 0.0337152, -0.0207408, -0.0447408, -0.0684924, -0.2470092, -0.3784788, -0.5864604],
[25, 0.155, 0.0236, 0.018, 0.0364848, -0.0115116, -0.0318852, -0.0503988, -0.1815936, -0.3194448, -0.5268336],
[30.0, 0.16, 0.16, 0.02, 0.039, 0.018, -0.01, -0.02, -0.107, -0.195, -0.428],
[35.0, 0.315, 0.151, 0.093, 0.055, 0.045, 0.013, -0.002, -0.083, -0.164, -0.394],
[40.0, 0.396, 0.195, 0.149, 0.083, 0.078, 0.043, 0.03, -0.051, -0.121, -0.342],
[45.0, 0.472, 0.3, 0.188, 0.135, 0.116, 0.09, 0.06, -0.012, -0.069, -0.275],
[50.0, 0.543, 0.373, 0.254, 0.19, 0.159, 0.17, 0.095, 0.033, -0.01, -0.196],
[55.0, 0.611, 0.448, 0.324, 0.231, 0.22, 0.22, 0.16, 0.085, 0.055, -0.107],
[60.0, 0.714, 0.528, 0.402, 0.28, 0.265, 0.25, 0.245, 0.14, 0.124, -0.012],
[65.0, 0.792, 0.615, 0.489, 0.35, 0.32, 0.3, 0.29, 0.25, 0.196, 0.087],
[70.0, 0.88, 0.712, 0.586, 0.4, 0.36, 0.36, 0.35, 0.34, 0.267, 0.185],
[75.0, 0.982, 0.821, 0.695, 0.45, 0.42, 0.4, 0.38, 0.41, 0.35, 0.281],
[80.0, 1.092, 0.941, 0.811, 0.55, 0.47, 0.44, 0.44, 0.47, 0.45, 0.38],
[85.0, 1.23, 1.07, 0.932, 0.65, 0.57, 0.48, 0.52, 0.53, 0.51, 0.44],
[90.0, 1.388, 1.206, 1.049, 0.75, 0.68, 0.55, 0.6, 0.58, 0.57, 0.52],
[95.0, 1.538, 1.34, 1.153, 0.875, 0.75, 0.6, 0.659, 0.65, 0.62, 0.57],
[100.0, 1.63, 1.465, 1.229, 0.95, 0.8, 0.7, 0.72, 0.68, 0.67, 0.63],
[105.0, 1.655, 1.488, 1.258, 1.03, 0.859, 0.8, 0.8, 0.73, 0.72, 0.69],
[110.0, 1.671, 1.503, 1.283, 1.1, 0.935, 0.9, 0.9, 0.763, 0.74, 0.72],
[30.0, 0.16, 0.16, 0.02, 0.039, 0.01, -0.01, -0.02, -0.107, -0.195, -0.428],
[35.0, 0.315, 0.151, 0.093, 0.055, 0.03, 0.013, -0.002, -0.083, -0.164, -0.394],
[40.0, 0.396, 0.195, 0.149, 0.07, 0.043, 0.05, 0.03, -0.051, -0.121, -0.342],
[45.0, 0.472, 0.3, 0.188, 0.11, 0.07, 0.1, 0.06, -0.012, -0.069, -0.275],
[50.0, 0.543, 0.373, 0.254, 0.13, 0.125, 0.16, 0.11, 0.033, -0.01, -0.196],
[55.0, 0.611, 0.448, 0.324, 0.18, 0.155, 0.21, 0.21, 0.085, 0.055, -0.107],
[60.0, 0.714, 0.528, 0.402, 0.25, 0.165, 0.22, 0.26, 0.15, 0.124, -0.012],
[65.0, 0.792, 0.615, 0.489, 0.32, 0.21, 0.23, 0.28, 0.27, 0.196, 0.087],
[70.0, 0.88, 0.712, 0.586, 0.38, 0.28, 0.235, 0.31, 0.34, 0.267, 0.184],
[75.0, 0.982, 0.821, 0.695, 0.43, 0.39, 0.3, 0.32, 0.36, 0.39, 0.27],
[80.0, 1.092, 0.941, 0.811, 0.55, 0.45, 0.4, 0.38, 0.38, 0.43, 0.37],
[85.0, 1.23, 1.07, 0.932, 0.66, 0.57, 0.48, 0.53, 0.48, 0.48, 0.45],
[90.0, 1.388, 1.206, 1.049, 0.75, 0.68, 0.55, 0.61, 0.58, 0.54, 0.59],
[95.0, 1.538, 1.34, 1.153, 0.875, 0.75, 0.6, 0.659, 0.65, 0.6, 0.61],
[100.0, 1.603, 1.465, 1.229, 0.95, 0.8, 0.7, 0.72, 0.7, 0.62, 0.66],
[105.0, 1.655, 1.488, 1.258, 1.03, 0.859, 0.8, 0.8, 0.74, 0.63, 0.68],
[110.0, 1.671, 1.503, 1.283, 1.1, 0.935, 0.9, 0.9, 0.77, 0.65, 0.69],
],
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ export interface EngineModelParameters {
fuelBurnFactor: number;

/**
* Maximum N1 in CLB thrust
* Maximum corrected N1 in CLB thrust
* @param i row index (tat) in steps of 4°C
* @param j col index (pressure altitude, ft)
* @returns Corrected N1 (CN1)
*/
n1ClimbLimit: readonly (readonly number[])[];
cn1ClimbLimit: readonly (readonly number[])[];

/**
* Table 1502 - CN2 vs CN1 @ Mach 0, 0.2, 0.9
Expand Down
17 changes: 9 additions & 8 deletions fbw-a32nx/src/systems/fmgc/src/guidance/vnav/EngineModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,24 +158,25 @@ export class EngineModel {
return uncorrectedThrust / delta2;
}

static getIdleN1(parameters: EngineModelParameters, altitude: Feet, mach: Mach, tropoAltitude: Feet): number {
static getIdleCorrectedN1(
parameters: EngineModelParameters,
altitude: Feet,
mach: Mach,
tropoAltitude: Feet,
): number {
const delta = Common.getDelta(altitude, altitude > tropoAltitude);
const iap = 1 / delta;

const theta = Common.getTheta(altitude, 0, altitude > tropoAltitude);
const theta2 = Common.getTheta2(theta, mach);

const lowMachCn2 = EngineModel.tableInterpolation(parameters.table1503, 0, iap);
const highMachCn2 = EngineModel.tableInterpolation(parameters.table1504, 0, iap);

const cn2 = Common.interpolate(mach, 0, 0.9, lowMachCn2, highMachCn2);
const cn1 = EngineModel.tableInterpolation(parameters.table1502, cn2, mach);

const n1 = cn1 * Math.sqrt(theta2);
return n1;
return cn1;
}

static getClimbThrustN1(parameters: EngineModelParameters, altitude: Feet, totalAirTemperature: number) {
return EngineModel.tableInterpolation(parameters.n1ClimbLimit, totalAirTemperature, altitude);
static getClimbThrustCorrectedN1(parameters: EngineModelParameters, altitude: Feet, totalAirTemperature: number) {
return EngineModel.tableInterpolation(parameters.cn1ClimbLimit, totalAirTemperature, altitude);
}
}
Loading

0 comments on commit 2292049

Please sign in to comment.