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

<!-- Caproni Ca161Bis : BARANGER Emmanuel 10/2014

     sources          : https://www.wikiwand.com/en/articles/Caproni_Ca.161

     wingspan         : 14.25 m    (   46 ft  9 in )
     length           :  8.25 m    (   27 ft  1 in )
     height           :  3.50 m    (   11 ft  6 in )
     empty weight     :  1205 kg   ( 2657 lb       )
     Gross weight     :  1650 kg   ( 3638 lb       )
     engine           : 1 Piaggio P.XI RC.100/2v 14-cylinder radial driving a 4-blade propeller ( 750 hp )
     max speed        :   337 km/h (  182 kn       )
-->
<airplane mass="2657" version="YASIM_VERSION_CURRENT" mtow-lbs="3638">

  <!-- Approach configuration -->
  <approach speed="60" aoa="4" fuel="0.3">
    <control-setting axis="/controls/engines/engine[0]/throttle" value="0.15"/>
    <control-setting axis="/controls/engines/engine[0]/mixture"  value="1.00"/>
  </approach>

  <!-- Cruise configuration -->
  <cruise speed="170" alt="13000" fuel="0.8">
    <control-setting axis="/controls/engines/engine[0]/throttle" value="1.00"/>
    <control-setting axis="/controls/engines/engine[0]/mixture"  value="1.00"/>
  </cruise>

  <!-- pilot eyepoint -->
  <cockpit x="0.269" y="0" z="0.531"/>

  <fuselage ax=" 3.010" ay=" 0.000" az=" 0.054" bx=" 2.843" by=" 0.000" bz=" 0.054" width="0.860" taper="0.81" midpoint="1"/>
  <fuselage ax=" 2.843" ay=" 0.000" az=" 0.054" bx=" 2.199" by=" 0.000" bz=" 0.054" width="0.950" taper="0.90" midpoint="1"/>
  <fuselage ax=" 2.199" ay=" 0.000" az=" 0.054" bx=" 1.220" by=" 0.000" bz=" 0.054" width="0.950" taper="1.00" midpoint="1"/>
  <fuselage ax=" 1.220" ay=" 0.000" az=" 0.054" bx="-3.247" by=" 0.000" bz=" 0.054" width="0.950" taper="0.10" midpoint="0"/>
  <fuselage ax=" 1.220" ay=" 0.000" az=" 0.039" bx="-3.247" by=" 0.000" bz=" 0.272" width="0.950" taper="0.10" midpoint="0"/>

  <!-- upper wing -->
  <wing x="2.341" y="0" z="1.006"
        chord="1.302"
        length="7.093"
        taper="1"
        dihedral="2"
        incidence="1"
        camber="0.12">
        <stall   aoa="20" width="13" peak="1.5"/>
        <flap0 start="0.45" end="1" lift="1.2" drag="1.2"/>

        <control-input  control="FLAP0" axis="/controls/flight/aileron"      split="true"/>
        <control-input  control="FLAP0" axis="/controls/flight/aileron-trim" split="true"/>

        <control-output control="FLAP0" prop="/surface-positions/left-aileron-pos-norm"  side="left"/>
        <control-output control="FLAP0" prop="/surface-positions/right-aileron-pos-norm" side="right"/>
  </wing>

  <!-- lower wing -->
  <wing x="1.717" y="0" z="-0.480"
        append="1"
        chord="1.302"
        length="7.093"
        taper="1"
        dihedral="2.5"
        incidence="1"
        camber="0.12">
        <stall aoa="20" width="1" peak="1.5"/>
        <flap0 start="0.45" end="1" lift="1.2" drag="1.2"/>

        <control-input  control="FLAP0" axis="/controls/flight/aileron"      split="true"/>
        <control-input  control="FLAP0" axis="/controls/flight/aileron-trim" split="true"/>

        <control-output control="FLAP0" prop="/surface-positions/left-aileron-pos-norm"  side="left"/>
        <control-output control="FLAP0" prop="/surface-positions/right-aileron-pos-norm" side="right"/>
  </wing>

  <!-- tailplane -->
  <hstab x="-3.175" y="0" z="0.312"
         chord="1.347"
         length="1.825"
         sweep="10"
         taper="0.5"
         camber="0.012">
         <stall   aoa="18" width="1" peak="1.0"/>
         <flap0 start="0"    end="1" lift="1.3" 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>

  <!-- tail -->
  <vstab x="-3.209" y="0" z="-0.005"
         chord="1.875"
         length="1.757"
         sweep="15"
         taper="0.50">
         <stall   aoa="16" width="1" peak="1.0"/>
         <flap0 start="0"    end="1" lift="1.2" 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>

  <!-- Engines   source            : https://www.wikiwand.com/en/articles/Piaggio_P.XI
                                     https://www.wikiwand.com/en/articles/Gnome-Rh%C3%B4ne_Mistral_Major

                 name              : Piaggio P.XI RC.100/2v
                 type              : 14-cylinder radial engine
                 power takeoff     :  750 hp at 2400 rpm
                 power cruising    :  650 hp at 2300 rpm at 4000 m ( 13000 ft )
                 Compression ratio : 6.0:1
                 weight            :   650 kg (  1433 lb    )
                 displacement      :  38.6 L  (  2356 cu in )
  -->
  <propeller x="3.369" y="0" z="0.139"
             mass="1433"
             moment="70"
             radius="1.55"
             cruise-alt="13000"
             cruise-speed="170"
             cruise-rpm="2300"
             cruise-power="650"
             takeoff-power="750"
             takeoff-rpm="2400">
             <actionpt x="3.959" y="0" z="0.139"/>
             <piston-engine eng-power="750"
                            eng-rpm="2400"
                            displacement="2356"
                            compression="6.0">
                            <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.854" y=" 1.081" z="-1.756"
        compression="0.15"
        spring="2"
        damp="2"
        stiction="1">
        <control-input control="BRAKE" axis="/controls/gear/brake-parking" split="true"/>
        <control-input control="STEER" axis="/sim/gears/toe-left"/>
  </gear>

  <!-- right main -->
  <gear x="2.854" y="-1.081" z="-1.756"
        compression="0.15"
        spring="2"
        damp="2"
        stiction="1">
        <control-input control="BRAKE" axis="/controls/gear/brake-parking" split="true"/>
        <control-input control="STEER" axis="/sim/gears/toe-right"/>
  </gear>

  <!-- Tail skid -->
  <gear x="-3.554" y="0" z="-0.190"
        compression="0.05"
        spring="1"
        damp="2"
        stiction="1">
  </gear>

  <!-- fuel -->
  <tank x="1.565" y="0" z="-0.205" capacity="200"/>

  <!-- Mass distribution
       Dilbert : The cg should be about 1/6 chord ahead of the chord center.
                 1.302 / 6     = 0.217
                 2.341 + 0.217 = 2.558
  -->
  <ballast x="3.4" y="0" z="0.1" mass="74"/>

</airplane>
