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

<!-- Cirrus SR22 -    2013 BARANGER Emmanuel
         Updated - 07/2020 BARANGER Emmanuel
         Updated - 03/2024 BARANGER Emmanuel

     sources          : http://en.wikipedia.org/wiki/Cirrus_SR22

     wingspan         :  11.68 m   ( 38 ft  4 in )
     length           :   7.92 m   ( 26 ft  0 in )
     height           :   2.72 m   (  8 ft 11 in )
     empty weight     :   1009 kg  (     2225 lb )
     Gross weight     :   1633 kg  (     3600 lb )
     fuel capacity    : 92 US gallons ( 348 litres )
     engine           : Continental IO-550-N Six cylinder horizontally opposed aircraft engine ( 310 hp )
     Cruise speed     :  343 km/h  (      185 kt )
-->
<airplane mass="2225" version="YASIM_VERSION_CURRENT" mtow-lbs="3600">

  <!-- Approach configuration -->
  <approach speed="40" aoa="2" fuel="0.2">
    <control-setting axis="/controls/engines/engine[0]/throttle" value="0.2"/>
    <control-setting axis="/controls/engines/engine[0]/mixture"  value="1"/>
    <control-setting axis="/controls/flight/flaps"               value="1"/>
  </approach>

  <!-- Cruise configuration -->
  <cruise speed="185" alt="6000" fuel="0.5">
    <control-setting axis="/controls/engines/engine[0]/throttle" value="0.7"/>
    <control-setting axis="/controls/engines/engine[0]/mixture"  value="0.6"/>
    <control-setting axis="/controls/flight/flaps"               value="0"/>
  </cruise>

  <cockpit x="1.176" y="0.300" z="0.440"/>

  <fuselage ax=" 3.46758" ay=" 0.32325" az="-0.11565" bx=" 2.33903" by=" 0.13689" bz="-0.18175" width="1.0" taper="0.4" midpoint="1"/>
  <fuselage ax=" 2.33903" ay=" 0.13689" az="-0.18175" bx=" 0.00000" by=" 0.13689" bz="-0.18175" width="1.0" taper="1.0" midpoint="0"/>
  <fuselage ax=" 0.00000" ay=" 0.13689" az="-0.18175" bx="-3.24442" by=" 0.00000" bz="-0.25118" width="1.0" taper="0.2" midpoint="0"/>

  <fuselage ax=" 3.51758" ay=" 0.00000" az="-0.11565" bx=" 2.33903" by=" 0.00000" bz="-0.18175" width="1.0" taper="0.4" midpoint="1"/>
  <fuselage ax=" 2.30644" ay=" 0.00000" az="-0.18400" bx=" 1.12350" by=" 0.00000" bz=" 0.16608" width="1.2" taper="0.8" midpoint="1"/>
  <fuselage ax=" 1.34550" ay=" 0.00000" az=" 0.13956" bx="-3.24442" by=" 0.00000" bz="-0.25118" width="1.2" taper="0.2" midpoint="0"/>

  <fuselage ax=" 3.46758" ay="-0.32325" az="-0.11565" bx=" 2.33903" by="-0.13689" bz="-0.18175" width="1.0" taper="0.4" midpoint="1"/>
  <fuselage ax=" 2.33903" ay="-0.13689" az="-0.18175" bx=" 0.00000" by="-0.13689" bz="-0.18175" width="1.0" taper="1.0" midpoint="0"/>
  <fuselage ax=" 0.00000" ay="-0.13689" az="-0.18175" bx="-3.24442" by=" 0.00000" bz="-0.25118" width="1.0" taper="0.2" midpoint="0"/>


  <wing x="0.807" y="0" z="-0.540"
        chord    = "1.574"
        length   = "5.8"
        taper    = "0.50"
        sweep    = "-2.7"
        dihedral = "4"
        camber   = "0.005">
        <stall   aoa="20" width="1"    peak="1.5"/>
        <flap0 start="0.17" end="0.60" lift="1.4" drag="2.2"/>
        <flap1 start="0.60" end="0.87" 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" prop="/surface-positions/left-aileron-pos-norm"  side="left"/>
        <control-output control="FLAP1" prop="/surface-positions/right-aileron-pos-norm" side="right"/>
        <control-output control="FLAP1" prop="/surface-positions/aileron-pos-norm"/>

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

  <hstab x="-3.027" y="0" z="-0.10167"
         chord  = "1.106"
         length = "1.965"
         taper  = "0.7"
         sweep  = "1">
         <stall   aoa="18" width="1" peak="1.5"/>
         <flap0 start="0"    end="1" lift="1.2" drag="1.1"/>

         <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.95241" y="0" z="-0.149"
         chord  = "1.441"
         length = "1.650"
         taper  = "0.4"
         sweep  = "26">
         <stall   aoa="16" width="1" peak="1.5"/>
         <flap0 start="0"    end="1" lift="1.2" drag="1.1"/>

         <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/Continental_IO-550

                 name              : Continental IO-550
                 type              : 6-cylinder air-cooled horizontally opposed aircraft piston engine
                 power cruise      : 300 hp at 2700 rpm
                 weight            : 430.72 lb ( 195.37 kg )
                 displacement      : 552 in3   (   9.05 L  )
                 compression       : 8.5:1
  -->
  <propeller x="3.17434" y="0" z="-0.12602"
             radius        = "1"
             mass          = "430.72"
             moment        = "6"
             cruise-speed  = "185"
             cruise-rpm    = "2575"
             cruise-alt    = "6000"
             cruise-power  = "280"
             takeoff-power = "310"
             takeoff-rpm   = "2600">
             <actionpt x="3.59129" y="0" z="-0.12602"/>
             <piston-engine eng-rpm      = "2700"
                            eng-power    = "310"
                            displacement = "552"
                            compression  = "8.5">
                            <control-input control="THROTTLE" axis="/controls/engines/engine[0]/throttle" src0="0" src1="1" dst0="0" dst1="1"/>
                            <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" src0="0" src1="1" dst0="0.8" dst1="0.8"/>
             </piston-engine>
  </propeller>

  <!-- Noze wheel -->
  <!-- Castering nose wheel -->
  <gear x="3.174" y="0" z="-1.356"
        compression = "0.15"
        spring      = "0.8"
        stiction    = "1">
        <control-input control="STEER"     axis="/controls/flight/rudder" square="false"/>
        <control-input control="CASTERING" axis="/controls/gear/tailwheel-lock" src0="0" src1="1" dst0="1" dst1="0"/>
  </gear>

  <!-- Left wheel -->
  <gear x="0.923" y="1.816" z="-1.358"
        compression = "0.2"
        spring      = "1.8"
        stiction    = "1">
        <control-input control="BRAKE" axis="/controls/gear/brake-left"/>
        <control-input control="BRAKE" axis="/controls/gear/brake-parking"/>
   </gear>

  <!-- Right wheel -->
  <gear x="0.923" y="-1.816" z="-1.358"
        compression = "0.2"
        spring      = "1.8"
        stiction    = "1">
        <control-input control="BRAKE" axis="/controls/gear/brake-right"/>
        <control-input control="BRAKE" axis="/controls/gear/brake-parking"/>
  </gear>

  <!-- Tail contact point -->
  <gear x="-3.18197" y="0" z="-0.45408"
        compression = "0.01">
  </gear>

  <!--92 US gallons ( 348 litres ) in 2 tank (46 gal- 275.8 lbs each) -->
  <tank x="1.10" y=" 1.8" z="-0.42" capacity="275.8"/>
  <tank x="1.10" y="-1.8" z="-0.42" capacity="275.8"/>

  <!-- Mass distribution
       Dilbert : The cg should be about 1/6 chord ahead of the chord center.
                 1.574 / 6     = 0.262
                 0.807 + 0.262 = 1.069
  -->
  <ballast x=" 3.4" y="0" z="-0.12" mass="209"/>

</airplane>
