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

<!-- De Havilland Canada DHC-4 Caribou : BARANGER Emmanuel (   2010)
                               Updated : BARANGER Emmanuel (06/2021)

     source             : http://en.wikipedia.org/wiki/De_Havilland_Canada_DHC-4_Caribou

     wingspan           : 95.58 ft   ( 29.13 m  )
     length             : 72.58 ft   ( 22.12 m  )
     height             : 31.66 ft   (  9.65 m  )
     Moteurs            : 2 Pratt and Whitney R-2000-7M2 Twin Wasp 14-cylinder, 1450 hp each
     Empty weight       : 18260 lb   (  8283 kg )
     Max takeoff weight : 28500 lb   ( 12927 kg )
     Stall speed        : 109 km/h   (    59 kt )
     Maximum speed      : 346 km/h   (   187 kt ) at 6500 ft (1981 m)
     Cruise speed       : 291 km/h   (   159 kt )
     Fuel capacity      : 830 US gal (  3100 l  )
-->
<airplane mass="18260" version="YASIM_VERSION_CURRENT" mtow-lbs="28500">

  <approach          speed="59" aoa="4"                                 fuel="0.2">
    <control-setting axis="/controls/engines/engine[0]/throttle"        value="0.4"/>
    <control-setting axis="/controls/engines/engine[0]/mixture"         value="1"/>
    <control-setting axis="/controls/engines/engine[0]/propeller-pitch" value="0.57"/>
    <control-setting axis="/controls/engines/engine[0]/boost"           value="0"/>

    <control-setting axis="/controls/engines/engine[1]/throttle"        value="0.4"/>
    <control-setting axis="/controls/engines/engine[1]/mixture"         value="1"/>
    <control-setting axis="/controls/engines/engine[1]/propeller-pitch" value="0.57"/>
    <control-setting axis="/controls/engines/engine[1]/boost"           value="0"/>

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

  <cruise            speed="159"                                        alt="24800">
    <control-setting axis="/controls/engines/engine[0]/throttle"        value="1"/>
    <control-setting axis="/controls/engines/engine[0]/mixture"         value="0.3"/>
    <control-setting axis="/controls/engines/engine[0]/propeller-pitch" value="0.9"/>
    <control-setting axis="/controls/engines/engine[0]/boost"           value="1"/>

    <control-setting axis="/controls/engines/engine[1]/throttle"        value="1"/>
    <control-setting axis="/controls/engines/engine[1]/mixture"         value="0.3"/>
    <control-setting axis="/controls/engines/engine[1]/propeller-pitch" value="0.9"/>
    <control-setting axis="/controls/engines/engine[1]/boost"           value="1"/>

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

  <cockpit x="8.492" y="0.507" z="-1.459"/>

  <!-- Fuselage -->
  <fuselage ax="11.057" ay=" 0.000" az="-2.902" bx="10.703" by=" 0.000" bz="-2.902" width="1.244" taper="0.20" midpoint="1"/>
  <fuselage ax="10.703" ay=" 0.000" az="-2.902" bx="10.088" by=" 0.000" bz="-2.844" width="1.892" taper="0.60" midpoint="1"/>
  <fuselage ax="10.088" ay=" 0.000" az="-2.844" bx=" 8.798" by=" 0.000" bz="-2.634" width="2.408" taper="0.78" midpoint="1"/>
  <fuselage ax=" 8.857" ay=" 0.000" az="-2.627" bx="-0.901" by=" 0.000" bz="-2.627" width="2.400" taper="1.00" midpoint="1"/>
  <fuselage ax="-0.436" ay=" 0.000" az="-2.674" bx="-5.504" by=" 0.000" bz="-1.166" width="2.400" taper="0.60" midpoint="0"/>
  <fuselage ax="-5.504" ay=" 0.000" az="-1.166" bx="-9.263" by=" 0.000" bz="-0.987" width="1.422" taper="0.50" midpoint="0"/>

  <fuselage ax=" 9.017" ay=" 0.000" az="-2.365" bx="-0.901" by=" 0.000" bz="-2.365" width="2.400" taper="1.00" midpoint="1"/>
  <fuselage ax="-0.997" ay=" 0.000" az="-2.357" bx="-5.504" by=" 0.000" bz="-1.166" width="2.400" taper="0.60" midpoint="0"/>

  <fuselage ax=" 9.610" ay=" 0.000" az="-2.725" bx=" 8.532" by=" 0.000" bz="-2.268" width="2.408" taper="0.60" midpoint="1"/>

  <!-- Left Engine -->
  <fuselage ax=" 6.590" ay=" 3.449" az="-2.199" bx=" 6.495" by=" 3.449" bz="-2.199" width="1.097" taper="0.70" midpoint="1"/>
  <fuselage ax=" 6.495" ay=" 3.449" az="-2.199" bx=" 6.065" by=" 3.449" bz="-2.199" width="1.443" taper="0.76" midpoint="1"/>
  <fuselage ax=" 6.065" ay=" 3.449" az="-2.199" bx=" 5.747" by=" 3.449" bz="-2.199" width="1.511" taper="0.96" midpoint="1"/>
  <fuselage ax=" 5.747" ay=" 3.449" az="-2.199" bx=" 3.463" by=" 3.449" bz="-2.199" width="1.511" taper="1.00" midpoint="1"/>
  <fuselage ax=" 3.463" ay=" 3.449" az="-2.199" bx=" 1.112" by=" 3.449" bz="-1.916" width="1.511" taper="0.20" midpoint="0"/>

  <!-- Right Engine -->
  <fuselage ax=" 6.590" ay="-3.449" az="-2.199" bx=" 6.495" by="-3.449" bz="-2.199" width="1.097" taper="0.70" midpoint="1"/>
  <fuselage ax=" 6.495" ay="-3.449" az="-2.199" bx=" 6.065" by="-3.449" bz="-2.199" width="1.443" taper="0.76" midpoint="1"/>
  <fuselage ax=" 6.065" ay="-3.449" az="-2.199" bx=" 5.747" by="-3.449" bz="-2.199" width="1.511" taper="0.96" midpoint="1"/>
  <fuselage ax=" 5.747" ay="-3.449" az="-2.199" bx=" 3.463" by="-3.449" bz="-2.199" width="1.511" taper="1.00" midpoint="1"/>
  <fuselage ax=" 3.463" ay="-3.449" az="-2.199" bx=" 1.112" by="-3.449" bz="-1.916" width="1.511" taper="0.20" midpoint="0"/>

  <wing x="3.073" y="0" z="-1.403"
        chord    = "3.494"
        length   = "3.466"
        taper    = "1"
        dihedral = "-8.395"
        camber   = "0.2">
        <stall   aoa="20" width="1" peak="1.5"/>
        <flap0 start="0.35" end="1" lift="1.6" drag="1.2"/>

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

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

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

  <wing x="3.073" y="3.428" z="-1.909"
        append   = "1"
        chord    = "3.494"
        length   = "11.20"
        taper    = "0.48"
        dihedral = "5"
        sweep    = "-4.8"
        camber   = "0.2">
        <stall   aoa="20" width="1"    peak="1.5"/>
        <flap0 start="0.00" end="0.96" lift="1.6" drag="1.6"/>
        <flap1 start="0.58" end="0.96" lift="1.2" drag="1.2"/>

        <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="4"/>
  </wing>

  <hstab x="-8.645" y="0" z="0.725"
         chord="2.184"
         length="5.355"
         taper="0.8">
         <stall   aoa="18" width="1" peak="1.5"/>
         <flap0 start="0"    end="1" lift="1.6" 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="-8.733" y="0" z="-0.722"
         chord  = "4.646"
         length = "5.420"
         taper  = "0.55"
         sweep  = "4">
         <stall   aoa="16" width="1" peak="1.5"/>
         <flap0 start="0"    end="1" lift="1.3" 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"/>
  </vstab>

  <!--  Pratt & Whitney R-2000
                 source       : https://www.wikiwand.com/en/Pratt_%26_Whitney_R-2000_Twin_Wasp

                 type         : Twin-row radial engine, 14 cylinder
                 power        : 1350 hp at 2700 rpm (sea level)
                 weight       : 1570 lb  ( 710 kg  )
                 Displacement : 2004 in3 (  32.8 L )
                 Compression  : 6.5:1
  -->
  <propeller x="6.400" y="3.449" z="-2.199"
             mass         = "1570"
             moment       = "95"
             radius       = "2"
             min-rpm      = "15"
             max-rpm      = "2800"
             gear-ratio   = "0.5625"
             course-stop  = "4"
             fine-stop    = "0.25"
             cruise-rpm   = "2100"
             cruise-speed = "159"
             cruise-power = "1350"
             cruise-alt   = "12000">
             <actionpt x="6.697" y="3.449" z="-2.199"/>
             <control-input control="ADVANCE" axis="/controls/engines/engine[0]/propeller-pitch"/>
             <piston-engine eng-power    = "1450"
                            eng-rpm      = "2800"
                            displacement = "2004"
                            compression  = "6.5"
                            turbo-mul    = "2.4"
                            wastegate-mp = "56">
                            <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"/>
                            <control-input control="BOOST"    axis="/controls/engines/engine[0]/boost"/>
             </piston-engine>
  </propeller>

  <propeller x="6.400" y="-3.449" z="-2.109"
             mass         = "1570"
             moment       = "95"
             radius       = "2"
             min-rpm      = "15"
             max-rpm      = "2800"
             gear-ratio   = "0.5625"
             course-stop  = "4"
             fine-stop    = "0.25"
             cruise-rpm   = "2100"
             cruise-speed = "159"
             cruise-power = "1350"
             cruise-alt   = "12000">
             <actionpt x="6.697" y="-3.449" z="-2.199"/>
             <control-input control="ADVANCE" axis="/controls/engines/engine[1]/propeller-pitch"/>
             <piston-engine eng-power    = "1450"
                            eng-rpm      = "2800"
                            displacement = "2004"
                            compression  = "6.5"
                            turbo-mul    = "2.4"
                            wastegate-mp = "56">
                            <control-input control="THROTTLE" axis="/controls/engines/engine[1]/throttle"/>
                            <control-input control="STARTER"  axis="/controls/engines/engine[1]/starter"/>
                            <control-input control="MAGNETOS" axis="/controls/engines/engine[1]/magnetos"/>
                            <control-input control="MIXTURE"  axis="/controls/engines/engine[1]/mixture"/>
                            <control-input control="BOOST"    axis="/controls/engines/engine[1]/boost"/>
             </piston-engine>
  </propeller>

  <!-- Roue du nez -->
  <gear x="10.582" y="0" z="-4.803"
        compression = "0.2"
        spring      = "2"
        damp        = "1"
        stiction    = "1">
        <control-input  control="STEER"  axis="/controls/flight/rudder" src0="-1.0" src1="1.0" dst0="-0.8" dst1="0.8"/>
        <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="5"/>
  </gear>

  <!-- Roue gauche -->
  <gear x="2.859" y="3.415" z="-4.696"
        compression = "0.2"
        spring      = "2"
        damp        = "1"
        stiction    = "1">
        <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"/>
  </gear>

  <!-- Roue droite -->
  <gear x="2.859" y="-3.415" z="-4.696"
        compression = "0.2"
        spring      = "2"
        damp        = "1"
        stiction    = "1">
        <control-input  control="BRAKE"  axis="/controls/gear/brake-right"/>
        <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[2]/position-norm"/>

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

  <tank x="4.000" y=" 7.000" z="-1.834" capacity="4472"/>
  <tank x="4.000" y="-7.000" z="-1.834" capacity="4472"/>

  <!-- Mass distribution
       Dilbert : The cg should be about 1/6 chord ahead of the chord center.
                 3.494 / 6     = 0.582
                 3.073 + 0.582 = 3.655
  -->
  <ballast x="11.000" y="0.000" z="-2.900" mass="3756"/>

</airplane>
