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

<!--  Gloster Gladiator :    2015 BARANGER Emmanuel
                          03/2020 BARANGER Emmanuel
                          08/2024 BARANGER Emmanuel

      sources       : https://en.wikipedia.org/wiki/Gloster_Gladiator

      Wingspan      :    32 ft 3 in ( 9.83 m    )
      Lenght        :    27 ft 5 in ( 8.36 m    )
      Height        :    11 ft 9 in ( 3.58 m    )
      Empty weight  :  3217 lb      ( 1462 kg   )
      Max. weight   :  4594 lb      ( 2084 kg   )
      Engines       : 1 Bristol Mercury IX radial engine ( 830 hp )
      Maximum speed :   220 kt      (  407 km/h ) at 14500 ft ( 4400 m )
      Cruise speed  : 182.5 kt      (  338 km/h )
      Stall speed   :  46.0 kt      (   85 km/h )
-->
<airplane mass="3217" version="YASIM_VERSION_CURRENT" mtow-lbs="4594">

  <!-- Approach configuration -->
  <approach speed="50" 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"/>
  </approach>

  <!-- Cruise configuration -->
  <cruise speed="182.5" alt="14500" fuel="0.5">
    <control-setting axis="/controls/engines/engine[0]/throttle"        value="0.8"/>
    <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="0"/>
  </cruise>

  <cockpit x="0.571" y="0" z="1.039"/>

  <!-- Bol -->
  <fuselage ax=" 4.133" ay="0" az="0.177" bx=" 3.634" by="0" bz="0.177" width="0.61" taper="0.05" midpoint="1"/>

  <!-- Capot -->
  <fuselage ax=" 3.629" ay="0" az="0.177" bx=" 3.433" by="0" bz="0.177" width="1.40" taper="0.75" midpoint="1"/>
  <fuselage ax=" 3.433" ay="0" az="0.177" bx=" 2.900" by="0" bz="0.177" width="1.40" taper="1.00" midpoint="1"/>

  <!-- Fuselage -->
  <fuselage ax=" 2.891" ay="0" az="0.177" bx=" 2.560" by="0" bz="0.177" width="1.40" taper="0.75" midpoint="1"/>
  <fuselage ax=" 2.560" ay="0" az="0.177" bx=" 0.000" by="0" bz="0.177" width="1.40" taper="1.00" midpoint="1"/>
  <fuselage ax=" 0.000" ay="0" az="0.177" bx="-3.240" by="0" bz="0.145" width="1.40" taper="0.30" midpoint="0"/>

  <!-- Cockpit -->
  <fuselage ax=" 1.350" ay="0" az="0.869" bx=" 0.955" by="0" bz="0.869" width="0.71" taper="0.30" midpoint="1"/>
  <fuselage ax=" 0.955" ay="0" az="0.869" bx=" 0.464" by="0" bz="0.869" width="0.71" taper="1.00" midpoint="1"/>
  <fuselage ax=" 0.464" ay="0" az="0.869" bx="-1.078" by="0" bz="0.719" width="0.71" taper="0.10" midpoint="0"/>

  <wing x="1.976" y="0" z="1.269"
        chord="1.781"
        length="4.885"
        taper="1"
        dihedral="2"
        camber="0.003">
        <stall   aoa="20" width="1"    peak="1.5"/>
        <flap0 start="0.21" end="0.52" lift="1.3" drag="1.4"/>
        <flap1 start="0.52" end="1.00" 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>

  <wing x="1.275" y="0" z="-0.341"
        append="1"
        chord="1.781"
        length="4.885"
        taper="1"
        dihedral="2"
        camber="0.003">
        <stall   aoa="20" width="1"    peak="1.5"/>
        <flap0 start="0.21" end="0.52" lift="1.3" drag="1.4"/>
        <flap1 start="0.52" end="1.00" 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="-3.007" y="0" z="0.134"
         chord="1.40"
         length="1.73"
         taper="0.80"
         sweep="0">
         <stall   aoa="18" width="1" peak="1.5"/>
         <flap0 start="0"    end="1" lift="1.2" drag="1.1"/>

         <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="-2.92" y="0" z="-0.114"
         chord="2.242"
         length="1.84"
         taper="0.46"
         sweep="18">
         <stall   aoa="16" width="1" peak="1.5"/>
         <flap0 start="0"    end="1" lift="1.2" drag="1.1"/>

         <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://en.wikipedia.org/wiki/Bristol_Mercury

                 name         : Bristol Mercury
                 type         : Nine-cylinder single-row supercharged air-cooled radial engine
                 Power        : 820 hp at 2700 rpm
                 weight       : 966 lb   ( 438 kg  )
                 Displacement : 1519 in3 (  24.9 L )
                 Compression  : 6:1
  -->
  <propeller x="3.30877" y="0" z="0.17718"
             mass="966"
             moment="12"
             radius="1.64"
             cruise-speed="182.5"
             cruise-rpm="2500"
             cruise-power="790"
             cruise-alt="14500"
             takeoff-power="820"
             takeoff-rpm="2700">
             <actionpt x="3.86265" y="0" z="0.17627"/>
             <control-input control="ADVANCE" axis="/controls/engines/engine[0]/propeller-pitch"/>
             <piston-engine eng-power="820"
                            eng-rpm="2700"
                            displacement="1519"
                            compression="6.0">
                            <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 wheel -->
  <gear x="2.40712" y="1.11686" z="-1.82044"
        compression="0.2"
        spring="1.8"
        stiction="1">
        <control-input control="BRAKE" axis="/controls/gear/brake-left"    split="true"/>
        <control-input control="BRAKE" axis="/controls/gear/brake-parking" split="true"/>
  </gear>

  <!-- Right wheel -->
  <gear x="2.40712" y="-1.11686" z="-1.82044"
        compression="0.2"
        spring="1.8"
        stiction="1">
        <control-input control="BRAKE" axis="/controls/gear/brake-right"   split="true"/>
        <control-input control="BRAKE" axis="/controls/gear/brake-parking" split="true"/>
  </gear>

  <!-- Tail wheel -->
  <gear x="-2.74782" y="0" z="-0.56710"
        compression="0.1"
        spring="1.8"
        stiction="1">
        <control-input control="STEER" axis="/controls/flight/rudder" src0="-1.0" src1="1.0" dst0="0.5" dst1="-0.5"/>
  </gear>

  <tank x="2" y="0" z="-0.1" capacity="580"/>

  <!-- Mass distribution
       Dilbert : The cg should be about 1/6 chord ahead of the chord center.
                 1.781 / 6     = 0.296
                 1.976 + 0.296 = 2.272
  -->
  <ballast x="3.300" y=" 0.000" z="-0.400" mass="695"/>

</airplane>
