<?xml version="1.0" encoding="ISO-8859-1"?>

<!-- Short Stirling BARANGER Emmanuel (2010) 
            updated StuartC (2012)
            Updated baranger Emmanuel (03/2020)
            Updated baranger Emmanuel (10/2023)

     Sources              : http://en.wikipedia.org/wiki/Short_Stirling

     Wingspan             : 30.2 m   (    99 ft 1 in )
     Lenght               : 26.6 m   (    87 ft 3 in )
     Height               :  8.8 m   (    28 ft 1 in )
     Empty weight         : 19950 kg ( 44000 lb      )
     Max takeoff weight   : 31751 kg ( 70000 lb      )
     Engines              : 4 Bristol Hercules XI 14-cylinder air-cooled sleeve-valve radial piston engines ( 1500 hp each )
     Maximum speed        : 454 km/h (   245 kt      )
     Cruise speed         : 320 km/h (   170 kt      )
-->
<airplane mass="44000" version="YASIM_VERSION_CURRENT" mtow-lbs="70000">

  <approach speed="60" aoa="6" fuel="0.3">
    <control-setting axis="/controls/engines/engine[0]/throttle"        value="0.3"/>
    <control-setting axis="/controls/engines/engine[1]/throttle"        value="0.3"/>
    <control-setting axis="/controls/engines/engine[2]/throttle"        value="0.3"/>
    <control-setting axis="/controls/engines/engine[3]/throttle"        value="0.3"/>

    <control-setting axis="/controls/engines/engine[0]/boost"           value="0"/>
    <control-setting axis="/controls/engines/engine[1]/boost"           value="0"/>
    <control-setting axis="/controls/engines/engine[2]/boost"           value="0"/>
    <control-setting axis="/controls/engines/engine[3]/boost"           value="0"/>

    <control-setting axis="/controls/engines/engine[0]/mixture"         value="1"/>
    <control-setting axis="/controls/engines/engine[1]/mixture"         value="1"/>
    <control-setting axis="/controls/engines/engine[2]/mixture"         value="1"/>
    <control-setting axis="/controls/engines/engine[3]/mixture"         value="1"/>

    <control-setting axis="/controls/engines/engine[0]/propeller-pitch" value="0.77"/>
    <control-setting axis="/controls/engines/engine[1]/propeller-pitch" value="0.77"/>
    <control-setting axis="/controls/engines/engine[2]/propeller-pitch" value="0.77"/>
    <control-setting axis="/controls/engines/engine[3]/propeller-pitch" value="0.77"/>
      
    <control-setting axis="/controls/flight/flaps"                      value="1"/>
    <control-setting axis="/controls/gear/gear-down"                    value="1"/>
      
  </approach>

  <cruise speed="170" alt="21000" fuel="0.8">
    <control-setting axis="/controls/engines/engine[0]/throttle"        value="0.8"/>
    <control-setting axis="/controls/engines/engine[1]/throttle"        value="0.8"/>
    <control-setting axis="/controls/engines/engine[2]/throttle"        value="0.8"/>
    <control-setting axis="/controls/engines/engine[3]/throttle"        value="0.8"/>

    <control-setting axis="/controls/engines/engine[0]/boost"           value="1"/>
    <control-setting axis="/controls/engines/engine[1]/boost"           value="1"/>
    <control-setting axis="/controls/engines/engine[2]/boost"           value="1"/>
    <control-setting axis="/controls/engines/engine[3]/boost"           value="1"/>

    <control-setting axis="/controls/engines/engine[0]/mixture"         value="0.6"/>
    <control-setting axis="/controls/engines/engine[1]/mixture"         value="0.6"/>
    <control-setting axis="/controls/engines/engine[2]/mixture"         value="0.6"/>
    <control-setting axis="/controls/engines/engine[3]/mixture"         value="0.6"/>

    <control-setting axis="/controls/engines/engine[0]/propeller-pitch" value="1"/>
    <control-setting axis="/controls/engines/engine[1]/propeller-pitch" value="1"/>
    <control-setting axis="/controls/engines/engine[2]/propeller-pitch" value="1"/>
    <control-setting axis="/controls/engines/engine[3]/propeller-pitch" value="1"/>

    <control-setting axis="/controls/flight/flaps"                      value="0"/>
    <control-setting axis="/controls/gear/gear-down"                    value="0"/>
  </cruise>

  <cockpit x="6.425" y="0.397" z="0.475"/>

  <!-- Fuselage -->
  <fuselage ax=" 13.263" ay=" 0.000" az="-0.243" bx=" 12.517" by=" 0.000" bz="-0.204" width="1.292" taper="0.70" midpoint="1"/>
  <fuselage ax=" 12.517" ay=" 0.000" az="-0.204" bx=" 10.862" by=" 0.000" bz=" 0.026" width="1.875" taper="0.70" midpoint="1"/>
  <fuselage ax=" 10.990" ay=" 0.000" az=" 0.026" bx=" -3.890" by=" 0.000" bz="-0.026" width="1.875" taper="1.00" midpoint="1"/>
  <fuselage ax=" -3.890" ay=" 0.000" az="-0.026" bx="-12.395" by=" 0.000" bz=" 0.353" width="1.875" taper="0.60" midpoint="0"/>
  <fuselage ax="-12.395" ay=" 0.000" az=" 0.353" bx="-13.327" by=" 0.000" bz=" 0.353" width="1.125" taper="0.60" midpoint="0"/>
    
  <fuselage ax=" 13.263" ay=" 0.000" az="-0.992" bx=" 12.517" by=" 0.000" bz="-0.953" width="1.292" taper="0.70" midpoint="1"/>
  <fuselage ax=" 12.517" ay=" 0.000" az="-0.953" bx=" 10.791" by=" 0.000" bz="-0.693" width="1.889" taper="0.70" midpoint="1"/>
  <fuselage ax=" 10.791" ay=" 0.000" az="-0.693" bx=" -3.890" by=" 0.000" bz="-0.693" width="1.889" taper="1.00" midpoint="1"/>
  <fuselage ax=" -3.890" ay=" 0.000" az="-0.693" bx="-12.395" by=" 0.000" bz=" 0.007" width="1.889" taper="0.62" midpoint="0"/>
  <fuselage ax="-12.395" ay=" 0.000" az=" 0.007" bx="-13.327" by=" 0.000" bz=" 0.007" width="1.171" taper="0.70" midpoint="0"/>
    
  <!-- Cockpit -->
  <fuselage ax=" 10.822" ay=" 0.000" az=" 0.536" bx=" 10.080" by=" 0.000" bz=" 0.622" width="1.736" taper="0.50" midpoint="1"/>
  <fuselage ax=" 10.182" ay=" 0.000" az=" 0.622" bx="  9.118" by=" 0.000" bz=" 0.622" width="1.736" taper="1.00" midpoint="1"/>
  <fuselage ax="  9.118" ay=" 0.000" az=" 0.622" bx="  7.701" by=" 0.000" bz=" 0.622" width="1.736" taper="0.40" midpoint="0"/>

  <!-- Exterior left engine -->
  <fuselage ax="  7.599" ay=" 7.939" az=" 0.372" bx="  7.400" by=" 7.939" bz=" 0.372" width="1.553" taper="0.60" midpoint="1"/>
  <fuselage ax="  7.400" ay=" 7.939" az=" 0.372" bx="  5.715" by=" 7.939" bz=" 0.372" width="1.553" taper="1.00" midpoint="1"/>
  <fuselage ax="  5.715" ay=" 7.939" az=" 0.372" bx="  4.998" by=" 7.939" bz=" 0.372" width="1.553" taper="0.80" midpoint="0"/>
  <fuselage ax="  4.998" ay=" 7.939" az=" 0.372" bx="  4.166" by=" 7.939" bz=" 0.372" width="1.264" taper="0.30" midpoint="0"/>
    
  <!-- Interior left engine -->
  <fuselage ax="  8.209" ay=" 3.910" az="-0.014" bx="  8.010" by=" 3.910" bz="-0.014" width="1.553" taper="0.60" midpoint="1"/>
  <fuselage ax="  8.010" ay=" 3.910" az="-0.014" bx="  2.657" by=" 3.910" bz="-0.014" width="1.553" taper="1.00" midpoint="1"/>
  <fuselage ax="  2.657" ay=" 3.910" az="-0.014" bx="  1.940" by=" 3.910" bz="-0.014" width="1.553" taper="0.80" midpoint="0"/>
  <fuselage ax="  1.940" ay=" 3.910" az="-0.014" bx="  1.108" by=" 3.910" bz="-0.014" width="1.264" taper="0.30" midpoint="0"/>
    
  <!-- Interior right engine -->
  <fuselage ax="  8.209" ay="-3.910" az="-0.014" bx="  8.010" by="-3.910" bz="-0.014" width="1.553" taper="0.60" midpoint="1"/>
  <fuselage ax="  8.010" ay="-3.910" az="-0.014" bx="  2.657" by="-3.910" bz="-0.014" width="1.553" taper="1.00" midpoint="1"/>
  <fuselage ax="  2.657" ay="-3.910" az="-0.014" bx="  1.940" by="-3.910" bz="-0.014" width="1.553" taper="0.80" midpoint="0"/>
  <fuselage ax="  1.940" ay="-3.910" az="-0.014" bx="  1.108" by="-3.910" bz="-0.014" width="1.264" taper="0.30" midpoint="0"/>
    
  <!-- Exterior left engine -->
  <fuselage ax="  7.599" ay="-7.939" az=" 0.372" bx="  7.400" by="-7.939" bz=" 0.372" width="1.553" taper="0.60" midpoint="1"/>
  <fuselage ax="  7.400" ay="-7.939" az=" 0.372" bx="  5.715" by="-7.939" bz=" 0.372" width="1.553" taper="1.00" midpoint="1"/>
  <fuselage ax="  5.715" ay="-7.939" az=" 0.372" bx="  4.998" by="-7.939" bz=" 0.372" width="1.553" taper="0.80" midpoint="0"/>
  <fuselage ax="  4.998" ay="-7.939" az=" 0.372" bx="  4.166" by="-7.939" bz=" 0.372" width="1.264" taper="0.30" midpoint="0"/>
    
  <!-- Wing -->
  <wing x="2.788" y="0" z="-0.175"
        chord="6.595"
        length="15.1"
        taper="0.36"
        dihedral="4"
        sweep="-3"
        camber="0.005">
        <stall   aoa="20" width="1"    peak="1.5"/>
        <flap0 start="0.13" end="0.55" lift="2.2" drag="3.5"/>
        <flap1 start="0.55" end="0.94" lift="1.2" drag="1.1"/>

        <control-input  control="FLAP0" axis="/controls/flight/flaps"/>
        <control-input  control="FLAP1" axis="/controls/flight/aileron"                  split="true"/>
        <control-input  control="FLAP1" axis="/controls/flight/aileron-trim"             split="true"/>

        <control-output control="FLAP0" prop="/surface-positions/flap-pos-norm"/>
        <control-output control="FLAP1" prop="/surface-positions/left-aileron-pos-norm"  side="left"/>
        <control-output control="FLAP1" prop="/surface-positions/right-aileron-pos-norm" side="right"/>

        <control-speed  control="FLAP0" transition-time="5"/>
  </wing>

  <!-- Elevator -->
  <hstab x="-10.414" y="0" z="-0.041"
         chord="2.817"
         length="5.787"
         sweep="4"
         taper="0.6">
         <stall   aoa="20" width="1" peak="1.5"/>
         <flap0 start="0"    end="1" lift="1.2" drag="1.1"/>

         <control-input  control="FLAP0" axis="/controls/flight/elevator"/>
         <control-input  control="FLAP0" axis="/controls/flight/elevator-trim"/>

         <control-output control="FLAP0" prop="/surface-positions/elevator-pos-norm"/>
  </hstab>

  <!-- Ruder -->
  <vstab x="-10.528" y="0" z="0.951"
         chord="3.164"
         length="3.540"
         sweep="4"
         taper="0.45">
         <stall   aoa="18" width="1" peak="1.5"/>
         <flap0 start="0"    end="1" lift="1.6" drag="1.2"/>

         <control-input  control="FLAP0" axis="/controls/flight/rudder"      invert="true"/>
         <control-input  control="FLAP0" axis="/controls/flight/rudder-trim" invert="true"/>

         <control-output control="FLAP0" prop="/surface-positions/rudder-pos-norm"/>
  </vstab>

  <!-- Engines   source            : https://en.wikipedia.org/wiki/Bristol_Hercules

                 name              : Bristol Hercules
                 type              : 14-cylinder, two-row, supercharged, air-cooled radial engine
                 power cruise      : 1500 hp at 2800 rpm for takeoff
                                     1356 hp at 2750 rpm at 4000 ft (1220 m)
                 Compression ratio : 7.0:1
                 weight            : 1929 lb  (875 kg)
                 Displacement      : 2360 in3 (38.7 L)
  -->
  <!-- Engine left exterior-->
  <propeller x="7.069" y="7.939" z="0.372"
             mass="1929"
             moment="50"
             radius="2.1"
             min-rpm="50"
             max-rpm="2800"
             cruise-speed="170"
             cruise-rpm="2750"
             cruise-power="1356"
             cruise-alt="4000">
             <actionpt x="7.730" y="7.939" z="0.372"/>
             <control-input control="ADVANCE" axis="/controls/engines/engine[0]/propeller-pitch"/>
             <piston-engine eng-power="1500"
                            eng-rpm="2800"
                            displacement="2360">
                            <control-input control="THROTTLE" axis="/controls/engines/engine[0]/throttle"/>
                            <control-input control="STARTER"  axis="/controls/engines/engine[0]/starter"/>
                            <control-input control="MAGNETOS" axis="/controls/engines/engine[0]/magnetos"/>
                            <control-input control="MIXTURE"  axis="/controls/engines/engine[0]/mixture"/>
                            <control-input control="BOOST"    axis="/controls/engines/engine[0]/boost"/>
             </piston-engine>
  </propeller>

  <!-- Engine left interior-->
  <propeller x="7.693" y="3.910" z="-0.014"
             mass="1929"
             moment="50"
             radius="2.1"
             min-rpm="50"
             max-rpm="2800"
             cruise-speed="170"
             cruise-rpm="2750"
             cruise-power="1356"
             cruise-alt="4000">
             <actionpt x="8.369" y="3.910" z="-0.014"/>
             <control-input control="ADVANCE" axis="/controls/engines/engine[1]/propeller-pitch"/>
             <piston-engine eng-power="1500"
                            eng-rpm="2800"
                            displacement="2360">
                            <control-input control="THROTTLE" axis="/controls/engines/engine[1]/throttle"/>
                            <control-input control="STARTER"  axis="/controls/engines/engine[1]/starter"/>
                            <control-input control="MAGNETOS" axis="/controls/engines/engine[1]/magnetos"/>
                            <control-input control="MIXTURE"  axis="/controls/engines/engine[1]/mixture"/>
                            <control-input control="BOOST"    axis="/controls/engines/engine[1]/boost"/>
             </piston-engine>
  </propeller>

  <!-- Engine right interior-->
  <propeller x="7.693" y="-3.910" z="-0.014"
             mass="1929"
             moment="50"
             radius="2.1"
             min-rpm="50"
             max-rpm="2800"
             cruise-speed="170"
             cruise-rpm="2750"
             cruise-power="1356"
             cruise-alt="4000">
             <actionpt x="8.369" y="-3.910" z="-0.014"/>
             <control-input control="ADVANCE" axis="/controls/engines/engine[2]/propeller-pitch"/>
             <piston-engine eng-power="1500"
                            eng-rpm="2800"
                            displacement="2360">
                            <control-input control="THROTTLE" axis="/controls/engines/engine[2]/throttle"/>
                            <control-input control="STARTER"  axis="/controls/engines/engine[2]/starter"/>
                            <control-input control="MAGNETOS" axis="/controls/engines/engine[2]/magnetos"/>
                            <control-input control="MIXTURE"  axis="/controls/engines/engine[2]/mixture"/>
                            <control-input control="BOOST"    axis="/controls/engines/engine[2]/boost"/>
             </piston-engine>
  </propeller>

  <!-- Engine right exterior-->
  <propeller x="7.069" y="-7.939" z="0.372"
             mass="1929"
             moment="50"
             radius="2.1"
             min-rpm="50"
             max-rpm="2800"
             cruise-speed="170"
             cruise-rpm="2750"
             cruise-power="1356"
             cruise-alt="4000">
             <actionpt x="7.730" y="-7.939" z="0.372"/>
             <control-input control="ADVANCE" axis="/controls/engines/engine[3]/propeller-pitch"/>
             <piston-engine eng-power="1500"
                            eng-rpm="2800"
                            displacement="2360">
                            <control-input control="THROTTLE" axis="/controls/engines/engine[3]/throttle"/>
                            <control-input control="STARTER"  axis="/controls/engines/engine[3]/starter"/>
                            <control-input control="MAGNETOS" axis="/controls/engines/engine[3]/magnetos"/>
                            <control-input control="MIXTURE"  axis="/controls/engines/engine[3]/mixture"/>
                            <control-input control="BOOST"    axis="/controls/engines/engine[3]/boost"/>
             </piston-engine>
  </propeller>

  <!-- Left wheel -->
  <gear x="5.264" y="3.910" z="-4.349"
        compression="0.2"
        spring="1.0"
        damp="1.5"
        stiction="1">
        <control-input  control="BRAKE"  axis="/controls/gear/brake-left"/>
        <control-input  control="BRAKE"  axis="/controls/gear/brake-parking"/>
        <control-input  control="EXTEND" axis="/controls/gear/gear-down"/>
          
        <control-output control="EXTEND" prop="/gear/gear[0]/position-norm"/>
          
        <control-speed  control="EXTEND" transition-time="5"/>
  </gear>

  <!-- Right wheel -->
  <gear x="5.264" y="-3.910" z="-4.349"
        compression="0.2"
        spring="1.0"
        damp="1.5"
        stiction="1">
        <control-input  control="BRAKE"  axis="/controls/gear/brake-right"/>
        <control-input  control="BRAKE"  axis="/controls/gear/brake-parking"/>
        <control-input  control="EXTEND" axis="/controls/gear/gear-down"/>
          
        <control-output control="EXTEND" prop="/gear/gear[1]/position-norm"/>

        <control-speed  control="EXTEND" transition-time="3.5"/>
  </gear>

  <!-- Tail wheel -->
  <gear x="-11.053" y="0.000" z="-1.613"
        compression="0.2"
        spring="1.0"
        damp="1.50"
        stiction="1">
        <control-input  control="STEER"  axis="/controls/flight/rudder" square="true" src0="-1.0" src1="1.0" dst0="0.8" dst1="-0.8"/>
        <control-input  control="EXTEND" axis="/controls/gear/gear-down"/>
          
        <control-output control="EXTEND" prop="/gear/gear[2]/position-norm"/>
          
        <control-speed  control="EXTEND" transition-time="5"/>
  </gear>

  <tank x="2.466" y=" 4.817" z="0.136" capacity="2000"/>
  <tank x="2.466" y="-4.817" z="0.136" capacity="2000"/>

  <!-- Mass distribution
       Dilbert : The cg should be about 1/6 chord ahead of the chord center.
                 6.595 / 6     = 1.099
                 2.788 + 1.099 = 3.887
  -->
  <ballast x="4" y="0" z="-1.5" mass="24460"/>

</airplane>
