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

<!-- Lavochkin La 5     : BARANGER Emmanuel                        (   2009 )
                Updated : BARANGER Emmanuel with Melchior's script (   2014 )
                Updated : BARANGER Emmanuel                        ( 9-2020 )
                Updated : BARANGER Emmanuel                        ( 6-2022 )
                Updated : BARANGER Emmanuel                        ( 6-2024 )

     source             : https://en.wikipedia.org/wiki/Lavochkin_La-5

     Envergure          : 9.80 m    (     32 ft 1.75 in )
     Longueur           : 8.67 m    (     28 ft 5.33 in )
     Hauteur            : 2.54 m    (      8 ft 4    in )
     Empty weight       : 2706 kg   (   5966 lb         )
     Max takeoff weight : 3402 kg   (   7500 lb         )
     Speed Max          :  648 km/h (    350 kn         ) at 6250 m ( 20505 ft )
     Moteur             : Shvetsov ASh-82FN radial engine, 1700 hp
-->
<airplane mass="5966" version="YASIM_VERSION_CURRENT" mtow-lbs="7500">

  <approach speed="90" aoa="2" fuel="0.3">
    <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="0.5"/>
    <control-setting axis="/controls/flight/flaps"                      value="1"/>
    <control-setting axis="/controls/gear/gear-down"                    value="1"/>
  </approach>

  <cruise speed="300" alt="20000" fuel="0.8">
    <control-setting axis="/controls/engines/engine[0]/throttle"        value="0.8"/>
    <control-setting axis="/controls/engines/engine[0]/mixture"         value="0.8"/>
    <control-setting axis="/controls/engines/engine[0]/propeller-pitch" value="1"/>
    <control-setting axis="/controls/flight/flaps"                      value="0"/>
    <control-setting axis="/controls/gear/gear-down"                    value="0"/>
  </cruise>

  <cockpit x="0.442" y="0" z="0.835"/>

  <!-- Bol -->
  <fuselage ax=" 4.329" ay=" 0.000" az=" 0.078" bx=" 4.237" by=" 0.000" bz=" 0.078" width="0.175" taper="0.10" midpoint="1"/>
  <fuselage ax=" 4.237" ay=" 0.000" az=" 0.078" bx=" 4.028" by=" 0.000" bz=" 0.078" width="0.501" taper="0.38" midpoint="1"/>
  <fuselage ax=" 4.028" ay=" 0.000" az=" 0.078" bx=" 3.802" by=" 0.000" bz=" 0.078" width="0.599" taper="0.84" midpoint="1"/>

  <!-- Fuselage up -->
  <fuselage ax=" 2.733" ay=" 0.000" az=" 0.094" bx=" 2.167" by=" 0.000" bz=" 0.252" width="1.232" taper="0.86" midpoint="0"/>
  <fuselage ax=" 2.380" ay=" 0.000" az=" 0.252" bx="-0.190" by=" 0.000" bz=" 0.252" width="1.060" taper="1.00" midpoint="0"/>
  <fuselage ax="-0.190" ay=" 0.000" az=" 0.252" bx="-1.786" by=" 0.000" bz=" 0.515" width="1.060" taper="0.60" midpoint="0"/>
  <fuselage ax="-1.786" ay=" 0.000" az=" 0.515" bx="-3.547" by=" 0.000" bz=" 0.742" width="0.636" taper="0.30" midpoint="0"/>

  <!-- Fuselage down -->
  <fuselage ax=" 3.806" ay=" 0.000" az=" 0.078" bx=" 3.659" by=" 0.000" bz=" 0.078" width="1.047" taper="0.80" midpoint="1"/>
  <fuselage ax=" 3.659" ay=" 0.000" az=" 0.078" bx=" 3.404" by=" 0.000" bz=" 0.078" width="1.232" taper="0.85" midpoint="1"/>
  <fuselage ax=" 3.404" ay=" 0.000" az=" 0.078" bx=" 2.884" by=" 0.000" bz=" 0.078" width="1.232" taper="1.00" midpoint="1"/>
  <fuselage ax=" 2.884" ay=" 0.000" az=" 0.078" bx=" 2.302" by=" 0.000" bz="-0.002" width="1.232" taper="0.86" midpoint="0"/>
  <fuselage ax=" 2.380" ay=" 0.000" az="-0.002" bx="-0.190" by=" 0.000" bz="-0.002" width="1.060" taper="1.00" midpoint="0"/>
  <fuselage ax="-0.190" ay=" 0.000" az="-0.002" bx="-1.808" by=" 0.000" bz="-0.002" width="1.060" taper="0.60" midpoint="0"/>
  <fuselage ax="-1.808" ay=" 0.000" az="-0.002" bx="-3.547" by=" 0.000" bz=" 0.199" width="0.636" taper="0.30" midpoint="0"/>

  <fuselage ax="-1.808" ay=" 0.000" az=" 0.261" bx="-3.547" by=" 0.000" bz=" 0.462" width="0.636" taper="0.30" midpoint="0"/>

  <!-- Cockpit -->
  <fuselage ax=" 1.355" ay=" 0.000" az=" 0.662" bx=" 1.073" by=" 0.000" bz=" 0.662" width="0.564" taper="0.30" midpoint="1"/>
  <fuselage ax=" 1.073" ay=" 0.000" az=" 0.662" bx=" 0.850" by=" 0.000" bz=" 0.662" width="0.705" taper="0.80" midpoint="1"/>
  <fuselage ax=" 0.850" ay=" 0.000" az=" 0.662" bx=" 0.160" by=" 0.000" bz=" 0.662" width="0.705" taper="1.00" midpoint="1"/>
  <fuselage ax=" 0.160" ay=" 0.000" az=" 0.662" bx="-1.743" by=" 0.000" bz=" 0.662" width="0.705" taper="0.42" midpoint="0"/>

  <wing x="1.047" y="0" z="-0.441"
        chord    = "2.581"
        length   = "4.893"
        taper    = "0.40"
        dihedral = "4"
        sweep    = "-4"
        camber   = "0.005">
        <stall   aoa="20" width="1"    peak="1.5"/>
        <flap0 start="0.11" end="0.63" lift="1.7" drag="1.9"/>
        <flap1 start="0.63" end="0.96" 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" 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="-3.143" y="0" z="0.529"
         chord  = "1.519"
         length = "1.698"
         sweep  = "9"
         taper  = "0.35">
         <stall   aoa="20" 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.556" y="0" z="0.037"
         chord  = "1.981"
         length = "1.641"
         taper  = "0.41">
         <stall   aoa="20" 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>

  <!-- Engines   source            : http://en.wikipedia.org/wiki/Shvetsov_ASh-82

                 name              : Shvetsov ASh-82FN
                 type              : 14-cylinder two-row radial engine
                 power cruise      : 1700 hp at 2350 rpm
                 weight            : 890 kg (1962 lb)
                 Displacement      : 2515.3 in3 (41.218 L)
                 Compression       : 7.05:1
                 Propeller diameter: 3.4 m (11 ft 1.85 in)
                 Reduction gear    : 9:16  (0.5625)

             gear-ratio="0.5625"
  -->
  <propeller x="3.029" y="0" z="0.079"
             mass         = "1962"
             radius       = "1.55"
             moment       = "15"
             cruise-alt   = "20000"
             cruise-power = "1600"
             cruise-speed = "300"
             cruise-rpm   = "2500"
             min-rpm      = "200"
             max-rpm      = "2700">
             <actionpt x="3.932" y="0" z="0.079"/>
             <control-input control="ADVANCE" axis="/controls/engines/engine[0]/propeller-pitch"/>
             <piston-engine eng-power    = "1700"
                            eng-rpm      = "2700"
                            displacement = "2515.3"
                            compression  = "7.05">
                            <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>

  <!-- left main -->
  <gear x="2.218" y="1.354" z="-1.711"
        compression = "0.4"
        spring      = "0.8"
        damp        = "1.2"
        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-output control="EXTEND" prop="gear/gear[0]/position-norm"/>

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

  <!-- right main -->
  <gear x="2.218" y="-1.354" z="-1.711"
        compression = "0.4"
        spring      = "0.8"
        damp        = "1.2"
        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-output control="EXTEND" prop="gear/gear[1]/position-norm"/>

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

  <!-- Tail wheel -->
  <gear x="-3.025" y="0" z="-0.469"
        compression = "0.2"
        spring      = "0.8"
        damp        = "1.2"
        stiction    = "1">
        <control-input  control="STEER"  axis="/controls/flight/rudder" src0="-1.0" src1="1.0" dst0="0.25" dst1="-0.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="4"/>
  </gear>

  <tank x=" 1.540" y=" 1.267" z="-0.345" capacity="570"/>
  <tank x=" 0.100" y=" 0.000" z="-0.355" capacity="884"/>
  <tank x=" 1.540" y="-1.267" z="-0.345" capacity="570"/>

  <!-- Mass distribution
       Dilbert : The cg should be about 1/6 chord ahead of the chord center.
                 2.581 / 6     = 0.430
                 1.047 + 0.430 = 1.477
  -->
  <ballast x="3.500" y="0" z="-0.100" mass="510"/>

</airplane>
