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

<!-- Socata ST 10       :    2012 Emmanuel BARANGER
              Updated   :    2014 Emmanuel BARANGER
              Updated   : 07/2020 Emmanuel BARANGER

     sources            : http://en.wikipedia.org/wiki/SOCATA_ST_10

     wingspan           :  9.69 m    ( 31 ft 9 3/4 in )
     length             :  7.10 m    ( 23 ft 3 1/2 in )
     height             :  2.90 m    (  9 ft 5 1/3 in )
     empty weight       :   724 kg   (  1594 lb       )
     Max takeoff weight :  2690 kg   (  5930 lb       )
     engine             : 1 Lycoming IO-360-C 4-cylinder horizontally-opposed fuel-injected piston engine (200 hp)
     Cruise speed       :   265 km/h ( 143 kts        )
     Maximum speed      :   280 km/h ( 151 kts        )
-->
<airplane mass="1594" version="YASIM_VERSION_CURRENT" mtow-lbs="5930">

  <!-- Approach configuration -->
  <approach speed="40" aoa="2" fuel="0.2">
    <control-setting axis="/controls/engines/engine[0]/throttle" value="0.2"/>
    <control-setting axis="/controls/engines/engine[0]/mixture"  value="1"/>
    <control-setting axis="/controls/flight/flaps"               value="1"/>
  </approach>

  <!-- Cruise configuration -->
  <cruise speed="143" alt="6000" fuel="0.5">
    <control-setting axis="/controls/engines/engine[0]/throttle" value="0.7"/>
    <control-setting axis="/controls/engines/engine[0]/mixture"  value="0.6"/>
    <control-setting axis="/controls/flight/flaps"               value="0"/>
  </cruise>

  <cockpit x="0.99143" y="0.26808" z="0.17679"/>

  <!-- Bol -->
  <fuselage ax=" 3.539" ay=" 0.000" az="-0.250" bx=" 3.436" by=" 0.000" bz="-0.250" width="0.178" taper="0.10" midpoint="1"/>
  <fuselage ax=" 3.436" ay=" 0.000" az="-0.250" bx=" 3.311" by=" 0.000" bz="-0.250" width="0.286" taper="0.62" midpoint="1"/>
  <fuselage ax=" 3.311" ay=" 0.000" az="-0.250" bx=" 3.150" by=" 0.000" bz="-0.250" width="0.331" taper="0.86" midpoint="1"/>

  <!-- Left up fuselage -->
  <fuselage ax=" 3.150" ay=" 0.186" az="-0.290" bx=" 3.065" by=" 0.186" bz="-0.290" width="0.504" taper="0.86" midpoint="1"/>
  <fuselage ax=" 3.065" ay=" 0.186" az="-0.290" bx=" 2.511" by=" 0.186" bz="-0.304" width="0.629" taper="0.80" midpoint="1"/>
  <fuselage ax=" 2.511" ay=" 0.186" az="-0.304" bx=" 1.903" by=" 0.186" bz="-0.304" width="0.750" taper="0.84" midpoint="1"/>
  <fuselage ax=" 1.903" ay=" 0.186" az="-0.304" bx="-0.026" by=" 0.186" bz="-0.304" width="0.750" taper="1.00" midpoint="1"/>
  <fuselage ax="-0.026" ay=" 0.186" az="-0.304" bx="-2.218" by=" 0.000" bz="-0.183" width="0.750" taper="0.80" midpoint="0"/>

  <!-- Left down fuselage -->
  <fuselage ax=" 3.066" ay=" 0.186" az="-0.406" bx=" 2.981" by=" 0.186" bz="-0.406" width="0.504" taper="0.86" midpoint="1"/>
  <fuselage ax=" 2.981" ay=" 0.186" az="-0.406" bx=" 2.504" by=" 0.186" bz="-0.496" width="0.635" taper="0.76" midpoint="1"/>
  <fuselage ax=" 2.504" ay=" 0.186" az="-0.496" bx=" 1.878" by=" 0.186" bz="-0.541" width="0.635" taper="1.00" midpoint="1"/>
  <fuselage ax=" 1.878" ay=" 0.186" az="-0.541" bx="-0.026" by=" 0.186" bz="-0.541" width="0.635" taper="1.00" midpoint="1"/>
  <fuselage ax="-0.026" ay=" 0.186" az="-0.541" bx="-2.218" by=" 0.000" bz="-0.183" width="0.635" taper="0.70" midpoint="0"/>

  <fuselage ax="-2.218" ay=" 0.000" az="-0.183" bx="-3.316" by=" 0.000" bz="-0.037" width="0.598" taper="0.40" midpoint="0"/>

  <!-- Right up fuselage -->
  <fuselage ax=" 3.150" ay="-0.186" az="-0.290" bx=" 3.065" by="-0.186" bz="-0.290" width="0.504" taper="0.86" midpoint="1"/>
  <fuselage ax=" 3.065" ay="-0.186" az="-0.290" bx=" 2.511" by="-0.186" bz="-0.304" width="0.629" taper="0.80" midpoint="1"/>
  <fuselage ax=" 2.511" ay="-0.186" az="-0.304" bx=" 1.903" by="-0.186" bz="-0.304" width="0.750" taper="0.84" midpoint="1"/>
  <fuselage ax=" 1.903" ay="-0.186" az="-0.304" bx="-0.026" by="-0.186" bz="-0.304" width="0.750" taper="1.00" midpoint="1"/>
  <fuselage ax="-0.026" ay="-0.186" az="-0.304" bx="-2.218" by="-0.000" bz="-0.183" width="0.750" taper="0.80" midpoint="0"/>

  <!-- Right down fuselage -->
  <fuselage ax=" 3.066" ay="-0.186" az="-0.406" bx=" 2.981" by="-0.186" bz="-0.406" width="0.504" taper="0.86" midpoint="1"/>
  <fuselage ax=" 2.981" ay="-0.186" az="-0.406" bx=" 2.504" by="-0.186" bz="-0.496" width="0.635" taper="0.76" midpoint="1"/>
  <fuselage ax=" 2.504" ay="-0.186" az="-0.496" bx=" 1.878" by="-0.186" bz="-0.541" width="0.635" taper="1.00" midpoint="1"/>
  <fuselage ax=" 1.878" ay="-0.186" az="-0.541" bx="-0.026" by="-0.186" bz="-0.541" width="0.635" taper="1.00" midpoint="1"/>
  <fuselage ax="-0.026" ay="-0.186" az="-0.541" bx="-2.218" by="-0.000" bz="-0.183" width="0.635" taper="0.70" midpoint="0"/>

  <!-- Left Cabine -->
  <fuselage ax=" 2.023" ay=" 0.186" az="-0.158" bx=" 1.262" by=" 0.186" bz=" 0.060" width="0.635" taper="0.70" midpoint="1"/>
  <fuselage ax=" 1.363" ay=" 0.186" az=" 0.046" bx=" 0.724" by=" 0.186" bz=" 0.046" width="0.635" taper="1.00" midpoint="1"/>
  <fuselage ax=" 0.724" ay=" 0.186" az=" 0.046" bx="-0.100" by=" 0.186" bz=" 0.046" width="0.635" taper="0.60" midpoint="0"/>
  <fuselage ax="-0.100" ay=" 0.186" az=" 0.046" bx="-2.234" by=" 0.000" bz="-0.083" width="0.380" taper="1.00" midpoint="0"/>

  <!-- Right Cabine -->
  <fuselage ax=" 2.023" ay="-0.186" az="-0.158" bx=" 1.262" by="-0.186" bz=" 0.060" width="0.635" taper="0.70" midpoint="1"/>
  <fuselage ax=" 1.363" ay="-0.186" az=" 0.046" bx=" 0.724" by="-0.186" bz=" 0.046" width="0.635" taper="1.00" midpoint="1"/>
  <fuselage ax=" 0.724" ay="-0.186" az=" 0.046" bx="-0.100" by="-0.186" bz=" 0.046" width="0.635" taper="0.60" midpoint="0"/>
  <fuselage ax="-0.100" ay="-0.186" az=" 0.046" bx="-2.234" by="-0.000" bz="-0.083" width="0.380" taper="1.00" midpoint="0"/>

  <wing x="1.021" y="0" z="-0.741"
        chord    = "2.061"
        length   = "1.786"
        taper    = "0.613"
        sweep    = "4.0"
        dihedral = "6"
        camber="0.01">
        <stall   aoa="20" width="1" peak="1.5"/>
        <flap0 start="0.41" end="1" lift="1.4" drag="1.25"/>
  </wing>

  <wing x="0.897" y="1.772" z="-0.554"
        append   = "1"
        chord    = "1.263"
        length   = "3.028"
        taper    = "0.65"
        sweep    = "-3"
        dihedral = "7"
        camber="0.01">
        <stall aoa="20" width="1" peak="1.5"/>
        <flap0 start="0.00" end="0.53" lift="1.4" drag="1.25"/>
        <flap1 start="0.55" end="0.97" lift="1.2" drag="1.2"/>

        <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" side="left"  prop="/surface-positions/left-aileron-pos-norm"/>
        <control-output control="FLAP1" side="right" prop="/surface-positions/right-aileron-pos-norm"/>
        <control-output control="FLAP1" prop="/surface-positions/aileron-pos-norm"/>

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

  <hstab x="-2.98436" y="0" z="-0.05"
         chord  = "1.140"
         length = "1.886"
         taper  = "0.45"
         sweep  = "2.3">
         <stall   aoa="18" width="1" peak="1.5"/>
         <flap0 start="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="-2.74065" y="0" z="0.085"
         chord  = "1.167"
         length = "1.600"
         taper  = "0.7"
         sweep  = "18">
         <stall   aoa="16" width="1" peak="1.5"/>
         <flap0 start="0"    end="1" lift="1.2" 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" min="1" max="-1"/>
  </vstab>

  <mstab x="-2.367" y="0" z="-0.204"
         chord  = "1.771"
         length = "0.421"
         taper  = "1.0"
         sweep  = "-40"
         dihedral="270">
         <stall aoa="16" width="1" peak="1.5"/>
  </mstab>

  <!-- Engines   source            : http://en.wikipedia.org/wiki/Lycoming_O-360

                 name              : Lycoming O-360
                 type              : Four-cylinder, dual magneto, horizontally opposed, four-stroke aircraft engine
                 power cruise      : 180 hp at 2700 rpm
                 weight            : 258 lb (117 kg)
                 displacement      : 361 cu in (5.9157 L)
                 compression       : 8.5:1
  -->
  <propeller x="2.70129" y="0" z="-0.25049"
             radius        = "0.8685"
             mass          = "258"
             moment        = "6"
             cruise-speed  = "143"
             cruise-rpm    = "2300"
             cruise-alt    = "6000"
             cruise-power  = "170"
             takeoff-power = "360"
             takeoff-rpm   = "2300">
             <actionpt x="3.24951" y="0" z="-0.25049"/>
             <piston-engine eng-rpm      = "2300"
                            eng-power    = "180"
                            displacement = "361"
                            compression  = "8.5">
                            <control-input control="THROTTLE" axis="/controls/engines/engine[0]/throttle" src0="0.0" src1="1.0" dst0="0.0" dst1="1.0"/>
                            <control-input control="MIXTURE"  axis="/controls/engines/engine[0]/mixture" src0="0.0" src1="1.0" dst0="0.8" dst1="0.8"/>
                            <control-input control="STARTER"  axis="/controls/engines/engine[0]/starter"/>
                            <control-input control="MAGNETOS" axis="/controls/engines/engine[0]/magnetos"/>
             </piston-engine>
  </propeller>

  <!-- Noze wheel -->
  <gear x="2.63055" y="0" z="-1.42607"
        compression = "0.15"
        spring      = "2"
        on-solid    = "1"
        sfric       = "1"
        dfric       = "1"
        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="CASTERING" axis="/controls/gear/tailwheel-lock" src0="0" src1="1" dst0="1" dst1="0"/>
        <control-input  control="EXTEND"    axis="/controls/gear/gear-down"/>

        <control-speed  control="EXTEND" transition-time="6"/>

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

  <!-- Left wheel -->
  <gear x="0.83011" y="1.41007" z="-1.44010"
        compression = "0.2"
        spring      = "2"
        damp        = "0.03"
        on-solid    = "1"
        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-input  control="STEER"  axis="/sim/gears/toe-left"/>

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

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

  <!-- Right wheel -->
  <gear x="0.83011" y="-1.41007" z="-1.44010"
        compression = "0.2"
        spring      = "2"
        damp        = "0.03"
        on-solid    = "1"
        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-input  control="STEER"  axis="/sim/gears/toe-right"/>

        <control-speed  control="EXTEND" transition-time="6"/>

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

  <!-- Tail contact point -->
  <gear x="-3.23777" y="0" z="-0.26181"
        compression="0.01">
  </gear>

  <tank x="0.456" y="0" z="-0.310" capacity="56" />

  <!-- Mass distribution
       Dilbert : The cg should be about 1/6 chord ahead of the chord center.
                 2.061 / 6     = 0.343
                 1.021 + 0.343 = 1.364
  -->
  <ballast x="2" y="0" z="-0.7" mass="722"/>

</airplane>
