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

<!--  AC130 YASim config. -     2008 Emmanuel BARANGER
                                2010 updated by Jettoo
                                2010 updated by helijah
                                2010 updated by glazmax
                                2016 updated by Emmanuel BARANGER
                                2022 updated by Emmanuel BARANGER
                             07/2024 updated by Emmanuel BARANGER

      Source    : https://www.wikiwand.com/en/Lockheed_C-130_Hercules

      Wingspan           :    132 ft 7 in ( 40.41 m  )
      Length             :     97 ft 9 in ( 29.79 m  )
      Height             :     38 ft 3 in ( 11.66 m  )
      Empty weight       :  75800 lb      ( 34382 kg )
      Max takeoff weight : 155000 lb      ( 70307 kg )
      Powerplant         : 4 Allison T56-A-15 turboprops 4591 CV, 13820 RPM, 1940 lb (880 kg)
      Propellers         : Hamilton Standard 43E60-6901A (1074 lbs)
      Maximum speed      :    320 kn      ( 590 km/h ) at 20000 ft ( 6100 m )
      Cruise speed       :    292 kn      ( 541 km/h )
-->
<airplane mass="75800" version="YASIM_VERSION_CURRENT" mtow-lbs="155000">

  <!-- Configuration d'approche -->
  <approach speed="123" aoa="2" fuel="1">
    <control-setting axis="/controls/engines/engine[0]/throttle"        value="0.3"/>
    <control-setting axis="/controls/engines/engine[1]/throttle"        value="0.3"/>
    <control-setting axis="/controls/engines/engine[2]/throttle"        value="0.3"/>
    <control-setting axis="/controls/engines/engine[3]/throttle"        value="0.3"/>
    <control-setting axis="/controls/engines/engine[0]/propeller-pitch" value="1"/>
    <control-setting axis="/controls/engines/engine[1]/propeller-pitch" value="1"/>
    <control-setting axis="/controls/engines/engine[2]/propeller-pitch" value="1"/>
    <control-setting axis="/controls/engines/engine[3]/propeller-pitch" value="1"/>
    <control-setting axis="/controls/flight/flaps"                      value="0.7"/>
    <control-setting axis="/controls/gear/gear-down"                    value="1"/>
  </approach>

  <!-- Configuration de croisiere -->
  <cruise speed="292" alt="20000" fuel="0.7">
    <control-setting axis="/controls/engines/engine[0]/throttle"        value="0.7"/>
    <control-setting axis="/controls/engines/engine[1]/throttle"        value="0.7"/>
    <control-setting axis="/controls/engines/engine[2]/throttle"        value="0.7"/>
    <control-setting axis="/controls/engines/engine[3]/throttle"        value="0.7"/>
    <control-setting axis="/controls/engines/engine[0]/propeller-pitch" value="0.8"/>
    <control-setting axis="/controls/engines/engine[1]/propeller-pitch" value="0.8"/>
    <control-setting axis="/controls/engines/engine[2]/propeller-pitch" value="0.8"/>
    <control-setting axis="/controls/engines/engine[3]/propeller-pitch" value="0.8"/>
    <control-setting axis="/controls/flight/flaps"                      value="0"/>
    <control-setting axis="/controls/gear/gear-down"                    value="0"/>
  </cruise>

  <cockpit x="11.966" y="0.598" z="-2.070"/>

  <!-- Fuselage -->
  <fuselage ax=" 14.817" ay=" 0.000" az="-3.853" bx=" 13.393" by=" 0.000" bz="-3.853" width="2.000" taper="0.40" midpoint="1"/>
  <fuselage ax=" 13.593" ay=" 0.000" az="-3.963" bx=" 10.493" by=" 0.000" bz="-3.063" width="4.360" taper="0.42" midpoint="1"/>
  <fuselage ax=" 11.093" ay=" 0.000" az="-3.033" bx=" -2.506" by=" 0.000" bz="-3.033" width="4.304" taper="1.00" midpoint="1"/>
  <fuselage ax=" -2.206" ay=" 0.000" az="-3.033" bx=" -9.603" by=" 0.000" bz="-1.583" width="4.304" taper="0.30" midpoint="0"/>
  <fuselage ax=" -9.609" ay=" 0.000" az="-1.583" bx="-14.820" by=" 0.000" bz="-0.908" width="1.300" taper="0.10" midpoint="0"/>

  <!-- engines -->
  <!-- Exterior left up -->
  <fuselage ax="  5.124" ay=" 9.821" az="-1.358" bx=" 4.639" by=" 9.821" bz="-1.358" width="1.050" taper="0.70" midpoint="1"/>
  <fuselage ax="  4.639" ay=" 9.821" az="-1.358" bx=" 2.629" by=" 9.821" bz="-1.358" width="1.050" taper="1.00" midpoint="1"/>
  <fuselage ax="  2.629" ay=" 9.821" az="-1.358" bx=" 0.483" by=" 9.821" bz="-1.358" width="1.050" taper="0.50" midpoint="0"/>
  <!-- down -->
  <fuselage ax="  5.124" ay=" 9.821" az="-2.149" bx=" 4.639" by=" 9.821" bz="-2.149" width="1.050" taper="0.70" midpoint="1"/>
  <fuselage ax="  4.639" ay=" 9.821" az="-2.149" bx=" 2.629" by=" 9.821" bz="-2.149" width="1.050" taper="1.00" midpoint="1"/>
  <fuselage ax="  2.806" ay=" 9.821" az="-2.176" bx=" 0.483" by=" 9.821" bz="-1.358" width="1.050" taper="0.50" midpoint="0"/>

  <!-- Interior left up -->
  <fuselage ax="  5.124" ay=" 4.929" az="-1.358" bx=" 4.639" by=" 4.929" bz="-1.358" width="1.050" taper="0.70" midpoint="1"/>
  <fuselage ax="  4.639" ay=" 4.929" az="-1.358" bx=" 2.629" by=" 4.929" bz="-1.358" width="1.050" taper="1.00" midpoint="1"/>
  <fuselage ax="  2.629" ay=" 4.929" az="-1.358" bx=" 0.483" by=" 4.929" bz="-1.358" width="1.050" taper="0.50" midpoint="0"/>
  <!-- down -->
  <fuselage ax="  5.124" ay=" 4.929" az="-2.149" bx=" 4.639" by=" 4.929" bz="-2.149" width="1.050" taper="0.70" midpoint="1"/>
  <fuselage ax="  4.639" ay=" 4.929" az="-2.149" bx=" 2.629" by=" 4.929" bz="-2.149" width="1.050" taper="1.00" midpoint="1"/>
  <fuselage ax="  2.806" ay=" 4.929" az="-2.176" bx=" 0.483" by=" 4.929" bz="-1.358" width="1.050" taper="0.50" midpoint="0"/>

  <!-- Interior right up -->
  <fuselage ax="  5.124" ay="-4.929" az="-1.358" bx=" 4.639" by="-4.929" bz="-1.358" width="1.050" taper="0.70" midpoint="1"/>
  <fuselage ax="  4.639" ay="-4.929" az="-1.358" bx=" 2.629" by="-4.929" bz="-1.358" width="1.050" taper="1.00" midpoint="1"/>
  <fuselage ax="  2.629" ay="-4.929" az="-1.358" bx=" 0.483" by="-4.929" bz="-1.358" width="1.050" taper="0.50" midpoint="0"/>
  <!-- down -->
  <fuselage ax="  5.124" ay="-4.929" az="-2.149" bx=" 4.639" by="-4.929" bz="-2.149" width="1.050" taper="0.70" midpoint="1"/>
  <fuselage ax="  4.639" ay="-4.929" az="-2.149" bx=" 2.629" by="-4.929" bz="-2.149" width="1.050" taper="1.00" midpoint="1"/>
  <fuselage ax="  2.806" ay="-4.929" az="-2.176" bx=" 0.483" by="-4.929" bz="-1.358" width="1.050" taper="0.50" midpoint="0"/>

  <!-- Exterior left up -->
  <fuselage ax="  5.124" ay="-9.821" az="-1.358" bx=" 4.639" by="-9.821" bz="-1.358" width="1.050" taper="0.70" midpoint="1"/>
  <fuselage ax="  4.639" ay="-9.821" az="-1.358" bx=" 2.629" by="-9.821" bz="-1.358" width="1.050" taper="1.00" midpoint="1"/>
  <fuselage ax="  2.629" ay="-9.821" az="-1.358" bx=" 0.483" by="-9.821" bz="-1.358" width="1.050" taper="0.50" midpoint="0"/>
  <!-- down -->
  <fuselage ax="  5.124" ay="-9.821" az="-2.149" bx=" 4.639" by="-9.821" bz="-2.149" width="1.050" taper="0.70" midpoint="1"/>
  <fuselage ax="  4.639" ay="-9.821" az="-2.149" bx=" 2.629" by="-9.821" bz="-2.149" width="1.050" taper="1.00" midpoint="1"/>
  <fuselage ax="  2.806" ay="-9.821" az="-2.176" bx=" 0.483" by="-9.821" bz="-1.358" width="1.050" taper="0.50" midpoint="0"/>

  <!-- fuel tank left -->
  <fuselage ax="  4.505" ay=" 7.695" az="-2.881" bx=" 4.186" by=" 7.695" bz="-2.881" width="0.695" taper="0.40" midpoint="1"/>
  <fuselage ax="  4.186" ay=" 7.695" az="-2.881" bx=" 3.752" by=" 7.695" bz="-2.881" width="0.937" taper="0.74" midpoint="1"/>
  <fuselage ax="  3.752" ay=" 7.695" az="-2.881" bx=" 2.976" by=" 7.695" bz="-2.881" width="1.143" taper="0.82" midpoint="1"/>
  <fuselage ax="  2.976" ay=" 7.695" az="-2.881" bx="-0.587" by=" 7.695" bz="-2.881" width="1.143" taper="1.00" midpoint="1"/>
  <fuselage ax=" -0.587" ay=" 7.695" az="-2.881" bx="-3.198" by=" 7.695" bz="-2.881" width="1.143" taper="0.00" midpoint="0"/>

  <!-- fuel tank right -->
  <fuselage ax="  4.505" ay="-7.695" az="-2.881" bx=" 4.186" by="-7.695" bz="-2.881" width="0.695" taper="0.40" midpoint="1"/>
  <fuselage ax="  4.186" ay="-7.695" az="-2.881" bx=" 3.752" by="-7.695" bz="-2.881" width="0.937" taper="0.74" midpoint="1"/>
  <fuselage ax="  3.752" ay="-7.695" az="-2.881" bx=" 2.976" by="-7.695" bz="-2.881" width="1.143" taper="0.82" midpoint="1"/>
  <fuselage ax="  2.976" ay="-7.695" az="-2.881" bx="-0.587" by="-7.695" bz="-2.881" width="1.143" taper="1.00" midpoint="1"/>
  <fuselage ax=" -0.587" ay="-7.695" az="-2.881" bx="-3.198" by="-7.695" bz="-2.881" width="1.143" taper="0.00" midpoint="0"/>

  <wing x=" 0.107" y="0" z="-1.423"
        chord  = "5.201"
        length = "5.700"
        taper  = "1"
        camber = "0.1">
        <stall   aoa="16" width="1" peak="1.5"/>
        <flap0 start="0.37" end="1" lift="1.5" drag="1.8"/>

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

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

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

  <wing x=" 0.107" y="5.700" z="-1.423"
        append   = "1"
        chord    = "5.201"
        length   = "14.429"
        taper    = "0.565"
        sweep    = "-3"
        dihedral = "2.5"
        twist    = "-3"
        camber   = "0.1">
        <stall   aoa="16" width="1"   peak="1.5"/>
        <flap0 start="0.00" end="0.58" lift="1.5" drag="1.8"/>
        <flap1 start="0.58" end="0.99" lift="1.2" 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="5"/>
  </wing>

  <hstab x="-11.054" y="0" z="-0.993"
         chord  = "4.494"
         length = "7.862"
         taper  = "0.43"
         sweep  = "5">
         <stall   aoa="20" width="1" peak="1.5"/>
         <flap0 start="0.15" 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="-10.587" y="0" z="-0.787"
         chord  = "5.776"
         length = "6.704"
         taper  = "0.32"
         sweep  = "8">
         <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"/>
  </vstab>

  <!-- Sources : http://en.wikipedia.org/wiki/Allison_T56

       Engines   : Allison T56
       Type      : Turboprop
       Power     : 5565 ch
       Masse     : 1940 lb (880 kg)
       RPM       : 2400 - 2600

       Propeller : Hamilton Standard 43E60-6901A (1074 lbs)

       engine + propeller = 1940 + 1074 = 3014
  -->
  <!-- Exterieur gauche -->
  <propeller x="3.813" y="9.821" z="-1.776"
             mass         = "3014"
             moment       = "55"
             radius       = "2.05"
             cruise-speed = "292"
             cruise-rpm   = "2000"
             cruise-power = "4500"
             cruise-alt   = "20000"
             min-rpm      = "220"
             max-rpm      = "2600">
             <actionpt x="5.357" y="9.821" z="-1.461"/>
             <control-input control="ADVANCE" axis="/controls/engines/engine[0]/propeller-pitch"/>
             <turbine-engine eng-power   = "5565"
                             eng-rpm     = "2600"
                             alt         = "20000"
                             flat-rating = "4150"
                             min-n2      = "70"
                             max-n2      = "100">
                             <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="BOOST"    axis="/controls/engines/engine[0]/boost"/>
             </turbine-engine>
  </propeller>

  <!-- Interieur gauche -->
  <propeller x="3.813" y="4.929" z="-1.776"
             mass         = "3014"
             moment       = "55"
             radius       = "2.05"
             cruise-speed = "292"
             cruise-rpm   = "2000"
             cruise-power = "4500"
             cruise-alt   = "20000"
             min-rpm      = "220"
             max-rpm      = "2600">
             <actionpt x="5.357" y="4.926" z="-1.461"/>
             <control-input control="ADVANCE" axis="/controls/engines/engine[1]/propeller-pitch"/>
             <turbine-engine eng-power   = "5565"
                             eng-rpm     = "2600"
                             alt         = "20000"
                             flat-rating = "4150"
                             min-n2      = "70"
                             max-n2      = "100">
                             <control-input control="THROTTLE" axis="/controls/engines/engine[1]/throttle"/>
                             <control-input control="STARTER"  axis="/controls/engines/engine[1]/starter"/>
                             <control-input control="MAGNETOS" axis="/controls/engines/engine[1]/magnetos"/>
                             <control-input control="BOOST"    axis="/controls/engines/engine[1]/boost"/>
             </turbine-engine>
  </propeller>

  <!-- Interieur droit -->
  <propeller x="3.813" y="-4.929" z="-1.776"
             mass         = "3014"
             moment       = "55"
             radius       = "2.05"
             cruise-speed = "292"
             cruise-rpm   = "2000"
             cruise-power = "4500"
             cruise-alt   = "20000"
             min-rpm      = "220"
             max-rpm      = "2600">
             <actionpt x="5.357" y="-4.926" z="-1.461"/>
             <control-input control="ADVANCE" axis="/controls/engines/engine[2]/propeller-pitch"/>
             <turbine-engine eng-power   = "5565"
                             eng-rpm     = "2600"
                             alt         = "20000"
                             flat-rating = "4150"
                             min-n2      = "70"
                             max-n2      = "100">
                             <control-input control="THROTTLE" axis="/controls/engines/engine[2]/throttle"/>
                             <control-input control="STARTER"  axis="/controls/engines/engine[2]/starter"/>
                             <control-input control="MAGNETOS" axis="/controls/engines/engine[2]/magnetos"/>
                             <control-input control="BOOST"    axis="/controls/engines/engine[2]/boost"/>
             </turbine-engine>
  </propeller>

  <!-- Exterieur droit -->
  <propeller x="3.813" y="-9.821" z="-1.776"
             mass         = "3014"
             moment       = "55"
             radius       = "2.05"
             cruise-speed = "292"
             cruise-rpm   = "2000"
             cruise-power = "4500"
             cruise-alt   = "20000"
             min-rpm      = "220"
             max-rpm      = "2600">
             <actionpt x="5.357" y="-9.821" z="-1.461"/>
             <control-input control="ADVANCE" axis="/controls/engines/engine[3]/propeller-pitch"/>
             <turbine-engine eng-power   = "5565"
                             eng-rpm     = "2600"
                             alt         = "20000"
                             flat-rating = "4150"
                             min-n2      = "70"
                             max-n2      = "100">
                             <control-input control="THROTTLE" axis="/controls/engines/engine[3]/throttle"/>
                             <control-input control="STARTER"  axis="/controls/engines/engine[3]/starter"/>
                             <control-input control="MAGNETOS" axis="/controls/engines/engine[3]/magnetos"/>
                             <control-input control="BOOST"    axis="/controls/engines/engine[3]/boost"/>
             </turbine-engine>
  </propeller>

  <!-- trusters for reverse -->
  <thruster x="5.357" y="4.926" z="-1.461"
            vx="-1" vy="0" vz="0"
            thrust = "15000">
            <control-input control="THROTTLE" axis="/controls/engines/engine[0]/reverser" src0="0" src1="1" dst0="0" dst1="1"/>
  </thruster>

  <thruster x="5.357" y="-4.926" z="-1.461"
            vx="-1" vy="0" vz="0"
            thrust = "15000">
            <control-input control="THROTTLE" axis="/controls/engines/engine[0]/reverser" src0="0" src1="1" dst0="0" dst1="1"/>
  </thruster>

  <!-- Poition des roues au sol -->
  <!-- Nez -->
  <gear x="11.104" y="0" z="-5.961"
        compression = "0.45"
        spring      = "5"
        damp        = "1.35"
        stiction    = "1">
        <control-input  control="STEER"  axis="/controls/flight/rudder" src0="-1.0" src1="1.0" dst0="-1" dst1="1"/>
        <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>

  <!-- Gauche avant -->
  <gear x="2.424" y="2.125" z="-5.979"
        compression = "0.45"
        spring      = "5"
        damp        = "1.10"
        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="8"/>
  </gear>

  <!-- Droite avant -->
  <gear x="2.424" y="-2.125" z="-5.979"
        compression = "0.45"
        spring      = "5"
        damp        = "1.10"
        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="8"/>
  </gear>

  <!-- Gauche arriere -->
  <gear x=" 0.891" y="2.125" z="-5.979"
        compression = "0.35"
        spring      = "5"
        damp        = "1.23"
        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[3]/position-norm"/>

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

  <!-- Droite arriere -->
  <gear x=" 0.891" y="-2.125" z="-5.979"
        compression = "0.35"
        spring      = "5"
        damp        = "1.23"
        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[4]/position-norm"/>

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

  <!-- Reservoirs de carburant -->
  <!-- 0 et 1 - Reservoirs principaux d'extremites -->
  <!-- adjusted tanks to get a balanced aircraft/approx position)-->
  <tank x=" 1.393" y=" 14.732" z="-1.156" capacity="8710"/>
  <tank x=" 1.393" y="-14.732" z="-1.156" capacity="8710"/>

  <!-- 2 et 3 - Reservoirs principaux interieurs -->
  <tank x=" 1.193" y="  7.041" z="-1.287" capacity="7995"/>
  <tank x=" 1.193" y=" -7.041" z="-1.287" capacity="7995"/>

  <!-- 4 et 5 - Reservoirs auxiliaires -->
  <tank x=" 1.193" y="  2.451" z="-1.313" capacity="5915"/>
  <tank x=" 1.193" y=" -2.451" z="-1.313" capacity="5915"/>

  <!-- 6 et 7 - Reservoirs supplementaires sur pylones -->
  <tank x=" 1.460" y="  7.701" z="-2.904" capacity="5299"/>
  <tank x=" 1.460" y=" -7.701" z="-2.904" capacity="5299"/>

  <!-- Mass distribution
       Dilbert : The cg should be about 1/6 chord ahead of the chord center.
                 5.201 / 6     = 0.866
                 0.107 + 0.866 = 0.973 - 1.537 rl
  -->
  <ballast x="13.494" y="0.000" z="-4.683" mass="10910"/>

</airplane>
