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

<!-- Gee Bee 2008 Emmanuel BARANGER
                  Pierre GEOFFROY
     updated 2011 Emmanuel BARANGER with Melchior's script
 
     sources          : http://en.wikipedia.org/wiki/Gee_Bee_Model_R

     year             :  1933
     wingspan         :  25 ft 0 in  (  7.62 m  )
     length           :  17 ft 8 in  (  5.38 m  )
     height           :   8 ft 2 in  (  2.48 m  )
     max speed        : 473.8 km/h   ( 258.2 kt )
     empty weight     : 1840 lb      (   834 kg )
     engine           : Pratt & Whitney Wasp. Air Cooled 9 cylinder radial (800 hp)

-->

<airplane mass="1840">

  <!-- Approach configuration -->
  <approach speed="56" aoa="7" 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="1.0"/>
    <control-setting axis="/controls/flight/flaps" value="1.0"/>
  </approach>

  <!-- Cruise configuration -->
  <cruise speed="256" alt="6000" fuel="0.7">
    <control-setting axis="/controls/engines/engine[0]/throttle" value="1.0"/>
    <control-setting axis="/controls/engines/engine[0]/mixture" value="1.0"/>
    <control-setting axis="/controls/engines/engine[0]/propeller-pitch" value="1.0"/>
    <control-setting axis="/controls/flight/flaps" value="0.0"/>
  </cruise>

  <cockpit x="-1.201" y="0.0" z="0.897"/>

  <fuselage ax="2.667" ay="0" az="0.112" bx="-2.663" by="0" bz="-0.061" width="1.535" taper="0.2" midpoint="1"/>

  <wing x="0.629" y="0.705" z="-0.070" 
        taper="1" 
        incidence="0"
        length="3.051" 
        chord="1.301" 
        sweep="0" 
        dihedral="3.5" 
        camber="0.05">
        <stall aoa="16" width="4" peak="1.5"/>
        <flap0 start="0.097" end="0.293" lift="1.3" drag="1.4"/>
        <flap1 start="0.310" end="0.794" 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" 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>

  <hstab x="-1.923" y="0.189" z="0.424" 
         taper="0.5" 
         effectiveness="3.0" 
         incidence="0" 
         length="1.034" 
         chord="1.0" 
         sweep="0">
         <stall aoa="16" width="4" peak="1.5"/>
         <flap0 start="0" end="1" lift="1.5" 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="-2.128" y="0" z="0.564" 
         taper="0.506" 
         effectiveness="3.0"
         length="1.543" 
         chord="0.544" 
         sweep="39.8">
         <stall aoa="14" width="3" peak="1.5"/>
         <flap0 start="0" end="1" lift="1.5" 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" min="1" max="-1"/>
  </vstab>

  <!-- Engines   source       : http://en.wikipedia.org/wiki/Pratt_%26_Whitney_R-1340 

                 name         : Pratt & Whitney R-1340
                 Power        : 542 hp at 2200 rpm at 5,000
                 type         : 9 cylinder single-row supercharged air-cooled radial engine
                 weight       : 805 lb (365 kg)
                 Displacement : 1343.8 in3 (22.02 l)
                 Compression  : 6.0:1

  -->
  <propeller x="2.055" y="0.0" z="-0.110" 
             radius="1.22"
             mass="805" 
             moment="15"
             cruise-speed="226" 
             cruise-alt="5000"
             cruise-rpm="2200"
             cruise-power="670"
             takeoff-power="730" 
             takeoff-rpm="2300"
             min-rpm="200"
             max-rpm="2300"
             fine-stop="0.8"
             coarse-stop="2">
             <actionpt x="2.505" y="0.0" z="0.112" />
             <control-input control="ADVANCE" axis="/controls/engines/engine[0]/propeller-pitch"/>
             <piston-engine eng-power="730"
                            eng-rpm="2300" 
                            displacement="1343.8" 
                            compression="6">
                            <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="1.277" y="0.959" z="-1.261" 
        compression="0.1" 
        spring="0.8" 
        on-solid="1" >
        <control-input axis="/controls/gear/brake-left" control="BRAKE" split="true"/>
        <control-input axis="/controls/gear/brake-parking" control="BRAKE" split="true"/>
  </gear>

  <!-- Right wheel -->
  <gear x="1.277" y="-0.959" z="-1.261" 
        compression="0.1" 
        spring="0.8"
        on-solid="1" >
        <control-input axis="/controls/gear/brake-right" control="BRAKE" split="true"/>
        <control-input axis="/controls/gear/brake-parking" control="BRAKE" split="true"/>
  </gear>

  <!-- Tail wheel -->
  <gear x="-2.270" y="0" z="-0.355" 
        compression="0.15" 
        spring="0.8"
        on-solid="1"
        sfric="1"
        dfric="1">
        <control-input axis="/controls/flight/rudder" control="STEER" src0="-1.0" src1="1.0" dst0="0.5" dst1="-0.5"/>
  </gear>

  <!-- 35 gal -->
  <tank x="0.456" y="0" z="-0.310" capacity="210" />

  <!-- Mass distribution -->
  <ballast x="-2.284" y="0.001" z="-0.268" mass="350"/>

</airplane>
