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

<!-- Beechcraft Model 17 Staggerwing BARANGER Emmanuel with Melchior script (2012)
                             Updated BARANGER Emmanuel (September 2014)
                             Updated BARANGER Emmanuel (November  2020)
                             Updated BARANGER Emmanuel (April     2024)

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

     Wingspan             : 32 ft       ( 9.75 m    )
     Length               : 26 ft 10 in ( 8.18 m    )
     Height               :  8 ft       ( 2.44 m    )
     Empty weight         : 2540 lb     ( 1150 kg   )
     Gross weight         : 4250 lb     ( 1928 kg   )
     Engine               : Pratt & Whitney R-985-AN-1 "Wasp Junior" radial engine 450 hp at 2300
     Maximum speed        : 184 kts     (  341 km/h )
     Cruise speed         : 176 kts     (  325 km/h )
-->
<airplane mass="2540" version="YASIM_VERSION_CURRENT" mtow-lbs="4250">

  <approach speed="42" aoa="6" fuel="0.2">
    <control-setting axis="/controls/engines/engine[0]/throttle" value="0.20"/>
    <control-setting axis="/controls/engines/engine[0]/mixture"  value="0.65"/>
    <control-setting axis="/controls/gear/gear-down"             value="1.00"/>
  </approach>

  <cruise speed="176" alt="5000" fuel="0.5">
    <control-setting axis="/controls/engines/engine[0]/throttle" value="1.00"/>
    <control-setting axis="/controls/engines/engine[0]/mixture"  value="0.65"/>
    <control-setting axis="/controls/gear/gear-down"             value="0.00"/>
  </cruise>

  <cockpit x="1.665" y="0.300" z="0.713"/>

  <fuselage ax=" 3.624" ay=" 0.000" az="-0.029" bx=" 3.426" by=" 0.000" bz="-0.029" width="1.143" taper="0.70" midpoint="1"/>
  <fuselage ax=" 3.426" ay=" 0.000" az="-0.029" bx="-0.259" by=" 0.000" bz="-0.029" width="1.143" taper="1.00" midpoint="1"/>

  <fuselage ax="-0.259" ay=" 0.000" az="-0.029" bx="-3.400" by=" 0.000" bz=" 0.171" width="1.143" taper="0.40" midpoint="0"/>

  <fuselage ax=" 2.507" ay=" 0.000" az=" 0.198" bx=" 1.481" by=" 0.000" bz=" 0.362" width="1.143" taper="0.70" midpoint="1"/>
  <fuselage ax=" 1.579" ay=" 0.000" az=" 0.335" bx=" 0.700" by=" 0.000" bz=" 0.335" width="1.143" taper="1.00" midpoint="1"/>
  <fuselage ax=" 0.776" ay=" 0.000" az=" 0.362" bx="-0.975" by=" 0.000" bz=" 0.195" width="1.143" taper="0.70" midpoint="0"/>

  <!-- Wing up -->
  <wing x="0.898" y="0" z="0.878"
        chord  = "1.490"
        length = "4.90"
        taper  = "1"
        camber = "0.002">
        <stall   aoa="18"  width="1"    peak="1.5"/>
        <flap1 start="0.244" end="0.86" lift="1.3" drag="1.2"/>

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

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

  <!-- Wing down -->
  <wing x="1.519" y="0" z="-0.684"
        append = "1"
        chord  = "1.490"
        length = "4.90"
        taper  = "1"
        camber = "0.002">
        <stall   aoa="18"  width="1"    peak="1.5"/>
        <flap0 start="0.244" end="0.86" lift="1.5" drag="1.2"/>

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

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

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

  <hstab x="-3.165" y="0" z="0.367"
         chord  = "1.558"
         length = "1.784"
         taper  = "0.60"
         sweep  = "10">
         <stall   aoa="16" width="1" peak="1.5"/>
         <flap0 start="0.0"  end="1" lift="1.4" drag="1.2"/>

         <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>

  <vstab x="-3.187" y="0" z="0.045"
         chord  = "1.679"
         length = "1.700"
         taper  = "0.60"
         sweep  = "10">
         <stall   aoa="14" width="1" peak="1.5"/>
         <flap0 start="0"    end="1" lift="1.4" drag="1.2"/>

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

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

  <!-- Engine    source            : http://en.wikipedia.org/wiki/Pratt_%26_Whitney_R-985

                 name              : Pratt & Whitney R-985 Wasp Junior
                 type              : 9-cylinder supercharged air-cooled radial piston engine
                 power cruise      : 400 hp at 2200 RPM up to 5000 ft; 450 hp at 2300 RPM for takeoff
                 Compression ratio : 6.0:1
                 weight            : 640 lb (290 kg)
                 Displacement      : 985 cu in (16.14 L)
  -->
  <propeller x="3.207" y="0" z="-0.029"
             radius        = "1.27"
             mass          = "640"
             moment        = "10"
             cruise-power  = "420"
             cruise-speed  = "176"
             cruise-rpm    = "2100"
             cruise-alt    = "5000"
             takeoff-power = "450"
             takeoff-rpm   = "2300">
             <actionpt x="3.714" y="0" z="-0.057" />
             <piston-engine eng-power    = "450"
                            eng-rpm      = "2300"
                            alt          = "5000"
                            displacement = "985"
                            compression  = "6">
                            <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"/>
             </piston-engine>
  </propeller>

  <!-- Left wheel -->
  <gear x="2.102" y="1.108" z="-1.718"
        compression = "0.15"
        spring      = "6"
        stiction    = "1">
        <control-input  control="BRAKE"  axis="/controls/gear/brake-left"    split="true"/>
        <control-input  control="BRAKE"  axis="/controls/gear/brake-parking" split="true"/>
        <control-input  control="EXTEND" axis="/controls/gear/gear-down"/>
        <control-input  control="STEER"  axis="/sim/gears/toe-left"/>

        <control-output control="EXTEND" prop="/gear/gear[0]/position-norm"/>

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

  <!-- Right wheel -->
  <gear x="2.102" y="-1.108" z="-1.718"
        compression = "0.15"
        spring      = "6"
        stiction    = "1">
        <control-input  control="BRAKE"  axis="/controls/gear/brake-right"   split="true"/>
        <control-input  control="BRAKE"  axis="/controls/gear/brake-parking" split="true"/>
        <control-input  control="EXTEND" axis="/controls/gear/gear-down"/>
        <control-input  control="STEER"  axis="/sim/gears/toe-right"/>

        <control-output control="EXTEND" prop="/gear/gear[1]/position-norm"/>

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

  <!-- Tail wheel -->
  <gear x="-3.112" y="0" z="-0.395"
        compression = "0.1"
        spring      = "6"
        stiction    = "1">
        <control-input  control="STEER"  axis="/controls/flight/rudder" src0="-1.0" src1="1.0" dst0="0.5" dst1="-0.5"/>
        <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="7.1"/>
  </gear>

  <!-- Fuel: 250 lbs -->
  <tank x="1.56" y="0" z="-0.400" capacity="250"/>

  <!-- Mass distribution
       Dilbert : The cg should be about 1/6 chord ahead of the chord center.
                 1.490 / 6     = 0.248
                 0.898 + 0.248 = 1.146
  -->
  <ballast x="3" y="0" z="-0.5" mass="112"/>

</airplane>
