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

<!-- Beechcraft T6 Texan II - Emmanuel BARANGER 02/2022
                    Updated - Emmanuel BARANGER 01/2024
                    Updated - Emmanuel BARANGER 01/2026

     sources            : https://www.wikiwand.com/en/Beechcraft_T-6_Texan_II

     wingspan           :  10.40 m  (   34 ft 1 in )
     length             :   9.78 m  (   32 ft 1 in )
     height             :   3.21 m  (   10 ft 6 in )
     empty weight       :   4707 lb ( 2135 kg      )
     Max weight         :   6500 lb ( 2948 kg      )
     engine             : 1 Pratt & Whitney Canada PT6A-68 turboprop ( 1100 hp )
     Never exceed speed :    586 km/h ( 316 kn )
     Cruise speed       :    510 km/h ( 280 kn )
     Fuel capacity      :  677.5 liters ( 1200 lb )
-->
<airplane mass="4707" version="YASIM_VERSION_CURRENT" mtow-lbs="6500">

  <!-- Approach configuration -->
  <approach          speed="65" aoa="2"                                 fuel="0.2">
    <control-setting axis="/controls/engines/engine[0]/throttle"        value="0.2"/>
    <control-setting axis="/controls/engines/engine[0]/condition"       value="1"/>
    <control-setting axis="/controls/engines/engine[0]/propeller-pitch" value="0.3"/>
    <control-setting axis="/controls/flight/flaps"                      value="1"/>
    <control-setting axis="/controls/gear/gear-down"                    value="1"/>
  </approach>

  <!-- Cruise configuration -->
  <cruise            speed="280" alt="0"                                fuel="0.5">
    <control-setting axis="/controls/engines/engine[0]/throttle"        value="0.8"/>
    <control-setting axis="/controls/engines/engine[0]/condition"       value="1"/>
    <control-setting axis="/controls/engines/engine[0]/propeller-pitch" value="0.9"/>
    <control-setting axis="/controls/flight/flaps"                      value="0"/>
    <control-setting axis="/controls/gear/gear-down"                    value="0"/>
  </cruise>

  <cockpit x="1.105" y="0.000" z="0.540"/>

  <!-- bol -->
  <fuselage ax=" 4.891" ay=" 0.000" az="-0.053" bx=" 4.793" by=" 0.000" bz="-0.053" width="0.209" taper="0.10" midpoint="1"/>
  <fuselage ax=" 4.793" ay=" 0.000" az="-0.053" bx=" 4.646" by=" 0.000" bz="-0.053" width="0.344" taper="0.61" midpoint="1"/>
  <fuselage ax=" 4.646" ay=" 0.000" az="-0.053" bx=" 4.405" by=" 0.000" bz="-0.053" width="0.482" taper="0.71" midpoint="1"/>
  <!-- Fuselage -->
  <fuselage ax=" 4.433" ay=" 0.000" az="-0.040" bx=" 4.195" by=" 0.000" bz="-0.068" width="0.580" taper="0.80" midpoint="1"/>
  <fuselage ax=" 4.195" ay=" 0.000" az="-0.068" bx=" 3.616" by=" 0.000" bz="-0.102" width="0.790" taper="0.73" midpoint="1"/>
  <fuselage ax=" 3.616" ay=" 0.000" az="-0.102" bx=" 2.815" by=" 0.000" bz="-0.169" width="0.980" taper="0.80" midpoint="1"/>
  <fuselage ax=" 2.815" ay=" 0.000" az="-0.169" bx=" 2.524" by=" 0.000" bz="-0.172" width="1.018" taper="0.96" midpoint="1"/>
  <fuselage ax=" 2.524" ay=" 0.000" az="-0.172" bx=" 0.704" by=" 0.000" bz="-0.172" width="1.018" taper="1.00" midpoint="1"/>
  <fuselage ax=" 0.704" ay=" 0.000" az="-0.172" bx="-1.060" by=" 0.000" bz="-0.158" width="1.018" taper="1.00" midpoint="1"/>
  <fuselage ax="-1.060" ay=" 0.000" az="-0.158" bx="-2.635" by=" 0.000" bz="-0.158" width="1.018" taper="0.60" midpoint="0"/>
  <fuselage ax="-2.635" ay=" 0.000" az="-0.158" bx="-3.483" by=" 0.000" bz="-0.158" width="0.611" taper="0.60" midpoint="0"/>
  <fuselage ax="-3.483" ay=" 0.000" az="-0.158" bx="-4.302" by=" 0.000" bz="-0.101" width="0.367" taper="0.30" midpoint="0"/>
  <!-- Cockpit -->
  <fuselage ax=" 2.299" ay=" 0.000" az=" 0.016" bx=" 1.256" by=" 0.000" bz=" 0.336" width="1.018" taper="0.70" midpoint="1"/>
  <fuselage ax=" 1.363" ay=" 0.000" az=" 0.316" bx=" 0.086" by=" 0.000" bz=" 0.377" width="1.018" taper="1.00" midpoint="1"/>
  <fuselage ax=" 0.206" ay=" 0.000" az=" 0.377" bx="-1.543" by=" 0.000" bz="-0.127" width="1.018" taper="1.00" midpoint="1"/>

  <wing x="0.808" y="0.000" z="-0.710"
        chord  = "1.832"
        length = "1.270"
        taper  = "1"
        camber = "0.005">
        <stall     aoa="20" width="1" peak="1.5"/>
        <flap0   start="0"    end="1" lift="1.5" drag="1.9"/>
        <spoiler start="0.18" end="0.67" lift="0.8" drag="6.0"/>

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

        <control-output control="FLAP0"   prop="/surface-positions/flap-pos-norm"/>
        <control-output control="SPOILER" prop="/surface-positions/speedbrake-pos-norm" invert="true" />

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

  <wing x="0.808" y="1.270" z="-0.710"
        append   = "1"
        chord    = "1.832"
        length   = "3.895"
        taper    = "0.6"
        dihedral = "7"
        sweep    = "-1.5">
        <stall   aoa="20" width="1"    peak="1.5"/>
        <flap0 start="0"    end="0.41" lift="1.5" drag="1.9"/>
        <flap1 start="0.41" end="0.98" 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-speed  control="FLAP0" transition-time="2"/>
  </wing>

  <hstab x="-4.220" y="0.000" z="-0.103"
         chord  = "1.292"
         length = "1.850"
         taper  = "0.6"
         sweep  = "2">
         <stall   aoa="18" width="1" peak="1.5"/>
         <flap0 start="0"    end="1" lift="1.5" 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.549" y="0.000" z="-0.003"
         chord  = "1.539"
         length = "1.616"
         taper  = "0.50">
         <stall   aoa="16" 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"/>
         <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/Pratt_%26_Whitney_Canada_PT6

         name         : Pratt & Whitney Canada PT6A-68 turboprop
         type         : Turboprop
         weight       : 338 lb (153 kg)
         power        : 1250 hp
  -->
  <propeller x="3.430" y="0.000" z="-0.053"
             mass         = "338"
             radius       = "1.11"
             moment       = "73.211"
             cruise-speed = "280"
             cruise-rpm   = "2100"
             cruise-power = "1100"
             cruise-alt   = "19000"
             min-rpm      = "150"
             max-rpm      = "2200"
             fine-stop    = "0.25"
             coarse-stop  = "3">
             <actionpt x="4.548" y="0.000" z="-0.053"/>
             <control-input control="ADVANCE" axis="/controls/engines/engine[0]/propeller-pitch"/>
             <turbine-engine eng-power    = "1250"
                             eng-rpm      = "2300"
                             alt          = "19000"
                             flat-rating  = "1200"
                             n2-low-idle  = "32"
                             n2-high-idle = "65"
                             n2-max       = "100"
                             bsfc         = "0.35"
                             compression  = "8.7">
                             <control-input control="CONDLEVER" axis="/controls/engines/engine[0]/condition"/>
                             <control-input control="THROTTLE"  axis="/controls/engines/engine[0]/throttle"/>
             </turbine-engine>
  </propeller>

  <!-- Noze wheel -->
  <gear x="3.208" y=" 0.000" z="-1.603"
        compression = "0.2"
        spring      = "0.8"
        stiction    = "1">
        <control-input  control="STEER"     axis="/controls/flight/rudder"       square="false"/>
        <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-output control="EXTEND"    prop="/gear/gear[0]/position-norm"/>

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

  <!-- Left wheel -->
  <gear x="0.933" y=" 1.266" z="-1.523"
        compression = "0.2"
        spring      = "0.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="5.5"/>
  </gear>

  <!-- Right wheel -->
  <gear x="0.933" y="-1.266" z="-1.523"
        compression = "0.2"
        spring      = "0.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="6"/>
  </gear>

  <!-- 677.5 liters ( 1200 lb ) = 2 x 600 lb -->
  <tank x="0.870" y=" 2.300" z="-0.600" capacity="600"/>
  <tank x="0.870" y="-2.300" z="-0.600" capacity="600"/>

  <!-- Mass distribution
       Dilbert : The cg should be about 1/6 chord ahead of the chord center.
                 1.832 / 6     = 0.305
                 0.808 + 0.305 = 1.113
  -->
  <!-- <ballast x="4.000" y="0.000" z="-0.500" mass="1112"/>-->
  <ballast x="4.000" y="0.000" z="-0.500" mass="1255"/>

</airplane>
