<?xml version="1.0"?>

<!--
************************************************************************
YASim aerodynamic model for a Yak-3

-->
<airplane mass="4640">

<!-- Approach configuration -->
<approach speed="80" aoa="7">
  <control-setting axis="/controls/engines/engine[0]/throttle" value="0.0"/>
  <control-setting axis="/controls/engines/engine[0]/mixture" value="0.65"/>
  <control-setting axis="/controls/engines/engine[0]/propeller-pitch" value="0.5"/>
  <control-setting axis="/controls/flight/flaps" value="1.0"/>
  <control-setting axis="/controls/gear/gear-down" value="1"/>
</approach>

<!-- Cruise configuration -->
<cruise speed="330" alt="13450">
  <control-setting axis="/controls/engines/engine[0]/throttle" value="1.0"/>
  <control-setting axis="/controls/engines/engine[0]/mixture" value="1.00"/>
  <control-setting axis="/controls/engines/engine[0]/propeller-pitch" value="1.0"/>
  <control-setting axis="/controls/flight/flaps" value="0.0"/>
  <control-setting axis="/controls/gear/gear-down" value="0"/>
  <control-setting axis="/controls/engines/engine[0]/boost" value="1.0"/>
</cruise>

<!-- pilot's eyepoint -->
<cockpit x="-3.495" y="0" z="0.6"/>

<fuselage ax="0.0" ay="0.0" az="0.0" bx="-1.8" by="0.0" bz="-0.15"
          width="1.2" taper="0.38" midpoint="1.0" />
<fuselage ax="-1.8" ay="0.0" az="-0.15" bx="-4.5" by="0.0" bz="-0.15"
          width="1.2" taper="1" midpoint="0.7" />
<fuselage ax="-4.5" ay="0.0" az="-0.15" bx="-7.9" by="0.0" bz="0.1"
          width="1.2" taper="0.55" midpoint="0.0" />
<!-- cockpit -->
<fuselage ax="-2.8" ay="0.0" az="0.4" bx="-4.5" by="0.0" bz="0.5"
          width="0.7" taper="0.4" midpoint="0.3" />
<!-- cooler -->
<fuselage ax="-3.9" ay="0.0" az="-0.85" bx="-5.3" by="0.0" bz="-0.65"
          width="0.4" taper="0.8" midpoint="0.4" />


<!--Stub wing -->
<mstab x="-3.15" y="0.33" z="-0.625" taper="0.69" incidence="1.0"
      length="1.49" chord="2.7" sweep="2.0" dihedral="4.5" camber="0.1">
  <stall aoa="10" width="10" peak="1.5"/>
  <flap0 start="0.0" end="1.0" lift="1.5" drag="1.6"/>
  <control-input axis="/controls/flight/flaps" control="FLAP0"/>
  <control-output control="FLAP0" prop="/surface-positions/flap-pos-norm"/>
  <control-speed control="FLAP0" transition-time="7"/>
</mstab>


<!--Main Wing -->
<wing x="-3.21" y="1.81" z="-0.48" taper="0.44" incidence="2.0" twist="-1"
      length="2.575" chord="1.85" sweep="-2.65" dihedral="4.5" camber="0.0">
  <stall aoa="10" width="15" peak="1.5"/>
  <flap0 start="0.0" end="0.39" lift="1.2" drag="1.9"/>
  <flap1 start="0.39" end="1.0" lift="1.3" drag="1.1"/>
  <control-input axis="/controls/flight/flaps" control="FLAP0"/>
  <control-output control="FLAP0" prop="/surface-positions/flap-pos-norm"/>
  <control-speed control="FLAP0" transition-time="7"/>
  <control-input axis="/controls/flight/aileron" control="FLAP1" split="true"/>
  <control-input axis="/controls/flight/aileron-trim" control="FLAP1" split="true"/>
</wing>


<!--Wing tip -->

<mstab x="-3.095" y="4.3745" z="-0.28" chord="0.813" length="0.3" taper="0.4"
        sweep="-10.0" dihedral="3.5">
   <stall aoa="11" width="8" peak="1.5"/>
</mstab>


<hstab x="-7.69" y="0.1" z="0.3" taper="0.42" camber="0.1"
       length="1.5" chord="1.3" sweep="5.0">
  <stall aoa="12" width="15" peak="2.5"/>
  <flap0 start="0.0" end="1.1" lift="2.1" drag="2.9"/>
  <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>

<!-- rudder has to be able to counteract aileron drag -->
<vstab x="-7.65" y="0" z="-0.0" taper="0.3" 
       length="1.5" chord="1.8" sweep="0" >
  <stall aoa="15" width="14" peak="2.5"/>
  <flap0 start="-0.1" end="1" lift="1.5" drag="1.2"/>
  <control-input axis="/controls/flight/rudder" square="true" 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"
    min="1" max="-1"/>
</vstab>


<propeller   x="-1.1" y="0" z="0"
           radius="1.5" 
           mass="1300" moment="105.5"
           cruise-alt="1000" cruise-power="850"
           cruise-speed="190" cruise-rpm="1037"
           gear-ratio="0.479"
           min-rpm="766" max-rpm="1437" >
  <actionpt x="-0.4" y="0" z="0"/>
  <control-input axis="/controls/engines/engine[0]/propeller-pitch" control="ADVANCE" />
  <piston-engine
    eng-power="1300" eng-rpm="2700"
    displacement="2142" supercharger="1"
    turbo-mul="5.0" wastegate-mp="61"
    >
    <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>




 <!-- left main -->
<gear x="-2.3" y="1.727" z="-1.93" compression="0.1" spring="0.7" damp="2.2"
   dfric="0.7" sfric ="0.40">
  <control-input axis="/controls/gear/brake-left" control="BRAKE"/>
  <control-input axis="/controls/gear/brake-parking" control="BRAKE" split="true"/>
  <control-input axis="/controls/gear/gear-down" control="EXTEND"/>
  <control-speed control="EXTEND" transition-time="6"/>
  <control-output control="EXTEND" prop="/gear/gear[0]/position-norm"/>
</gear>

 <!-- right main -->
<gear x="-2.3" y="-1.727" z="-1.93" compression="0.1" spring="0.7" damp="2.2"
   dfric="0.7" sfric ="0.40">
  <control-input axis="/controls/gear/brake-right" control="BRAKE"/>
  <control-input axis="/controls/gear/brake-parking" control="BRAKE" split="true"/>
  <control-input axis="/controls/gear/gear-down" control="EXTEND"/>
  <control-speed control="EXTEND" transition-time="8"/>
  <control-output control="EXTEND" prop="/gear/gear[1]/position-norm"/>
</gear>

<!-- Tail wheel -->

<gear x="-7.444" y="0" z="-0.69" compression="0.1" castering="1"
  dfric="0.6" sfric ="0.40">
  <control-input axis="/controls/gear/tailwheel-lock" src0="0" src1="1"
                 dst0="1" dst1="0" control="CASTERING"/>
  <control-input axis="/controls/gear/gear-down" control="EXTEND"/>
  <control-speed control="EXTEND" transition-time="4"/>
  <control-output control="EXTEND" prop="/gear/gear[2]/position-norm"/>
                 src0="-1.0" src1="1.0"
                 dst0="0.5" dst1="-0.5"/>
</gear>


<tank x="-3.4" y="0" z="0.2" capacity="1581"/> 

<!-- pilot -->
<ballast x="-4.495" y="0" z="0.689" mass="180"/>

<ballast x="-8.0" y="0" z="0.689" mass="500"/>

</airplane>
