1 #ifndef _PISTONENGINE_HPP
2 #define _PISTONENGINE_HPP
8 // Initializes an engine from known "takeoff" parameters.
9 PistonEngine(float power, float spd);
11 void setThrottle(float throttle);
12 void setMixture(float mixture);
14 // Calculates power output and fuel flow, based on a given
15 // throttle setting (0-1 corresponding to the fraction of
16 // "available" manifold pressure), mixture (fuel flux per rpm,
17 // 0-1, where 1 is "max rich", or a little bit more than needed
18 // for rated power at sea level)
19 void calc(float density, float speed,
20 float* powerOut, float* fuelFlowOut);
23 float _P0; // reference power setting
24 float _omega0; // " engine speed
25 float _rho0; // " manifold air density
26 float _f0; // "ideal" fuel flow at P0/omega0
27 float _mixCoeff; // fuel flow per omega at full mixture
35 #endif // _PISTONENGINE_HPP