<?xml version="1.0" encoding="UTF-8"?>

<!-- Bell p 59 Airacomet  : 2010 BARANGER Emmanuel

     source          : http://en.wikipedia.org/wiki/Bell_P-59_Airacomet

     Wingspan        : 13.87 m   (     45 ft 6 in )
     Lenght          : 11.63 m   (     38 ft 2 in )
     Height          :  3.76 m   (     12 ft 4 in )
     Empty mass      :  3600 kg  (   7940 lb      )
     Engines         : 2 General Electric I-A turbojets (2000 lb each )
     Maximum speed   : 664 km/h  ( 359 kt ) at 25000 ft
-->

<airplane mass="7940">

  <approach speed="110" aoa="6" fuel="1.0">
    <control-setting axis="/controls/engines/engine[0]/throttle" value="0.2"/>
    <control-setting axis="/controls/engines/engine[1]/throttle" value="0.2"/>
    <control-setting axis="/controls/flight/flaps" value="1"/>
    <control-setting axis="/controls/gear/gear-down" value="1"/>
    <solve-weight idx="0" weight="170"/>
  </approach>

  <cruise speed="340" alt="25000" fuel="1">
    <control-setting axis="/controls/engines/engine[0]/throttle" value="1"/>
    <control-setting axis="/controls/engines/engine[1]/throttle" value="1"/>
    <control-setting axis="/controls/flight/flaps" value="0"/>
    <control-setting axis="/controls/gear/gear-down" value="0"/>
    <solve-weight idx="0" weight="170"/>
  </cruise>

  <cockpit x="2.216" y="0" z="0.258"/>

  <!-- Fuselage with engine on top -->
  <fuselage ax="5.815" ay="0" az="-0.562" bx="-5.012" by="0" bz="-0.109" width="0.956" taper="0.5" midpoint="0.30"/>

  <fuselage ax="2.893" ay="0.664" az="-0.788" bx="-1.014" by="0.664" bz="-0.788" width="0.730" taper="0.8" midpoint="0.50"/>

  <fuselage ax="2.893" ay="-0.664" az="-0.788" bx="-1.04" by="-0.664" bz="-0.788" width="0.730" taper="0.8" midpoint="0.50"/>

  <wing x="0.918" y="0.467" z="-0.357"
        chord="3.416" 
        length="6.510"
        taper="0.50"
        sweep="-1"
        camber="0.03"
        dihedral="2.5">
        <stall aoa="16" width="3" peak="1.3"/>
        <flap0 start="0.10" end="0.46" lift="1.3" drag="1.5"/>
        <flap1 start="0.47" end="0.93" lift="1.1" drag="1.0"/>

        <control-input axis="/controls/flight/flaps" control="FLAP0" invert="true"/> 
        <control-input axis="/controls/flight/aileron" control="FLAP1" square="true" split="true"/> 
        <control-input axis="/controls/flight/aileron-trim" control="FLAP1" 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"/>
   </wing>

   <hstab x="-4.624" y="0" z="0.417"
         chord="1.987"
         length="2.505"
         taper="0.46"
         sweep="5">
         <stall aoa="20" width="3" peak="1.3"/>
         <flap0 start="0.18" end="1" lift="1.6" drag="1.5"/>

         <control-input axis="/controls/flight/elevator" square="false" control="FLAP0" />
         <control-input axis="/controls/flight/elevator-trim" control="FLAP0"/>

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

  <vstab x="-4.704" y="0" z="-0.428"
         chord="2.25" 
         length="2.143" 
         taper="0.5"
         sweep="8">
         <stall aoa="16" width="5" peak="1.5"/>
         <flap0 start="0" end="1" lift="1.8" drag="1.3"/>

         <control-input axis="/controls/flight/rudder" control="FLAP0" invert="true"/>
         <control-input axis="/controls/flight/rudder-trim" control="FLAP0" invert="true"/>

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

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

                 name              : General Electric J31
                 type              : Turbojet (Single stage centrifugal)
                 power cruise      : 2000 lb  (1650 lb)
                 weight            : 850 lb   ( 386 kg  )
  -->
  <jet x="0.939" y="0.664" z="-0.788"
       n1-idle="30" 
       n1-max="90" 
       n2-idle="35" 
       n2-max="95"
       egt="850" 
       tsfc="1.39"
       mass="850" 
       thrust="2000">
       <actionpt x="-1.014" y="0.664" z="-0.788"/>
       <control-input axis="/controls/engines/engine[0]/throttle" control="THROTTLE"/>
  </jet>
  
  <jet x="0.939" y="-0.664" z="-0.788" 
       n1-idle="30" 
       n1-max="90" 
       n2-idle="35" 
       n2-max="95"
       egt="850"  
       tsfc="1.39"  
       mass="850" 
       thrust="2000" >
       <actionpt x="-1.014" y="-0.664" z="-0.788"/>
       <control-input axis="/controls/engines/engine[1]/throttle" control="THROTTLE"/>
  </jet>

  <!-- Undercarriage -->
  <!-- nose -->
  <gear x="5.062" y="0" z="-1.881"
        retract-time="7"
        compression="0.30"
        spring="1"
        damp="2" >

        <control-input axis="/controls/flight/rudder" control="STEER" src0="-1.0" src1="1.0" dst0="-0.1" dst1="0.1"/>
        <control-input axis="/controls/gear/gear-down" control="EXTEND"/>

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

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

  <!-- left main -->
  <gear x="1.174" y="2.823" z="-1.773"
        retract-time="7"
        compression="0.30"
        spring="1"
        damp="2" >

        <control-input axis="/controls/gear/brake-left" control="BRAKE"/>
        <control-input axis="/controls/gear/brake-parking" control="BRAKE"/>
        <control-input axis="/controls/gear/gear-down" control="EXTEND"/>

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

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

  <!-- right main -->
  <gear x="1.174" y="-2.823" z="-1.773"
        retract-time="7"
        compression="0.30"
        spring="1"
        damp="2" >

        <control-input axis="/controls/gear/brake-right" control="BRAKE"/>
        <control-input axis="/controls/gear/brake-parking" control="BRAKE"/>
        <control-input axis="/controls/gear/gear-down" control="EXTEND"/>

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

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

  <!-- Internal tanks 2*280 liter wings -->
  <tank x="1.9" y="-2.3" z="-0.310" jet="true" capacity="1250"/>
  <tank x="1.9"  y="2.3" z="-0.310" jet="true" capacity="1250"/>

  <weight x="2.125" y="0" z="-0.083" mass-prop="/yasim/Bell-P-59/pilot-lb"/>

  <!-- CG -->
  <ballast x="5.5" y="0" z="-2" mass="1500"/>
  <ballast x="-5.5" y="0" z="0" mass="-150"/>

</airplane>

