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

<!-- Burnelli CBY 3       : BARANGER Emmanuel (2010) 

     Sources              : http://en.wikipedia.org/wiki/Burnelli_CBY-3

     Envergure            :    85 ft  5.5 in ( 26.0 m  )
     Longueur             :    53 ft 11.0 in ( 16.4 m  )
     Hauteur              :    20 ft  8.0 in (  6.3 m  )
     Masse a vide         : 16900 lb         ( 7675 kg )
     Moteur               : 2 Pratt & Whitney Twin-Wasp R-1830  radial engines, (1200 hp each)
     Vitesse max          : 382 km/h          ( 207 kt ) 
     Vitesse de croisiere : 275 km/h          ( 149 kt )
-->

<airplane mass="16900">

    <approach speed="60" aoa="3" fuel="0.3">
      <control-setting axis="/controls/engines/engine[0]/throttle" value="0.5"/>
      <control-setting axis="/controls/engines/engine[1]/throttle" value="0.5"/>

      <control-setting axis="/controls/engines/engine[0]/boost" value="0"/>
      <control-setting axis="/controls/engines/engine[1]/boost" value="0"/>

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

      <control-setting axis="/controls/engines/engine[0]/propeller-pitch" value="0.77"/>
      <control-setting axis="/controls/engines/engine[1]/propeller-pitch" value="0.77"/>

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

    <cruise speed="149" alt="5000" fuel="0.7">
      <control-setting axis="/controls/engines/engine[0]/throttle" value="0.7"/>
      <control-setting axis="/controls/engines/engine[1]/throttle" value="0.7"/>

      <control-setting axis="/controls/engines/engine[0]/boost" value="1"/>
      <control-setting axis="/controls/engines/engine[1]/boost" value="1"/>

      <control-setting axis="/controls/engines/engine[0]/mixture" value="0.4"/>
      <control-setting axis="/controls/engines/engine[1]/mixture" value="0.4"/>

      <control-setting axis="/controls/engines/engine[0]/propeller-pitch" value="1"/>
      <control-setting axis="/controls/engines/engine[1]/propeller-pitch" value="1"/>

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

    <cockpit x="4.884" y="0.397" z="0.134"/>

    <!-- Fuselage -->
    <fuselage ax="6.336" ay="0" az="-0.629" bx="2.597" by="0" bz="-0.695" width="1.730" taper="0.8" midpoint="0.2"/>

    <!-- Engine left -->
    <fuselage ax="7.648" ay="2.321" az="-0.899" bx="3.909" by="2.321" bz="-0.899" width="1.343" taper="0.8" midpoint="0.2"/>

    <!-- Engine right -->
    <fuselage ax="7.648" ay="-2.321" az="-0.899" bx="3.909" by="-2.321" bz="-0.899" width="1.343" taper="0.8" midpoint="0.2"/>

    <mstab x="1.125" y="0" z="-0.857"
           chord="8.202"
           length="2.768"
           taper="1"
           camber="0.01">
           <flap0 start="0" end="0.88" lift="1.6" drag="1.6"/>

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

           <control-output control="FLAP0" prop="/surface-positions/flap-pos-norm"/>
           <control-speed control="FLAP0" transition-time="5"/>
    </mstab>

    <!-- Wing -->
    <wing x="2.057" y="2.837" z="-0.182"
          chord="4.421"
          length="10.144"
          taper="0.3"
          dihedral="5"
          camber="0.01">
          <stall aoa="12" width="8" peak="3.5"/>
          <flap0 start="0.023" end="0.370" lift="1.6" drag="1.6"/>
          <flap1 start="0.384" end="0.950" lift="1.4" drag="1.3"/>

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

          <control-speed control="FLAP0" transition-time="5"/>
    </wing>

    <!-- Elevator -->
    <hstab x="-7" y="0" z="1.514"
           chord="2.024"
           length="5.056"
           taper="0.74">
           <stall aoa="11" width="2" peak="1.5"/>
           <flap0 start="0" end="0.95" lift="1.33" drag="1.5"/>

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

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

    <!-- Ruder -->
    <vstab x="-6.981" y="2.762" z="0.368"
           chord="2.349"
           length="2.755"
           taper="1">
           <stall aoa="14" width="4" peak="1.5"/>
           <flap0 start="0" end="1" lift="1.3" drag="1.5"/>

           <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>

    <vstab x="-6.981" y="-2.762" z="0.368"
           chord="2.349"
           length="2.755"
           taper="1">
           <stall aoa="14" width="4" peak="1.5"/>
           <flap0 start="0" end="1" lift="1.3" drag="1.5"/>

           <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/Pratt_%26_Whitney_R-1830

                 name              : Pratt & Whitney R-1830
                 type              : Fourteen-cylinder two-row supercharged air-cooled radial engine
                 power cruise      : 1200 hp at 2700 rpm for takeoff
                                   :  700 hp at 2325 rpm cruise power at 13120 ft (4000 m)
                 Compression ratio : 6.7:1
                 weight            : 1250 lb (567 kg)
                 Displacement      : 1829.4 in3 (30 l)
  -->
    <!-- Engine left interior-->
    <propeller x="7.838" y="2.321" z="-0.899"
               mass="1250"
               moment="110"
               radius="1.85"
               cruise-speed="149"
               cruise-rpm="2325"
               cruise-power="700"
               cruise-alt="5000"
               min-rpm="250"
               max-rpm="2700">
               <actionpt x="7.838" y="2.321" z="-0.899"/>
               <control-input axis="/controls/engines/engine[0]/propeller-pitch" control="ADVANCE"/>
               <piston-engine eng-power="1200" 
                              eng-rpm="2700"
                              displacement="1829.4">
                              <control-input axis="/controls/engines/engine[0]/throttle" control="THROTTLE"/>
                              <control-input axis="/controls/engines/engine[0]/starter" control="STARTER"/>
                              <control-input axis="/controls/engines/engine[0]/magnetos" control="MAGNETOS"/>
                              <control-input axis="/controls/engines/engine[0]/mixture" control="MIXTURE"/>
                              <control-input axis="/controls/engines/engine[0]/boost" control="BOOST"/>
               </piston-engine>
    </propeller>

    <!-- Engine right interior-->
    <propeller x="7.838" y="-2.321" z="-0.899"
               mass="1250"
               moment="110"
               radius="1.85"
               cruise-speed="149"
               cruise-rpm="2325"
               cruise-power="700"
               cruise-alt="5000"
               min-rpm="250"
               max-rpm="2700">
               <actionpt x="7.838" y="-2.321" z="-0.899"/>
               <control-input axis="/controls/engines/engine[1]/propeller-pitch" control="ADVANCE"/>
               <piston-engine eng-power="1200" 
                              eng-rpm="2700"
                              displacement="1829.4">
                              <control-input axis="/controls/engines/engine[1]/throttle" control="THROTTLE"/>
                              <control-input axis="/controls/engines/engine[1]/starter" control="STARTER"/>
                              <control-input axis="/controls/engines/engine[1]/magnetos" control="MAGNETOS"/>
                              <control-input axis="/controls/engines/engine[1]/mixture" control="MIXTURE"/>
                              <control-input axis="/controls/engines/engine[1]/boost" control="BOOST"/>
               </piston-engine>
    </propeller>

    <!-- Left wheel -->
    <gear x="3.585" y="2.325" z="-3.157"
          compression="0.2"
          retract-time="5"
          spring="1"
          damp="1.5"
          sfric="1.2"
          dfric="1.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-speed control="EXTEND" transition-time="5"/>
          <control-output control="EXTEND" prop="/gear/gear[0]/position-norm"/>
    </gear>

    <!-- Right wheel -->
    <gear x="3.585" y="-2.325" z="-3.157"
          compression="0.2"
          retract-time="5"
          spring="1"
          damp="1.5"
          sfric="1.2"
          dfric="1.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-speed control="EXTEND" transition-time="3.5"/>
          <control-output control="EXTEND" prop="/gear/gear[1]/position-norm"/>
    </gear>

    <!-- Tail wheel -->
    <gear x="-1.879" y="0" z="-2.025"
          compression="0.2"
          retract-time="5"
          spring="1.0"
          damp="1.50">
          <control-input axis="/controls/flight/rudder" control="STEER" src0="-1.0" src1="1.0" dst0="0.25" dst1="-0.25"/>
          <control-input axis="/controls/gear/gear-down" control="EXTEND"/>
         <control-speed control="EXTEND" transition-time="5"/>
          <control-output control="EXTEND" prop="/gear/gear[2]/position-norm"/>
    </gear>

    <tank x="2.466" y=" 4.817" z="0.21" capacity="2000"/>
    <tank x="2.466" y="-4.817" z="0.21" capacity="2000"/>

    <!-- CG placment -->
    <ballast x="5" y="0" z="-3" mass="2000"/>

</airplane>

