jsbsim.js
Version:
JSBSim flight dynamics model ported to JavaScript
216 lines (198 loc) • 9.47 kB
text/xml
<runscript xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://jsbsim.sf.net/JSBSimScript.xsd"
name="Short S.23 cruise test">
<description>
This run is for testing the Short S.23 Sperry autopilot and
cruise performance at 143kt indicated at 3000ft.
</description>
<use aircraft="Short_S23" initialize="reset01"/>
<run start="0.0" end="300" dt="0.00833333">
<!--
"The normally quoted cruising speed was 143 knots at 510 bhp.
per engine, dropping to an economic cruising speed of 128 knots at
10 000 ft." ([Cassidy:2004:FE], page 160)
"Fuel consumptions varied between individual aircraft. In
practice, 'normal' four engine fuel consumptions ranged from as
little as 107.5 gal. per hr. (484 litres per hr.), to 119.9
gal. per hr. (540 litre per hr.). A good average consumption was
considered to be 115 gal. per hr. (518 litre per hr.). The
upper limit of acceptable consumption was set at 141 gal. per
hr. (631 litre per hr.), and anything over this amount was
considered to be excessive. These consumption figures appear to
be better than the manufacturer's figure of a maximum of 0,67
pints (0.38 litres) per hhp. per hour." ([Cassidy:2004:FE], page 168)
That is, the average per-engine fuel consumtion in pounds per second
could vary between 0.0569 to 0.0634 with 0.0746 as the upper limit.
Cylinder head temperature should be below 190 degC / 374 degF.
Expected EGT is unknown.
-->
<property value="0">simulation/notify-time-trigger</property>
<event name="Initialization 1">
<description>Configure for flight at 40500 lbs</description>
<condition>
simulation/sim-time-sec GE 0.0
</condition>
<notify/>
<set name="fcs/fuel-system/mark" value="1.0"/> <!-- Mark I fuel system. -->
<set name="inertia/pointmass-weight-lbs[5]" value="1800.0"/>
<set name="inertia/pointmass-weight-lbs[6]" value="1945.0"/>
<set name="inertia/pointmass-weight-lbs[7]" value="1500.0"/>
<set name="inertia/pointmass-weight-lbs[8]" value="0.0"/>
<set name="inertia/pointmass-weight-lbs[9]" value="1300.0"/>
</event>
<event name="Initialization 2">
<description>Set the fuel and test cocks</description>
<condition>
simulation/sim-time-sec GE 0.0
</condition>
<notify/>
<set name="fcs/fuel-system/left-tank-cock-cmd-norm" value="1.0"/>
<set name="fcs/fuel-system/right-tank-cock-cmd-norm" value="1.0"/>
<set name="fcs/fuel-system/balance-cock-cmd-norm" value="1.0"/>
<set name="fcs/fuel-system/left-test-cock-cmd-norm" value="1.0"/>
<set name="fcs/fuel-system/center-test-cock-cmd-norm" value="1.0"/>
<set name="fcs/fuel-system/right-test-cock-cmd-norm" value="1.0"/>
</event>
<event name="Initialization 3">
<description>Set the up the electrical system</description>
<condition>
simulation/sim-time-sec GE 0.0
</condition>
<notify/>
<set name="electrical/main-switchbox/switch-cmd-norm[0]" value="1.0"/>
<set name="electrical/main-switchbox/switch-cmd-norm[1]" value="1.0"/>
<set name="electrical/main-switchbox/switch-cmd-norm[2]" value="1.0"/>
<set name="electrical/main-switchbox/switch-cmd-norm[3]" value="1.0"/>
<set name="electrical/main-switchbox/switch-cmd-norm[4]" value="1.0"/>
<set name="electrical/main-switchbox/switch-cmd-norm[5]" value="1.0"/>
</event>
<event name="Initialization 4">
<description>Set the engine controls</description>
<condition>
simulation/sim-time-sec GE 0.0
</condition>
<notify/>
<set name="fcs/advance-cmd-norm[0]" value="1.0"/>
<set name="fcs/advance-cmd-norm[1]" value="1.0"/>
<set name="fcs/advance-cmd-norm[2]" value="1.0"/>
<set name="fcs/advance-cmd-norm[3]" value="1.0"/>
<set name="fcs/mixture-cmd-norm[0]" value="0.23"/>
<set name="fcs/mixture-cmd-norm[1]" value="0.23"/>
<set name="fcs/mixture-cmd-norm[2]" value="0.23"/>
<set name="fcs/mixture-cmd-norm[3]" value="0.23"/>
<set name="fcs/throttle-cmd-norm[0]" value="0.85"/>
<set name="fcs/throttle-cmd-norm[1]" value="0.85"/>
<set name="fcs/throttle-cmd-norm[2]" value="0.85"/>
<set name="fcs/throttle-cmd-norm[3]" value="0.85"/>
<set name="propulsion/magneto_cmd" value="3"/>
<set name="propulsion/set-running" value="-1"/>
</event>
<event name="Trim">
<condition>
simulation/sim-time-sec GE 1.0
</condition>
<set name="simulation/do_simple_trim" value="1"/>
<set name="propulsion/set-running" value="-1"/>
<notify>
<property>velocities/u-aero-fps</property>
<property>velocities/v-aero-fps</property>
<property>velocities/w-aero-fps</property>
<property>attitude/psi-rad</property>
<property>attitude/theta-rad</property>
<property>attitude/phi-rad</property>
<property>position/h-agl-ft</property>
<property>accelerations/pdot-rad_sec2</property>
<property>accelerations/qdot-rad_sec2</property>
<property>accelerations/rdot-rad_sec2</property>
<property>fcs/throttle-cmd-norm[0]</property>
<property>propulsion/engine[0]/thrust-lbs</property>
<property>propulsion/engine[0]/engine-rpm</property>
<property>propulsion/engine[0]/boost-psi</property>
<property>propulsion/engine[0]/power-hp</property>
<property>fcs/throttle-cmd-norm[1]</property>
<property>propulsion/engine[1]/thrust-lbs</property>
<property>propulsion/engine[1]/engine-rpm</property>
<property>propulsion/engine[1]/boost-psi</property>
<property>propulsion/engine[1]/power-hp</property>
<property>fcs/throttle-cmd-norm[2]</property>
<property>propulsion/engine[2]/thrust-lbs</property>
<property>propulsion/engine[2]/engine-rpm</property>
<property>propulsion/engine[2]/boost-psi</property>
<property>propulsion/engine[2]/power-hp</property>
<property>fcs/throttle-cmd-norm[3]</property>
<property>propulsion/engine[3]/thrust-lbs</property>
<property>propulsion/engine[3]/engine-rpm</property>
<property>propulsion/engine[3]/boost-psi</property>
<property>propulsion/engine[3]/power-hp</property>
<property>velocities/p-rad_sec</property>
<property>velocities/q-rad_sec</property>
<property>velocities/r-rad_sec</property>
<property>fcs/elevator-cmd-norm</property>
<property>fcs/aileron-cmd-norm</property>
<property>fcs/rudder-cmd-norm</property>
<property>fcs/elevator-pos-norm</property>
<property>fcs/right-aileron-pos-norm</property>
<property>fcs/rudder-pos-norm</property>
<property>inertia/cg-x-in</property>
<property>inertia/weight-lbs</property>
</notify>
</event>
<event name="Enable AP">
<description>Enable the roll channel of the autopilot.</description>
<condition>
simulation/sim-time-sec GT 1.0
</condition>
<set name="fcs/throttle-cmd-norm[0]" value="0.765"/>
<set name="fcs/throttle-cmd-norm[1]" value="0.765"/>
<set name="fcs/throttle-cmd-norm[2]" value="0.765"/>
<set name="fcs/throttle-cmd-norm[3]" value="0.765"/>
<!-- Close the speed valves of the unneeded channels. -->
<set name="sperry-autopilot/heading-speed-valve-cmd-norm" value="0.0"/>
<set name="sperry-autopilot/pitch-speed-valve-cmd-norm" value="0.0"/>
<!-- set name="sperry-autopilot/roll-speed-valve-cmd-norm" value="0.0"/-->
<!-- Set the reference values. -->
<set name="sperry-autopilot/roll-reference-deg" value="0.0"/>
<!-- Enable the AP. -->
<set name="sperry-autopilot/enabled-cmd-norm" value="1.0"/>
<notify/>
</event>
<event name="Time Notify" type="FG_DELTA" persistent="true">
<description>Output message at 5 seconds intervals</description>
<condition>
simulation/sim-time-sec GE simulation/notify-time-trigger
</condition>
<notify>
<property>position/h-agl-ft</property>
<property>velocities/vc-kts</property>
<property>velocities/u-aero-fps </property>
<property>velocities/v-aero-fps </property>
<property>velocities/w-aero-fps </property>
<property>propulsion/engine[0]/engine-rpm</property>
<property>propulsion/engine[0]/boost-psi</property>
<property>propulsion/engine[0]/power-hp</property>
<property>propulsion/engine[1]/engine-rpm</property>
<property>propulsion/engine[1]/boost-psi</property>
<property>propulsion/engine[1]/power-hp</property>
<property>propulsion/engine[2]/engine-rpm</property>
<property>propulsion/engine[2]/boost-psi</property>
<property>propulsion/engine[2]/power-hp</property>
<property>propulsion/engine[3]/engine-rpm</property>
<property>propulsion/engine[3]/boost-psi</property>
<property>propulsion/engine[3]/power-hp</property>
<property>propulsion/engine[3]/egt-degF</property>
<property>propulsion/engine[3]/fuel-flow-rate-pps</property>
<property>attitude/phi-rad</property>
<property>attitude/theta-rad</property>
<property>attitude/psi-rad</property>
<property>hydro/height-agl-ft</property>
<property>hydro/v-kt</property>
<property>hydro/pitch-deg</property>
<property>hydro/roll-deg</property>
<property>hydro/beta-deg</property>
</notify>
<set name="simulation/notify-time-trigger" value="5" type="FG_DELTA"/>
</event>
</run>
</runscript>