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

<!-- Beechcraft T34 A   - Emmanuel BARANGER 05/2022

     sources            : https://www.wikiwand.com/fr/Beechcraft_T-34_Mentor

     wingspan           : 10.00 m (  32 ft 8  in )
     length             :  7.80 m (  25 ft 5  in )
     height             :  2.92 m (   9 ft 58 in )
     empty weight       :  1342 kg (     2959 lb  )
     Max takeoff weight :  1950 kg (     4299 lb  )
     engine             : Continental O-470-13 six-cylinder air-cooled horizontally
                          opposed aircraft piston engine ( 225 hp )
     Maximal speed      :   302 km/h (  163 kn   )
     Cruise speed       :   274 km/h (  148 kn   )
     Stall speed        :    98 km/h (   53 kn   )
     Fuel capacity      :
-->
<airplane mass="2950" version="YASIM_VERSION_CURRENT" mtow-lbs="4299">

  <!-- Approach configuration -->
  <approach speed="53" aoa="6" fuel="0.2">
    <control-setting axis="/controls/engines/engine[0]/throttle"        value="0.2"/>
    <control-setting axis="/controls/engines/engine[0]/mixture"         value="1.0"/>
    <control-setting axis="/controls/engines/engine[0]/propeller-pitch" value="1.0"/>
    <control-setting axis="/controls/flight/flaps"                      value="1.0"/>
  </approach>

  <!-- Cruise configuration -->
  <cruise speed="148" alt="10500" fuel="0.5">
    <control-setting axis="/controls/engines/engine[0]/throttle"        value="0.75"/>
    <control-setting axis="/controls/engines/engine[0]/mixture"         value="0.55"/>
    <control-setting axis="/controls/engines/engine[0]/propeller-pitch" value="0.70"/>
    <control-setting axis="/controls/flight/flaps"                      value="0.00"/>
  </cruise>

  <cockpit x="1.185" y="0.000" z="0.440"/>

  <!-- Bol -->
  <fuselage ax=" 3.905" ay=" 0.000" az="-0.115" bx=" 3.823" by=" 0.000" bz="-0.115" width="0.185" taper="0.00" midpoint="1"/>
  <fuselage ax=" 3.823" ay=" 0.000" az="-0.115" bx=" 3.719" by=" 0.000" bz="-0.115" width="0.297" taper="0.62" midpoint="1"/>
  <fuselage ax=" 3.719" ay=" 0.000" az="-0.115" bx=" 3.593" by=" 0.000" bz="-0.115" width="0.297" taper="1.00" midpoint="1"/>

  <!-- Fuselage left -->
  <fuselage ax=" 3.580" ay=" 0.057" az="-0.282" bx=" 3.381" by=" 0.057" bz="-0.282" width="0.778" taper="0.66" midpoint="1"/>
  <fuselage ax=" 3.381" ay=" 0.057" az="-0.282" bx=" 2.216" by=" 0.078" bz="-0.244" width="0.994" taper="0.78" midpoint="1"/>
  <fuselage ax=" 2.216" ay=" 0.078" az="-0.244" bx="-0.028" by=" 0.078" bz="-0.244" width="0.994" taper="1.00" midpoint="1"/>
  <fuselage ax="-0.028" ay=" 0.078" az="-0.244" bx="-2.337" by=" 0.000" bz="-0.139" width="0.994" taper="0.60" midpoint="0"/>
  <!-- Fuselage center -->
  <fuselage ax="-2.337" ay=" 0.000" az="-0.139" bx="-3.891" by=" 0.000" bz="-0.109" width="0.596" taper="0.10" midpoint="0"/>
  <!-- Fuselage right -->
  <fuselage ax=" 3.580" ay="-0.057" az="-0.282" bx=" 3.381" by="-0.057" bz="-0.282" width="0.778" taper="0.66" midpoint="1"/>
  <fuselage ax=" 3.381" ay="-0.057" az="-0.282" bx=" 2.216" by="-0.078" bz="-0.244" width="0.994" taper="0.78" midpoint="1"/>
  <fuselage ax=" 2.216" ay="-0.078" az="-0.244" bx="-0.028" by="-0.078" bz="-0.244" width="0.994" taper="1.00" midpoint="1"/>
  <fuselage ax="-0.028" ay="-0.078" az="-0.244" bx="-2.337" by=" 0.000" bz="-0.139" width="0.994" taper="0.60" midpoint="0"/>

  <!-- Cabine right -->
  <fuselage ax=" 2.137" ay=" 0.000" az=" 0.016" bx=" 1.425" by=" 0.000" bz=" 0.311" width="0.867" taper="0.50" midpoint="1"/>
  <fuselage ax=" 1.595" ay=" 0.000" az=" 0.280" bx=" 0.190" by=" 0.000" bz=" 0.280" width="0.867" taper="1.00" midpoint="1"/>
  <fuselage ax=" 0.285" ay=" 0.000" az=" 0.280" bx="-0.617" by=" 0.000" bz=" 0.093" width="0.867" taper="0.40" midpoint="0"/>

  <wing x="1.277" y="0" z="-0.647"
        chord    = "2.441"
        length   = "1.160 "
        taper    = "0.72"
        dihedral = "7"
        sweep    = "7"
        camber   = "0.005">
        <stall   aoa="20" width="1" peak="1.5"/>
        <flap0 start="0.46" end="1" lift="1.5" drag="1.9"/>

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

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

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

  <wing x="1.135" y="1.142" z="-0.506"
        append   = "1"
        chord    = "1.761"
        length   = "3.820"
        taper    = "0.55"
        sweep    = "-3"
        dihedral = "7">
        <stall   aoa="20" width="1"    peak="1.5"/>
        <flap0 start="0"    end="0.43" lift="1.5" drag="1.9"/>
        <flap1 start="0.43" end="1.00" lift="1.1" 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="2"/>
  </wing>

  <hstab x="-3.117" y="0" z="0.032"
         chord  = "1.092"
         length = "1.769"
         taper  = "0.7"
         sweep  = "1">
         <stall   aoa="18" width="1" peak="1.5"/>
         <flap0 start="0"    end="1" lift="1.5" 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>

  <vstab x="-3.123" y="0" z="0.106"
         chord  = "1.287"
         length = "1.35"
         taper  = "0.70"
         sweep  = "-2">
         <stall   aoa="16" width="1"   peak="1.5"/>
         <flap0 start="0.02" end="0.9" lift="1.2" drag="1.1"/>

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

  <!-- Engines   source            : https://www.wikiwand.com/en/Continental_O-470

                 Name              : Continental O-470
                 Type              : six-cylinder air-cooled horizontally opposed aircraft piston engine
                 Maximum power     : 225 hp at 2575 rpm
                 Dry weight        : 391 lb ( 177 kg )
                 Pressure ratio    : 7.0:1
  -->
  <propeller x="2.966" y="0" z="-0.145"
             mass         = "391"
             moment       = "6"
             radius       = "0.97"
             cruise-power = "200"
             cruise-speed = "148"
             cruise-rpm   = "2300"
             cruise-alt   = "10500"
             fine-stop    = "0.5"
             coarse-stop  = "4.0"
             min-rpm      = "200"
             max-rpm      = "2575">
             <actionpt x="3.706" y="0" z="-0.115"/>
             <control-input control="ADVANCE" axis="/controls/engines/engine[0]/propeller-pitch"/>
             <piston-engine eng-power    = "225"
                            eng-rpm      = "2575"
                            displacement = "541.5"
                            compression  = "7.0">
                            <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>

  <!-- Noze wheel -->
  <gear x="3.349" y="0" z="-1.459"
        compression = "0.15"
        spring      = "2"
        stiction    = "1">
        <control-input  control="STEER"  axis="/controls/flight/rudder" square="false"/>
        <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="7"/>
  </gear>

  <!-- Left wheel -->
  <gear x="1.195" y="1.526" z="-1.368"
        compression = "0.2"
        spring      = "1.8"
        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[1]/position-norm"/>

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

  <!-- Right wheel -->
  <gear x="1.195" y="-1.526" z="-1.368"
        compression = "0.2"
        spring      = "1.8"
        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[2]/position-norm"/>

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

  <tank x="1.426" y=" 1.150" z="-0.500" capacity="612"/> <!--56-->
  <tank x="1.426" y="-1.150" z="-0.500" capacity="612"/> <!--56-->

  <!-- Mass distribution
       Dilbert : The cg should be about 1/6 chord ahead of the chord center.
                 2.441 / 6     = 0.406
                 1.277 + 0.340 = 1.683
  -->
  <ballast x="3.49" y="0" z="-0.43" mass="885"/>

</airplane>
