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

<!-- Heston Type 5 Racer - 03/2016 Emmanuel BARANGER
                           10/2019 Emmanuel BARANGER
   
     sources          : https://en.wikipedia.org/wiki/Napier-Heston_Racer

     year             :  1938
     wingspan         :  32 ft 0 1/2 in ( 9.766 m   )
     length           :  24 ft 7 1/4 in (  7.50 m   )
     height           :  11 ft 10    in (  3.61 m   )
     empty weight     :  7200 lb        (  3266 kg  )
     engine           : 1 Napier Sabre H-24 cylinder liquid-cooled piston engine ( 2450 hp )
     
     max speed        : 772 km/h        ( 416.84 kt ) estimated
-->
<airplane mass="4173" version="YASIM_VERSION_CURRENT">
  
  <approach speed="80" 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.0"/>
    <control-setting axis="/controls/engines/engine[0]/propeller-pitch" value="0.8"/>
    <!--
    <control-setting axis="/controls/flight/flaps" value="1"/>
    -->
    <control-setting axis="/controls/gear/gear-down" value="1"/>
    <solve-weight idx="0" weight="180"/>
  </approach>
  
  <cruise speed="390" alt="5000" fuel="0.5">
    <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"/>
    <solve-weight idx="0" weight="180"/>
  </cruise>

  <cockpit x="-0.421" y="0" z="0.766"/>

  <!-- Bol -->
  <fuselage ax=" 3.734" ay="0" az=" 0.209" bx=" 3.128" by="0" bz=" 0.209" width="0.788" taper="0.30" midpoint="1"/>
  <!-- Nez -->
  <fuselage ax=" 3.128" ay="0" az=" 0.209" bx=" 2.401" by="0" bz=" 0.209" width="1.034" taper="0.77" midpoint="1"/>
  <!-- Section haute -->
  <fuselage ax=" 2.401" ay="0" az=" 0.209" bx=" 1.142" by="0" bz=" 0.264" width="1.034" taper="1.00" midpoint="1"/>
  <fuselage ax=" 1.142" ay="0" az=" 0.264" bx="-0.497" by="0" bz=" 0.315" width="1.038" taper="0.90" midpoint="0"/>
  <fuselage ax="-0.497" ay="0" az=" 0.315" bx="-3.518" by="0" bz=" 0.321" width="0.831" taper="0.20" midpoint="0"/>
  <!-- Section basse -->
  <fuselage ax=" 2.397" ay="0" az=" 0.210" bx=" 1.141" by="0" bz=" 0.116" width="1.034" taper="1.00" midpoint="1"/>
  <fuselage ax=" 1.142" ay="0" az=" 0.115" bx="-0.574" by="0" bz="-0.076" width="1.038" taper="0.90" midpoint="0"/>
  <fuselage ax="-0.488" ay="0" az="-0.135" bx="-3.520" by="0" bz=" 0.126" width="0.831" taper="0.20" midpoint="0"/>
  <!-- Cockpit -->
  <fuselage ax=" 0.537" ay="0" az=" 0.593" bx=" 0.174" by="0" bz=" 0.619" width="0.631" taper="0.40" midpoint="1"/>
  <fuselage ax=" 0.203" ay="0" az=" 0.617" bx="-0.921" by="0" bz=" 0.598" width="0.631" taper="0.90" midpoint="0"/>
  <fuselage ax="-0.906" ay="0" az=" 0.598" bx="-3.510" by="0" bz=" 0.403" width="0.5711" taper="0.20" midpoint="0"/>
  
  <wing x="1.313" y="0" z="-0.227" 
        chord="2.194"
        length="4.881"
        taper="0.5"
        dihedral="3"
        sweep="1"
        camber="0.004">
        <stall aoa="22" width="1" peak="1.5"/>
        <flap0 start="0.13" end="0.590" lift="1.2" drag="2.9"/>
        <flap1 start="0.60" end="0.935" lift="1.2" drag="1.1"/>

        <control-input  control="FLAP0" axis="/controls/flight/flaps" invert="true"/>
        <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" side="left" prop="surface-positions/left-aileron-pos-norm"/>
        <control-output control="FLAP1" side="right" prop="surface-positions/right-aileron-pos-norm"/>

        <control-speed control="FLAP0" transition-time="3"/>
  </wing>
  
  <hstab x="-2.853" y="0" z="0.444" 
         chord="1.221" 
         length="1.647" 
         taper="0.5"
         sweep="10"> 
         <stall aoa="22" width="1" peak="1.1"/>
         <flap0 start="0" end="1" lift="1.1" drag="1.0"/>

         <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.109" y="0" z="-0.546" 
         chord="1.265" 
         length="2.084" 
         taper="0.8">
         <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/rudder" square="true" 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/Napier_Sabre

                 name              : Napier Sabre
                 type              : 24-cylinder supercharged liquid-cooled H-type aircraft piston engine
                 power cruise      : 2850 hp at 3800 rpm
                 weight            : 2360 lb   (  1070 kg )
                 displacement      : 2240 in 3 ( 36.65 L  )
                 compression       : 7:1
  
  gear-ratio="0.5"
  fine-stop="0.4"
  coarse-stop="6"
  -->
  <propeller x="2.373" y="0.0" z="0.249"
             radius="1.81"
             mass="1320"
             moment="35"
             cruise-speed="390"
             cruise-alt="5000"
             cruise-power="2400"
             cruise-rpm="3000"
             takeoff-power="2800"
             takeoff-rpm="3200"
             contra="1">
             <actionpt x="3.328" y="0.0" z="0.249"/>
             <control-input control="ADVANCE" axis="/controls/engines/engine[0]/propeller-pitch"/>
             <piston-engine eng-rpm="3800"
                            eng-power="2850"
                            displacement="2240"
                            compression="7">
                            <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.25468" y="2.22539" z="-1.80266" 
        compression="0.3"
        spring="0.7"
        damp="4"
        sfric="0.5"
        dfric="0.5">
        <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[0]/position-norm"/>

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

  <!-- right main -->
  <gear x="2.25468" y="-2.22539" z="-1.80266" 
        compression="0.3"
        spring="0.7"
        damp="4"
        sfric="0.5"
        dfric="0.5">
        <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="5.1"/>
  </gear>

  <!-- Tail wheel; has castering selectable by a wheel lock -->
  <gear x="-3.24997" y="0" z="-0.65149"
        compression="0.2"
        sfric="0.5"
        dfric="0.3">
        <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="3.1"/>
  </gear>

  <!-- Fuel  -->  
  <tank x="1.00" y=" 1.7" z="-0.14" capacity="210"/>
  <tank x="0.00" y=" 0.0" z="-0.13" capacity="156"/>
  <tank x="1.00" y="-1.7" z="-0.14" capacity="210"/>

  <weight x="-0.458" y="0" z="0.369" mass-prop="/sim/weight[0]/weight-lb"/>

  <!-- Mass distribution -->
  <ballast x="2.4" y="0" z="0" mass="400"/>
  
</airplane>
