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

<!-- PZL P.37 Los     - Emmanuel BARANGER   10/2025

     sources          : https://www.wikiwand.com/en/articles/PZL.37_%C5%81o%C5%9B

     wingspan         : 17.93 m    (    58 ft 10 in )
     length           : 12.92 m    (    42 ft  5 in )
     height           :  5.10 m    (    16 ft  9 in )
     Maximum speed    :   412 km/h (   222 kn       ) at 2800 m ( 9186 ft )
     empty weight     :  4280 kg   (  9436 lb       )
     Gross weight     :  8865 kg   ( 19544 lb       )
     engine           : 2 PZL Pegaz XX 9-cylinder air-cooled radial piston engines, ( 970 hp each )
     fuel quantity    : 2084 lbs   ( 945 kg         )
-->
<airplane mass="9436" version="YASIM_VERSION_CURRENT" mtow-lbs="19544">

  <approach speed="75" aoa="2" fuel="0.2">
    <control-setting axis="/controls/engines/engine[0]/throttle" value="0.3"/>
    <control-setting axis="/controls/engines/engine[0]/mixture"  value="1.0"/>

    <control-setting axis="/controls/engines/engine[1]/throttle" value="0.3"/>
    <control-setting axis="/controls/engines/engine[1]/mixture"  value="1.0"/>

    <control-setting axis="/controls/flight/flaps"               value="1"/>
    <control-setting axis="/controls/gear/gear-down"             value="1"/>
  </approach>

  <cruise speed="200" alt="14764" fuel="0.6">
    <control-setting axis="/controls/engines/engine[0]/throttle" value="0.8"/>
    <control-setting axis="/controls/engines/engine[0]/mixture"  value="1.0"/>

    <control-setting axis="/controls/engines/engine[1]/throttle" value="0.8"/>
    <control-setting axis="/controls/engines/engine[1]/mixture"  value="1.0"/>

    <control-setting axis="/controls/flight/flaps"               value="0"/>
    <control-setting axis="/controls/gear/gear-down"             value="0"/>
  </cruise>

  <cockpit x="2.930" y="0" z="0.842"/>

  <!-- Fuselage Up -->
  <fuselage ax=" 6.467" ay=" 0.000" az=" 0.821" bx=" 6.191" by=" 0.000" bz=" 0.989" width="0.490" taper="0.30" midpoint="1"/>
  <fuselage ax=" 6.191" ay=" 0.000" az=" 0.984" bx=" 5.649" by=" 0.000" bz=" 1.129" width="0.746" taper="0.60" midpoint="1"/>
  <fuselage ax=" 5.701" ay=" 0.000" az=" 1.144" bx=" 4.640" by=" 0.000" bz=" 1.144" width="1.026" taper="0.70" midpoint="1"/>
  <fuselage ax=" 4.640" ay=" 0.000" az=" 1.156" bx=" 0.000" by=" 0.000" bz=" 1.156" width="1.026" taper="1.00" midpoint="1"/>
  <fuselage ax=" 0.006" ay=" 0.000" az=" 1.161" bx="-6.406" by=" 0.000" bz=" 0.723" width="1.026" taper="0.10" midpoint="0"/>

  <!-- Fuselage Down -->
  <fuselage ax=" 6.467" ay=" 0.000" az=" 0.641" bx=" 6.191" by=" 0.000" bz=" 0.473" width="0.490" taper="0.30" midpoint="1"/>
  <fuselage ax=" 6.191" ay=" 0.000" az=" 0.418" bx=" 5.649" by=" 0.000" bz=" 0.273" width="0.746" taper="0.60" midpoint="1"/>
  <fuselage ax=" 5.701" ay=" 0.000" az=" 0.252" bx=" 4.640" by=" 0.000" bz=" 0.252" width="1.026" taper="0.70" midpoint="1"/>
  <fuselage ax=" 4.640" ay=" 0.000" az=" 0.252" bx=" 0.000" by=" 0.000" bz=" 0.392" width="1.026" taper="1.00" midpoint="1"/>
  <fuselage ax=" 0.006" ay=" 0.000" az=" 0.374" bx="-6.406" by=" 0.000" bz=" 0.670" width="1.026" taper="0.10" midpoint="0"/>

  <!-- Cockpit -->
  <fuselage ax=" 4.277" ay=" 0.000" az=" 1.444" bx=" 3.813" by=" 0.000" bz=" 1.670" width="0.695" taper="0.50" midpoint="1"/>
  <fuselage ax=" 3.945" ay=" 0.000" az=" 1.639" bx="-0.161" by=" 0.000" bz=" 1.639" width="0.695" taper="1.00" midpoint="1"/>

  <!-- Bol left -->
  <fuselage ax=" 5.188" ay=" 2.501" az=" 0.242" bx=" 5.054" by=" 2.501" bz=" 0.242" width="0.296" taper="0.10" midpoint="1"/>
  <fuselage ax=" 5.054" ay=" 2.501" az=" 0.242" bx=" 4.900" by=" 2.501" bz=" 0.242" width="0.474" taper="0.63" midpoint="1"/>
  <fuselage ax=" 4.900" ay=" 2.501" az=" 0.242" bx=" 4.648" by=" 2.501" bz=" 0.242" width="0.590" taper="0.80" midpoint="1"/>
  <fuselage ax=" 4.648" ay=" 2.501" az=" 0.242" bx=" 4.471" by=" 2.501" bz=" 0.242" width="0.590" taper="1.00" midpoint="1"/>

  <!-- Bol right -->
  <fuselage ax=" 5.188" ay="-2.501" az=" 0.242" bx=" 5.054" by="-2.501" bz=" 0.242" width="0.296" taper="0.10" midpoint="1"/>
  <fuselage ax=" 5.054" ay="-2.501" az=" 0.242" bx=" 4.900" by="-2.501" bz=" 0.242" width="0.474" taper="0.63" midpoint="1"/>
  <fuselage ax=" 4.900" ay="-2.501" az=" 0.242" bx=" 4.648" by="-2.501" bz=" 0.242" width="0.590" taper="0.80" midpoint="1"/>
  <fuselage ax=" 4.648" ay="-2.501" az=" 0.242" bx=" 4.471" by="-2.501" bz=" 0.242" width="0.590" taper="1.00" midpoint="1"/>

  <!-- Engine left -->
  <fuselage ax=" 4.541" ay=" 2.501" az=" 0.242" bx=" 4.212" by=" 2.501" bz=" 0.242" width="1.555" taper="0.80" midpoint="1"/>
  <fuselage ax=" 4.212" ay=" 2.501" az=" 0.242" bx=" 3.762" by=" 2.501" bz=" 0.242" width="1.555" taper="0.80" midpoint="0"/>
  <fuselage ax=" 3.754" ay=" 2.501" az=" 0.242" bx=" 1.562" by=" 2.501" bz=" 0.242" width="1.070" taper="1.00" midpoint="1"/>
  <fuselage ax=" 1.562" ay=" 2.501" az=" 0.242" bx=" 0.451" by=" 2.501" bz=" 0.242" width="1.070" taper="0.30" midpoint="0"/>

  <!-- Engine right -->
  <fuselage ax=" 4.541" ay="-2.501" az=" 0.242" bx=" 4.212" by="-2.501" bz=" 0.242" width="1.555" taper="0.80" midpoint="1"/>
  <fuselage ax=" 4.212" ay="-2.501" az=" 0.242" bx=" 3.762" by="-2.501" bz=" 0.242" width="1.555" taper="0.80" midpoint="0"/>
  <fuselage ax=" 3.754" ay="-2.501" az=" 0.242" bx=" 1.562" by="-2.501" bz=" 0.242" width="1.070" taper="1.00" midpoint="1"/>
  <fuselage ax=" 1.562" ay="-2.501" az=" 0.242" bx=" 0.451" by="-2.501" bz=" 0.242" width="1.070" taper="0.30" midpoint="0"/>

  <wing x="0.590" y="0.000" z="0.440"
        chord="5.666"
        length="2.300"
        taper="0.68"
        sweep="-24"
        camber="0.005">
        <stall   aoa="18" width="1" peak="1.5"/>
        <flap0 start="0.26" end="1" lift="1.40" drag="3.0"/>

        <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="1.525" y="2.101" z="0.440"
        append="1"
        chord="3.843"
        length="6.859"
        taper="0.5"
        sweep="-2">
        <stall   aoa="18" width="1"    peak="1.5"/>
        <flap0 start="0.00" end="0.53" lift="1.40" drag="3.0"/>
        <flap1 start="0.53" end="0.91" lift="1.20" 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="-5.202" y="0.000" z="0.756"
         chord="2.326"
         length="2.967"
         taper="0.44"
         sweep="6">
         <stall   aoa="16" width="1"    peak="1.5"/>
         <flap0 start="0"    end="0.84" lift="1.2" 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="-4.565" y="0.000" z="0.830"
         chord="3.517"
         length="2.817"
         taper="0.3"
         sweep="18">
         <stall   aoa="14" width="1" peak="1.5"/>
         <flap0 start="0"    end="1" lift="1.6" 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            : https://www.wikiwand.com/en/articles/Bristol_Pegasus

                 name              : Bristol Pegasus / PZL Pegaz XX
                 type              : 9-cylinder, single-row, supercharged, air-cooled
                 Power
                        Take-off   : 965 hp at 2475 rpm
                        Maximum    : 835 hp at 2250 rpm at 2600 m (  8500 ft )
                        Emergency  : 965 hp at 2600 rpm at 4000 m ( 13000 ft ) 5 min only
                 weight            : 1111 lb    (  504   kg  )
                 displacement      : 1753 cu in (   28.7 L   )
                 Compression ratio : 6.25:1
  -->
  <propeller x="4.167" y="2.501" z="0.242"
             radius="1.844"
             mass="1111"
             moment="15"
             cruise-speed="200"
             cruise-alt="8500"
             cruise-power="835"
             cruise-rpm="2600"
             takeoff-power="965"
             takeoff-rpm="2475"
             contra="1">
             <actionpt x="4.740" y="2.501" z="0.242"/>
             <piston-engine eng-rpm="2600"
                            eng-power="965"
                            displacement="1753"
                            compression="6.25">
                            <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>

  <propeller x="4.167" y="-2.501" z="0.242"
             radius="1.844"
             mass="1111"
             moment="15"
             cruise-speed="200"
             cruise-alt="8500"
             cruise-power="835"
             cruise-rpm="2600"
             takeoff-power="965"
             takeoff-rpm="2475"
             contra="1">
             <actionpt x="4.740" y="-2.501" z="0.242"/>
             <piston-engine eng-rpm="2600"
                            eng-power="965"
                            displacement="1753"
                            compression="6.25">
                            <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="MIXTURE"  axis="/controls/engines/engine[1]/mixture"/>
             </piston-engine>
  </propeller>

  <!-- left main -->
  <gear x="3.05568" y="2.49182" z="-2.28093"
        compression="0.4"
        spring="0.8"
        damp="1.2"
        sfric="1"
        dfric="1"
        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-speed  control="EXTEND" transition-time="5"/>

        <control-output control="EXTEND" prop="/gear/gear[0]/position-norm"/>
  </gear>

  <!-- right main -->
  <gear x="3.05568" y="-2.49182" z="-2.28093"
        compression="0.4"
        spring="0.8"
        damp="1.2"
        sfric="1"
        dfric="1"
        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-speed  control="EXTEND" transition-time="5.2"/>

        <control-output control="EXTEND" prop="/gear/gear[1]/position-norm"/>
  </gear>

  <gear x="-5.06947" y="0.000" z="-0.17810"
        compression="0.2"
        spring="0.8"
        damp="1.2"
        sfric="1"
        dfric="1"
        stiction="1">
        <control-input  control="STEER"  axis="/controls/flight/rudder" src0="-1.0" src1="1.0" dst0=".25" dst1="-.25"/>
  </gear>

  <!-- for animationq test
  <gear x="3.05568" y="2.49182" z="-4.28093"
        compression="0.4"
        spring="0.8"
        damp="1.2"
        sfric="1"
        dfric="1"
        stiction="1">
  </gear>

  <gear x="3.05568" y="-2.49182" z="-4.28093"
        compression="0.4"
        spring="0.8"
        damp="1.2"
        sfric="1"
        dfric="1"
        stiction="1">
  </gear>

  <gear x="-5.06947" y="0.000" z="-4.17810"
        compression="0.2"
        spring="0.8"
        damp="1.2"
        sfric="1"
        dfric="1"
        stiction="1">
  </gear>
  -->
  <tank x="1.600" y=" 1.800" z=" 0.450" capacity="1042"/>
  <tank x="1.600" y="-1.800" z=" 0.450" capacity="1042"/>

  <!-- Mass distribution
       Dilbert : The cg should be about 1/6 chord ahead of the chord center.
                 5.666 / 6     = 0.944
                 0.590 + 0.944 = 1.534
  -->
  <ballast x="6.200" y="0.000" z="0.500" mass="134"/>

</airplane>
