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

<!-- GRUMANN TBM Avenger -    2008 Emmanuel BARANGER
                 updated -    2010 with Melchior's script
                 updated -    2015 Emmanuel BARANGER
                 updated - 07/2020 Emmanuel BARANGER
                 updated - 07/2024 Emmanuel BARANGER

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

     Manufacturer     : Grumman Aircraft Engineering Co.
     Wingspan         : 54 ft 02.0 in  ( 16.51 m  )
     Lenght           : 40 ft 11.5 in  ( 12.48 m  )
     Height           : 15 ft 05.0 in  (  4.70 m  )
     Empty Weight     : 10545 lb       (  4783 kg )
     Gross weight     : 15536 lb       (  7047 kg )
     Max Speed        : 224 kts
     Cruise speed     : 213 kts
     Engine           : Wright Cyclone R-2600-20 radial engine 1900 hp
     Fuel Tank        : Center 884 lbs
                        Left   559 lbs
                        Right  570 lbs
-->
<airplane mass="10545" version="YASIM_VERSION_CURRENT" mtow-lbs="15536">

  <approach speed="80" 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/engines/engine[0]/propeller-pitch" value="1"/>
    <control-setting axis="/controls/flight/flaps"                      value="1"/>
    <control-setting axis="/controls/gear/gear-down"                    value="1"/>
  </approach>

  <cruise speed="213" alt="12000" fuel="0.5">
    <control-setting axis="/controls/engines/engine[0]/throttle"        value="0.7"/>
    <control-setting axis="/controls/engines/engine[0]/mixture"         value="0.7"/>
    <control-setting axis="/controls/engines/engine[0]/propeller-pitch" value="0.2"/>
    <control-setting axis="/controls/flight/flaps"                      value="0"/>
    <control-setting axis="/controls/gear/gear-down"                    value="0"/>
  </cruise>

  <cockpit x="2.611" y="0" z="0.756"/>

  <!-- Fuselage -->
  <fuselage ax=" 5.644" ay=" 0.000" az="-0.390" bx=" 5.270" by=" 0.000" bz="-0.386" width="1.430" taper="0.50" midpoint="1"/>
  <fuselage ax=" 5.270" ay=" 0.000" az="-0.386" bx=" 3.204" by=" 0.000" bz="-0.551" width="1.469" taper="0.90" midpoint="1"/>
  <fuselage ax=" 3.204" ay=" 0.000" az="-0.551" bx="-1.132" by=" 0.000" bz="-0.551" width="1.469" taper="1.00" midpoint="1"/>
  <fuselage ax="-1.132" ay=" 0.000" az="-0.551" bx="-3.116" by=" 0.000" bz="-0.209" width="1.469" taper="0.60" midpoint="0"/>

  <fuselage ax=" 5.270" ay=" 0.000" az="-0.386" bx=" 3.204" by=" 0.000" bz="-0.117" width="1.469" taper="0.90" midpoint="1"/>
  <fuselage ax=" 3.204" ay=" 0.000" az="-0.117" bx="-1.132" by=" 0.000" bz="-0.117" width="1.469" taper="1.00" midpoint="1"/>
  <fuselage ax="-1.132" ay=" 0.000" az="-0.117" bx="-3.116" by=" 0.000" bz="-0.209" width="1.469" taper="0.60" midpoint="0"/>

  <fuselage ax="-3.116" ay=" 0.000" az="-0.209" bx="-5.672" by=" 0.000" bz="-0.166" width="0.900" taper="0.20" midpoint="0"/>

  <!-- Cockpit -->
  <fuselage ax=" 3.233" ay=" 0.000" az=" 0.516" bx=" 2.536" by=" 0.000" bz=" 0.860" width="0.690" taper="0.20" midpoint="1"/>
  <fuselage ax=" 2.698" ay=" 0.000" az=" 0.815" bx="-0.009" by=" 0.000" bz=" 0.758" width="0.690" taper="1.00" midpoint="1"/>

  <wing x="1.302" y="0" z="-0.293"
        chord="3.716"
        length="1.947"
        taper="1"
        camber="0.05">
        <stall   aoa="20" width="1" peak="1.5"/>
        <flap0 start="0.4"  end="1" lift="1.7" drag="1.9"/>

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

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

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

  <wing x="1.302" y="1.947" z="-0.293"
        append="1"
        chord="3.716"
        length="5.985"
        taper="0.37"
        dihedral="3"
        sweep="-3">
        <stall   aoa="18" width="1"    peak="1.5"/>
        <flap0 start="0.00" end="0.60" lift="1.7" drag="1.9"/>
        <flap1 start="0.60" end="0.96" lift="1.4" drag="1.2"/>

        <control-input  control="FLAP0" axis="/controls/flight/flaps"/>
        <control-speed  control="FLAP0" transition-time="5"/>

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

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

  <hstab x="-5.159" y="0.0" z="0.553"
         chord="2.131"
         length="3.127"
         taper="0.60">
         <stall   aoa="16" 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="-5.025" y="0.00" z="-0.075"
         chord="2.289"
         length="2.411"
         taper="0.40"
         sweep="4">
         <stall aoa="14" width="1" peak="1.5"/>
         <flap0 start="0" end="1"  lift="1.5" 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>

  <!-- Wright Cyclone R-2600-20

                 source       : http://en.wikipedia.org/wiki/Wright_R-2600

                 type         : 14-cylinder supercharged air-cooled two-row radial engine
                 weight       : 2045 lb  ( 930 kg )
                 Compression  : 6.9:1
                 displacement : 2603 in3 ( 42.7 L )
                 power        : 1900 hp
  -->
  <propeller x="5.438" y="0" z="-0.393"
             radius="1.88"
             mass="2045"
             moment="110"
             cruise-alt="12000"
             cruise-power="1500"
             cruise-speed="213"
             cruise-rpm="3000"
             min-rpm="583"
             max-rpm="3100"
             contra="1">
             <actionpt x="5.809" y="0" z="-0.393"/>
             <control-input control="ADVANCE" axis="/controls/engines/engine[0]/propeller-pitch"/>
             <piston-engine eng-power="1900"
                            eng-rpm="3100"
                            displacement="2603"
                            compression="6.9">
                            <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>

  <gear x="2.381" y="1.578" z="-2.493"
        compression="0.15"
        spring="1.8"
        damp="0.3"
        on-solid="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-output control="EXTEND" prop="/gear/gear[0]/position-norm"/>

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

  <gear x="2.381" y="-1.578" z="-2.493"
        compression="0.15"
        spring="1.8"
        damp="0.3"
        on-solid="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-output control="EXTEND" prop="/gear/gear[1]/position-norm"/>

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

  <gear x="-3.734" y="0.0" z="-1.304"
        compression="0.05"
        spring="0.8"
        on-solid="1"
        sfric="1"
        dfric="1">
        <control-input  control="STEER"  axis="/controls/flight/rudder" src0="-1.0" src1="1.0" dst0=".25" dst1="-.25"/>
        <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.431" y=" 2.767" z="-0.245" capacity="559"/>
  <tank x="4.101" y=" 0.000" z="-0.355" capacity="884"/>
  <tank x="1.431" y="-2.767" z="-0.245" capacity="570"/>

  <!-- Carrier landing hook -->
  <hook x="-5.094" y="0.000" z="-0.358"
        length="1.150"
        down-angle="45"
        up-angle="-8">
        <control-input control="HEXTEND" axis="/controls/gear/tailhook"/>
        <control-speed control="HEXTEND" transition-time="4"/>
  </hook>

  <!-- Mass distribution
       Dilbert : The cg should be about 1/6 chord ahead of the chord center.
                 3.716 / 6     = 0.619
                 1.302 + 0.619 = 1.921
  -->
  <ballast x="5.1" y="0" z="-0.9" mass="1248"/>

</airplane>
