<?xml version="1.0"?>

<!--
************************************************************************
YASim aerodynamic model for a Me-323 D
-->

<airplane mass="60260">

<!-- Approach configuration -->
<approach speed="62" aoa="4">
  <control-setting axis="/controls/engines/engine[0]/throttle" value="0.1"/>
  <control-setting axis="/controls/engines/engine[0]/mixture" value="0.65"/>
  <control-setting axis="/controls/engines/engine[0]/propeller-pitch" value="0.7"/>
  <control-setting axis="/controls/engines/engine[1]/throttle" value="0.1"/>
  <control-setting axis="/controls/engines/engine[1]/mixture" value="0.65"/>
  <control-setting axis="/controls/engines/engine[1]/propeller-pitch" value="0.7"/>
  <control-setting axis="/controls/engines/engine[2]/throttle" value="0.1"/>
  <control-setting axis="/controls/engines/engine[2]/mixture" value="0.65"/>
  <control-setting axis="/controls/engines/engine[2]/propeller-pitch" value="0.7"/>
  <control-setting axis="/controls/engines/engine[3]/throttle" value="0.1"/>
  <control-setting axis="/controls/engines/engine[3]/mixture" value="0.65"/>
  <control-setting axis="/controls/engines/engine[3]/propeller-pitch" value="0.7"/>
  <control-setting axis="/controls/engines/engine[4]/throttle" value="0.1"/>
  <control-setting axis="/controls/engines/engine[4]/mixture" value="0.65"/>
  <control-setting axis="/controls/engines/engine[4]/propeller-pitch" value="0.7"/>
  <control-setting axis="/controls/engines/engine[5]/throttle" value="0.1"/>
  <control-setting axis="/controls/engines/engine[5]/mixture" value="0.65"/>
  <control-setting axis="/controls/engines/engine[5]/propeller-pitch" value="0.7"/>
  <control-setting axis="/controls/flight/flaps" value="1.0"/>

</approach>

<!-- Cruise configuration -->
<cruise speed="170" alt="12100">
  <control-setting axis="/controls/engines/engine[0]/throttle" value="1.00"/>
  <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/engines/engine[1]/throttle" value="1.00"/>
  <control-setting axis="/controls/engines/engine[1]/mixture" value="1.00"/>
  <control-setting axis="/controls/engines/engine[1]/propeller-pitch" value="1.0"/>
  <control-setting axis="/controls/engines/engine[2]/throttle" value="1.00"/>
  <control-setting axis="/controls/engines/engine[2]/mixture" value="1.00"/>
  <control-setting axis="/controls/engines/engine[2]/propeller-pitch" value="1.0"/>
  <control-setting axis="/controls/engines/engine[3]/throttle" value="1.00"/>
  <control-setting axis="/controls/engines/engine[3]/mixture" value="1.00"/>
  <control-setting axis="/controls/engines/engine[3]/propeller-pitch" value="1.0"/>
  <control-setting axis="/controls/engines/engine[4]/throttle" value="1.00"/>
  <control-setting axis="/controls/engines/engine[4]/mixture" value="1.00"/>
  <control-setting axis="/controls/engines/engine[4]/propeller-pitch" value="1.0"/>
  <control-setting axis="/controls/engines/engine[5]/throttle" value="1.00"/>
  <control-setting axis="/controls/engines/engine[5]/mixture" value="1.00"/>
  <control-setting axis="/controls/engines/engine[5]/propeller-pitch" value="1.0"/>
  <control-setting axis="/controls/flight/flaps" value="0.0"/>

</cruise>

<!-- pilot's eyepoint -->
<cockpit x="-3.595" y="0.60" z="0.89"/>

<!--fuselage --> 
<fuselage ax="11.8" ay="0.0" az="-0.9" bx="7.8" by="0.0" bz="-0.5"
          width="4.1" midpoint="1.0" taper="0.3"/>
<fuselage ax="7.8" ay="0.0" az="-0.5" bx="-2.0" by="0.0" bz="-0.5"
          width="4.1" midpoint="0.5" taper="0.8"/>
<fuselage ax="-2.0" ay="0.0" az="-0.5" bx="-15.0" by="0.0" bz="-0.1"
          width="3.1" midpoint="0.0" taper="0.3"/>
<!--engines -->
<fuselage ax="7.7" ay="3.91" az="1.55" bx="4.4" by="3.91" bz="1.6"
          width="1.4" midpoint="0.2" taper="0.7"/>
<fuselage ax="7.3" ay="7.7" az="1.74" bx="4.1" by="7.7" bz="1.74"
          width="1.4" midpoint="0.2" taper="0.7"/>
<fuselage ax="6.9" ay="11.75" az="1.95" bx="3.7" by="11.75" bz="1.95"
          width="1.4" midpoint="0.2" taper="0.7"/>

<fuselage ax="7.7" ay="-3.91" az="1.55" bx="4.4" by="-3.91" bz="1.6"
          width="1.4" midpoint="0.2" taper="0.7"/>
<fuselage ax="7.3" ay="-7.7" az="1.74" bx="4.1" by="-7.7" bz="1.74"
          width="1.4" midpoint="0.2" taper="0.7"/>
<fuselage ax="6.9" ay="-11.75" az="1.95" bx="3.7" by="-11.75" bz="1.95"
          width="1.4" midpoint="0.2" taper="0.7"/>

<wing x="2.221" y="1.225" z="1.196" taper="0.3" incidence="3" dihedral="3"
      length="27.242" chord="7.88" sweep="-3.0"  camber="0.01">
  <stall aoa="6" width="4" peak="2.5"/>
  <flap0 start="0.048" end="0.33" lift="1.5" drag="1.3"/>
  <flap1 start="0.33" end="1.0" lift="1.5" drag="1.0"/>
  <control-input axis="/controls/flight/flaps" control="FLAP0"/>
  <control-output control="FLAP0" prop="/surface-positions/flap-pos-norm"/>
  <control-speed control="FLAP0" transition-time="10"/>
  <control-input axis="/controls/flight/aileron" control="FLAP1" split="true"/>
  <control-input axis="/controls/flight/aileron-trim" control="FLAP1" split="true"/>
</wing>

<hstab x="-14.3" y="-0.182" z="0.623" taper="0.4"
       length="8.2" chord="3.8" sweep="-2.0" incidence="-2.0">
  <stall aoa="12" width="4" peak="1.5"/>
  <flap0 start="0.0" end="1.0" lift="2.0" drag="1.2"/>
  <control-input axis="/controls/flight/elevator" control="FLAP0"
	src0="-1" dst0="-1.0" src1="1" dst1="1.0"/>
  <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="-14.534" y="0" z="-0.492" taper="0.4" 
       length="6.194" chord="4.289" sweep="0"  incidence="0.0">
  <stall aoa="15" width="4" peak="1.5"/>
  <flap0 start="0" end="1.2" lift="1.4" drag="1.6"/>
  <control-input axis="/controls/flight/rudder" 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>

<!-- left engine-->
<propeller   x="7.1" y="11.729" z="1.979"
           radius="1.9" 
           mass="1370" moment="-60.5"
           cruise-alt="4595" cruise-power="600"
           cruise-speed="83" cruise-rpm="1100"
           gear-ratio="0.66"
					 coarse-stop="3.5"
           min-rpm="766" max-rpm="1600" >
  <actionpt x="6.9" y="11.729" z="1.979"/>
  <control-input axis="/controls/engines/engine[0]/propeller-pitch" control="ADVANCE" />
  <piston-engine
    eng-power="1180" eng-rpm="2400"
		displacement="2360"
		compression="6.8"
    turbo-mul="1.94" 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"/>
  </piston-engine>
</propeller>
<propeller   x="7.482" y="7.701" z="1.724"
           radius="1.9" 
           mass="1370" moment="-60.5"
           cruise-alt="4595" cruise-power="600"
           cruise-speed="83" cruise-rpm="1100"
           gear-ratio="0.66"
					 coarse-stop="3.5"
           min-rpm="766" max-rpm="1600" >
  <actionpt x="7.1" y="7.701" z="1.724"/>
  <control-input axis="/controls/engines/engine[1]/propeller-pitch" control="ADVANCE" />
  <piston-engine
    eng-power="1180" eng-rpm="2400"
		displacement="2360"
		compression="6.8"
    turbo-mul="1.94" wastegate-mp="61"
    >
    <control-input axis="/controls/engines/engine[1]/throttle" control="THROTTLE"/>
    <control-input axis="/controls/engines/engine[1]/starter" control="STARTER"/>
    <control-input axis="/controls/engines/engine[1]/magnetos" control="MAGNETOS"/>
    <control-input axis="/controls/engines/engine[1]/mixture" control="MIXTURE"/>
  </piston-engine>
</propeller>
<propeller   x="7.841" y="3.899" z="1.542"
           radius="1.9" 
           mass="1370" moment="-60.5"
           cruise-alt="4595" cruise-power="600"
           cruise-speed="83" cruise-rpm="1100"
           gear-ratio="0.66"
					 coarse-stop="3.5"
           min-rpm="766" max-rpm="1600" >
  <actionpt x="7.5" y="3.899" z="1.542"/>
  <control-input axis="/controls/engines/engine[2]/propeller-pitch" control="ADVANCE" />
  <piston-engine
    eng-power="1180" eng-rpm="2400"
		displacement="2360"
		compression="6.8"
    turbo-mul="1.94" wastegate-mp="61"
    >
    <control-input axis="/controls/engines/engine[2]/throttle" control="THROTTLE"/>
    <control-input axis="/controls/engines/engine[2]/starter" control="STARTER"/>
    <control-input axis="/controls/engines/engine[2]/magnetos" control="MAGNETOS"/>
    <control-input axis="/controls/engines/engine[2]/mixture" control="MIXTURE"/>
  </piston-engine>
</propeller>
<!-- right engine -->
<propeller   x="7.841" y="-3.899" z="1.542"
           radius="1.9" 
           mass="1370" moment="60.5"
           cruise-alt="4595" cruise-power="600"
           cruise-speed="83" cruise-rpm="1100"
           gear-ratio="0.66"
					 coarse-stop="3.5"
           min-rpm="766" max-rpm="1600" >
  <actionpt x="7.5" y="-3.899" z="1.542"/>
  <control-input axis="/controls/engines/engine[3]/propeller-pitch" control="ADVANCE" />
  <piston-engine
    eng-power="1150" eng-rpm="2400"
		displacement="2360"
		compression="6.8"
    turbo-mul="1.94" wastegate-mp="61"
    >
    <control-input axis="/controls/engines/engine[3]/throttle" control="THROTTLE"/>
    <control-input axis="/controls/engines/engine[3]/starter" control="STARTER"/>
    <control-input axis="/controls/engines/engine[3]/magnetos" control="MAGNETOS"/>
    <control-input axis="/controls/engines/engine[3]/mixture" control="MIXTURE"/>
  </piston-engine>
</propeller>
<propeller   x="7.482" y="-7.701" z="1.724"
           radius="1.9" 
           mass="1370" moment="60.5"
           cruise-alt="4595" cruise-power="600"
           cruise-speed="83" cruise-rpm="1100"
           gear-ratio="0.66"
					 coarse-stop="3.5"
           min-rpm="766" max-rpm="1600" >
  <actionpt x="7.1" y="-7.701" z="1.724"/>
  <control-input axis="/controls/engines/engine[4]/propeller-pitch" control="ADVANCE" />
  <piston-engine
    eng-power="1150" eng-rpm="2400"
		displacement="2360"
		compression="6.8"
    turbo-mul="1.94" wastegate-mp="61"
    >
    <control-input axis="/controls/engines/engine[4]/throttle" control="THROTTLE"/>
    <control-input axis="/controls/engines/engine[4]/starter" control="STARTER"/>
    <control-input axis="/controls/engines/engine[4]/magnetos" control="MAGNETOS"/>
    <control-input axis="/controls/engines/engine[4]/mixture" control="MIXTURE"/>
  </piston-engine>
</propeller>
<propeller   x="7.1" y="-11.729" z="1.979"
           radius="1.9" 
           mass="1370" moment="-60.5"
           cruise-alt="4595" cruise-power="600"
           cruise-speed="83" cruise-rpm="1100"
           gear-ratio="0.66"
					 coarse-stop="3.5"
           min-rpm="766" max-rpm="1600" >
  <actionpt x="6.9" y="-11.729" z="1.979"/>
  <control-input axis="/controls/engines/engine[5]/propeller-pitch" control="ADVANCE" />
  <piston-engine
    eng-power="1150" eng-rpm="2400"
		displacement="2360"
		compression="6.8"
    turbo-mul="1.94" wastegate-mp="61"
    >
    <control-input axis="/controls/engines/engine[5]/throttle" control="THROTTLE"/>
    <control-input axis="/controls/engines/engine[5]/starter" control="STARTER"/>
    <control-input axis="/controls/engines/engine[5]/magnetos" control="MAGNETOS"/>
    <control-input axis="/controls/engines/engine[5]/mixture" control="MIXTURE"/>
  </piston-engine>
</propeller>

 <!-- left 1 -->
<gear x="9.325" y="2.012" z="-3.010" compression="0.1" spring="2.5" damp="1.0">
  <control-input axis="/controls/gear/brake-left" control="BRAKE"/>
  <control-input axis="/controls/gear/brake-parking" control="BRAKE" split="true"/>
  <control-output control="EXTEND" prop="/gear/gear[2]/position-norm"/>
</gear>
 <!-- left 2 -->
<gear x="8.014" y="2.012" z="-3.140" compression="0.1" spring="2.5" damp="1.0">
  <control-input axis="/controls/gear/brake-left" control="BRAKE"/>
  <control-input axis="/controls/gear/brake-parking" control="BRAKE" split="true"/>
  <control-output control="EXTEND" prop="/gear/gear[2]/position-norm"/>
</gear>
 <!-- left 3 -->
<gear x="5.996" y="2.012" z="-3.167" compression="0.2" spring="3.5" damp="1.0">
  <control-input axis="/controls/gear/brake-left" control="BRAKE"/>
  <control-input axis="/controls/gear/brake-parking" control="BRAKE" split="true"/>
  <control-output control="EXTEND" prop="/gear/gear[2]/position-norm"/>
</gear>
 <!-- left 4 -->
<gear x="4.496" y="2.012" z="-3.167" compression="0.3" spring="3.5" damp="1.0">
  <control-input axis="/controls/gear/brake-left" control="BRAKE"/>
  <control-input axis="/controls/gear/brake-parking" control="BRAKE" split="true"/>
  <control-output control="EXTEND" prop="/gear/gear[3]/position-norm"/>
</gear>
 <!-- left 5 -->
<gear x="2.946" y="2.012" z="-3.167" compression="0.2" spring="3.5" damp="1.0">
  <control-input axis="/controls/gear/brake-left" control="BRAKE"/>
  <control-input axis="/controls/gear/brake-parking" control="BRAKE" split="true"/>
  <control-output control="EXTEND" prop="/gear/gear[4]/position-norm"/>
</gear>


 <!-- right 1 -->
<gear x="9.325" y="-2.012" z="-3.010" compression="0.1" spring="2.5" damp="1.0">
  <control-input axis="/controls/gear/brake-right" control="BRAKE"/>
  <control-input axis="/controls/gear/brake-parking" control="BRAKE" split="true"/>
  <control-output control="EXTEND" prop="/gear/gear[2]/position-norm"/>
</gear>
 <!-- right 2 -->
<gear x="8.014" y="-2.012" z="-3.140" compression="0.1" spring="2.5" damp="1.0">
  <control-input axis="/controls/gear/brake-right" control="BRAKE"/>
  <control-input axis="/controls/gear/brake-parking" control="BRAKE" split="true"/>
  <control-output control="EXTEND" prop="/gear/gear[2]/position-norm"/>
</gear>
 <!-- right 3 -->
<gear x="5.996" y="-2.012" z="-3.167" compression="0.2" spring="3.5" damp="1.0">
  <control-input axis="/controls/gear/brake-right" control="BRAKE"/>
  <control-input axis="/controls/gear/brake-parking" control="BRAKE" split="true"/>
  <control-output control="EXTEND" prop="/gear/gear[7]/position-norm"/>
</gear>
 <!-- right 4 -->
<gear x="4.496" y="-2.012" z="-3.167" compression="0.3" spring="3.5" damp="1.0">
  <control-input axis="/controls/gear/brake-right" control="BRAKE"/>
  <control-input axis="/controls/gear/brake-parking" control="BRAKE" split="true"/>
  <control-output control="EXTEND" prop="/gear/gear[8]/position-norm"/>
</gear>
 <!-- right 5 -->
<gear x="2.946" y="-2.012" z="-3.167" compression="0.2" spring="3.5" damp="1.0">
  <control-input axis="/controls/gear/brake-right" control="BRAKE"/>
  <control-input axis="/controls/gear/brake-parking" control="BRAKE" split="true"/>
  <control-output control="EXTEND" prop="/gear/gear[9]/position-norm"/>
</gear>

<!-- wing Tanks -->
<tank x="3.5" y="5.8" z="1.5" capacity="1412"/> 
<tank x="3.5" y="9.7" z="1.52" capacity="1412"/> 
<tank x="3.5" y="13.5" z="1.54" capacity="1412"/> 

<tank x="3.5" y="-5.8" z="1.5" capacity="1412"/> 
<tank x="3.5" y="-9.7" z="1.52" capacity="1412"/> 
<tank x="3.5" y="-13.5" z="1.54" capacity="1412"/> 

<!-- fuselage tank -->

<tank x="3.0" y="0.0" z="1.5" capacity="3086"/> 

<ballast x="10.0" y="-0.0" z="-1.9" mass="19000"/>

<weight x="6.8" y="0.0" z="-1.0" mass-prop="sim/weight[0]/weight-lb" size="0.0" />
<weight x="3.6" y="0.0" z="-1.0" mass-prop="sim/weight[1]/weight-lb" size="0.0" />
<weight x="0.4" y="0.0" z="-1.1" mass-prop="sim/weight[2]/weight-lb" size="0.0" />

</airplane>
