4 very rough model of Lycoming engine built in PA-28 Cherokee
5 Only "AD" characteristics are modelled, no transient behaviour,
6 meaning that there is no time delay, engine acts as gain only.
12 "Aerodynamics, Aeronautics and Flight Mechanics",
13 John Wiley & Sons,1995, ISBN 0-471-11087-6
15 any suggestions, corrections, aditional data, flames, everything to
20 This source is not checked in this configuration in any way.
30 #include "ls_constants.h"
31 #include "ls_generic.h"
32 #include "ls_cockpit.h"
33 #include "ls_sim_control.h"
39 void cherokee_engine( SCALAR dt, int init )
43 dP = (180.0-117.0)*745.7, // in Wats
44 dn = (2700.0-2350.0)/60.0, // d_rpm (I mean d_rps, in seconds)
45 D = 6.17*0.3048, // propeller diameter
46 dPh = (58.0-180.0)*745.7, // change of power as f-cn of height
51 J, // advance ratio (ratio of horizontal speed to speed of propeller's tip)
52 eta, // iskoristivost elise
57 /* copied from navion_engine.c */
58 if (init || sim_control_.sim_type != cockpit)
59 Throttle[3] = Throttle_pct;
61 /*assumption -> 0.0 <= Throttle[3] <=1.0 */
62 P = fabs(Throttle[3])*180.0*745.7; /*180.0*745.5 ->max avail power in W */
63 n = dn/dP*(P-117.0*745.7) + 2350.0/60.0;
66 V = (V_rel_wind < 10.0*0.3048 ? 10.0 : V_rel_wind*0.3048);
77 eta = (0.8-0.55)/(.7-.3)*(J-0.3) + 0.55;
79 eta = (0.6-0.8)/(1.0-0.85)*(J-0.85) + 0.8;
82 eta = (J < 0.7 ? ((0.8-0.55)/(.7-.3)*(J-0.3) + 0.55) :
83 (J > 0.85 ? ((0.6-0.8)/(1.0-0.85)*(J-0.85) + 0.8) : 0.8));
87 /* power on Altitude (I mean Altitude, not Attitude...)*/
89 H = Altitude/0.3048; /* H == Altitude in [m] */
91 P *= (dPh/dH*H + 180.0*745.7)/(180.0*745.7);
93 T = eta*P/V; /* T in N (Thrust in Newtons) */
95 /*assumption: Engine's line of thrust passes through cg */
97 F_X_engine = T*0.2248; /* F_X_engine in lb */
101 /* copied from navion_engine.c */
102 Throttle_pct = Throttle[3];