<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="http://jsbsim.sourceforge.net/JSBSim.xsl"?>
<fdm_config name="A6M2" version="2.0" release="ALPHA"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd">

 <fileheader>
  <author> Tatsuhiro Nishioka </author>
  <filecreationdate> 2008-02-11 </filecreationdate>
  <version>$Revison: $</version>
  <description> A6M2 Zero (JSBSim) </description>
 </fileheader>

<!--
  File:     A6M2.xml
  Inputs:
    name:          A6M2
    type:          WWII fighter, subsonic sport, aerobatic
    max weight:    5896.17 lb
    wing span:     12.00 m
    length:         9.05 m
    wing area:     22.438 sq_m
    gear type:     taildragger
    retractable?:  yes
    # engines:     1
    engine type:   piston
    engine layout: forward fuselage
    yaw damper?    no

  Outputs:
    wing loading:  107.4 kg/sq_m (21.99 lb /sq_ft)
    CL-alpha:      4.5 per radian
    CL-0:          0.17
    CL-max:        1.2
    CD-0:          0.02
    K:             0.045

-->

 <metrics>
   <wingarea  unit="M2">  22.438 </wingarea>
   <wingspan  unit="M" >  12.000 </wingspan>
   <wing_incidence>        -0.01 </wing_incidence>
   <chord     unit="M" >   2.500 </chord>
   <htailarea unit="M2">   3.971 </htailarea>
   <htailarm  unit="M" >   5.100 </htailarm>
   <vtailarea unit="M2">   1.619 </vtailarea>
   <vtailarm  unit="M" >   5.460 </vtailarm>
   <location name="AERORP" unit="M">
     <x> -0.21 </x>
     <y>  0.00 </y>
     <z> -0.12 </z>
   </location>
   <location name="EYEPOINT" unit="M">
     <x>   0.44 </x>
     <y>   0.00 </y>
     <z>   0.83 </z>
   </location>
   <location name="VRP" unit="M">
     <x>0</x>
     <y>0</y>
     <z>0</z>
   </location>
 </metrics>

 <mass_balance>
   <ixx unit="SLUG*FT2">      3104 </ixx>
   <iyy unit="SLUG*FT2">      3138 </iyy>
   <izz unit="SLUG*FT2">      5778 </izz>
   <emptywt unit="LBS" >      4300 </emptywt>
   <location name="CG" unit="M">
     <x>  -0.315</x>
     <y>  -0.03 </y>
     <z>  -0.12 </z>
   </location>
<!-- Warning: Adjust the -set file if altering the order of the point-masses-->
   <pointmass name="Pilot">
     <weight unit="LBS"> 200 </weight>
     <location name="POINTMASS" unit="M">
       <x>0.74 </x>
       <y>  0 </y>
       <z>0.35</z>
     </location>
   </pointmass> 

   <pointmass name="Oil">
     <weight unit="LBS"> 91 </weight>
     <location name="POINTMASS" unit="M">
       <x>-0.58 </x>
       <y>   0 </y>
       <z> 0.35</z>
     </location>
   </pointmass> 

 </mass_balance>

 <ground_reactions>
<!-- Gear code depends on left main, right main and tail being unit[0], unit[1] and unit[2] in order -->
  <contact type="BOGEY" name="LEFT_MAIN">
   <location unit="M">
     <x>  -0.610 </x>
     <y>  -1.750 </y>
     <z>  -1.918 </z>
   </location>
   <static_friction>  0.80 </static_friction>
   <dynamic_friction> 0.50 </dynamic_friction>
   <rolling_friction> 0.02 </rolling_friction>
   <spring_coeff unit="LBS/FT">       5896.17 </spring_coeff>
   <damping_coeff unit="LBS/FT/SEC">  1179.23 </damping_coeff>
   <max_steer unit="DEG">0</max_steer>
   <brake_group>LEFT</brake_group>
   <retractable>1</retractable>
 </contact>

  <contact type="BOGEY" name="RIGHT_MAIN">
   <location unit="M">
     <x>  -0.610 </x>
     <y>   1.750 </y>
     <z>  -1.918 </z>
   </location>
   <static_friction>  0.80 </static_friction>
   <dynamic_friction> 0.50 </dynamic_friction>
   <rolling_friction> 0.02 </rolling_friction>
   <spring_coeff unit="LBS/FT">       5896.17 </spring_coeff>
   <damping_coeff unit="LBS/FT/SEC">  1179.23 </damping_coeff>
   <max_steer unit="DEG">0</max_steer>
   <brake_group>RIGHT</brake_group>
   <retractable>1</retractable>
 </contact>

  <contact type="BOGEY" name="TAIL">
   <location unit="M">
     <x>  6.06 </x>
     <y>  0.000 </y>
     <z> -0.546  </z>
<!-- This is the leveling point
     <z> -1.888  </z>
 -->
   </location>
   <static_friction>  0.40 </static_friction>
   <dynamic_friction> 0.25 </dynamic_friction>
   <rolling_friction> 0.01 </rolling_friction>
   <spring_coeff unit="LBS/FT">        870.0 </spring_coeff>
   <damping_coeff unit="LBS/FT/SEC">   300.0 </damping_coeff>
   <max_steer unit="DEG"> 0. </max_steer>
   <brake_group>NONE</brake_group>
   <retractable>0</retractable>
 </contact>

  <contact type="STRUCTURE" name="LEFT_WING">
    <location unit="M">
     <x> -0.09 </x>
     <y> -6.00 </y>
     <z>  0.24 </z>
    </location>
    <static_friction>  0.80 </static_friction>
    <dynamic_friction> 0.50 </dynamic_friction>
    <spring_coeff unit="LBS/FT">       5896.17 </spring_coeff>
    <damping_coeff unit="LBS/FT/SEC">  1179.23 </damping_coeff>
 </contact>

  <contact type="STRUCTURE" name="RIGHT_WING">
    <location unit="M">
     <x> -0.09 </x>
     <y>  6.00 </y>
     <z>  0.24 </z>
    </location>
    <static_friction>  0.80 </static_friction>
    <dynamic_friction> 0.50 </dynamic_friction>
    <spring_coeff unit="LBS/FT">       5896.17 </spring_coeff>
    <damping_coeff unit="LBS/FT/SEC">  1179.23 </damping_coeff>
 </contact>

  <contact type="STRUCTURE" name="NOSE">
    <location unit="M">
     <x> -1.77 </x>
     <y>  0.00 </y>
     <z> -0.69 </z>
    </location>
    <static_friction>  0.80 </static_friction>
    <dynamic_friction> 0.50 </dynamic_friction>
    <spring_coeff unit="LBS/FT">       5896.17 </spring_coeff>
    <damping_coeff unit="LBS/FT/SEC">  1179.23 </damping_coeff>
 </contact>

 </ground_reactions>

 <propulsion>

   <engine file="Sakae-Type12">
    <location unit="M">
      <x>  -1.80 </x>
      <y>   0.00 </y>
      <z>  -0.04 </z>
    </location>
    <orient unit="DEG">
      <pitch> 0.00 </pitch>
      <roll>  0.00 </roll>
      <yaw>   0.00 </yaw>
    </orient>
    <feed>0</feed>
    <feed>1</feed>
    <feed>2</feed>
    <thruster file="CS-40B">
    <sense> 1</sense>
     <location unit="M">
       <x>  -2.33 </x>
       <y>   0.00 </y>
       <z>  -0.04 </z>
     </location>
     <orient unit="DEG">
       <pitch> 0.00 </pitch>
       <roll>  0.00 </roll>
       <yaw>   0.00 </yaw>
     </orient>
    </thruster>
  </engine>

  <tank type="FUEL" number="0" name="in-fuselage tank">
     <location unit="M">
       <x>  -0.30 </x>
       <y>   0.00 </y>
       <z>  -0.07 </z>
     </location>
     <!-- density of fuel (92 octane)= 0.735 -->
     <density unit="LBS/GAL"> 6.134 </density> 
     <capacity unit="KG"> 106.58 </capacity>
     <contents unit="KG"> 106.0 </contents> <!-- 145L -->
  </tank>

  <tank type="FUEL" number="1" name="left in-wing tank">
     <location unit="M">
       <x>   0.34 </x>
       <y>  -0.85 </y>
       <z>  -0.32 </z>
     </location>
     <density unit="LBS/GAL"> 6.134 </density> 
     <capacity unit="KG"> 139.65 </capacity>
     <contents unit="KG"> 139.0 </contents> <!-- 190L -->
  </tank>

  <tank type="FUEL" number="2" name="right in-wing tank">
     <location unit="M">
       <x>   0.34 </x>
       <y>   0.85 </y>
       <z>  -0.32 </z>
     </location>
     <density unit="LBS/GAL"> 6.134 </density> 
     <capacity unit="KG"> 139.65 </capacity> <!-- 190L -->
     <contents unit="KG"> 139.0 </contents>
  </tank>

 </propulsion>
 
 <system file="hook"/>
 <system file="afcs"/>
 <system file="propulsion"/>

 <flight_control name="FCS: A6M2">

  <channel name="Pitch">
   <summer name="Pitch Trim Sum">
      <input>fcs/elevator-cmd-norm</input>
      <input>fcs/pitch-trim-cmd-norm</input>
      <input>ap/elevator-cmd</input>
      <clipto>
        <min> -1 </min>
        <max>  1 </max>
      </clipto>
   </summer>

   <aerosurface_scale name="Elevator Control">
      <input>fcs/pitch-trim-sum</input>
      <range>
        <min> -0.523 </min>
        <max>  0.35 </max>
      </range>
      <output>fcs/elevator-pos-rad</output>
   </aerosurface_scale>

   <aerosurface_scale name="elevator normalization">
      <input>fcs/elevator-pos-rad</input>
      <domain>
        <min> -0.523 </min>
        <max>  0.35 </max> <!-- should be -0.523 to 0.35 -->
      </domain>
      <range>
        <min> -1 </min>
        <max>  1 </max>
      </range>
      <output>fcs/elevator-pos-norm</output>
   </aerosurface_scale>

  </channel>

  <channel name="Roll">
   <summer name="Roll Trim Sum">
      <input>fcs/aileron-cmd-norm</input>
      <input>fcs/roll-trim-cmd-norm</input>
      <input>ap/aileron-cmd</input>
      <clipto>
        <min> -1 </min>
        <max>  1 </max>
      </clipto>
   </summer>

   <aerosurface_scale name="Left Aileron Control">
      <input>fcs/roll-trim-sum</input>
      <range>
        <min> -0.523 </min>
        <max>  0.523 </max>
      </range>
      <output>fcs/left-aileron-pos-rad</output>
   </aerosurface_scale>

   <aerosurface_scale name="Right Aileron Control">
      <input>-fcs/roll-trim-sum</input>
      <range>
        <min> -0.523 </min>
        <max>  0.523 </max>
      </range>
      <output>fcs/right-aileron-pos-rad</output>
   </aerosurface_scale>

   <aerosurface_scale name="left aileron normalization">
      <input>fcs/left-aileron-pos-rad</input>
      <domain>
        <min> -0.523 </min>
        <max>  0.523 </max>
      </domain>
      <range>
        <min> -1.000 </min>
        <max>  1.000 </max>
      </range>
      <output>fcs/left-aileron-pos-norm</output>
   </aerosurface_scale>

   <aerosurface_scale name="right aileron normalization">
      <input>fcs/right-aileron-pos-rad</input>
      <domain>
        <min> -0.523 </min>
        <max>  0.523 </max>
      </domain>
      <range>
        <min> -1 </min>
        <max>  1 </max>
      </range>
      <output>fcs/right-aileron-pos-norm</output>
   </aerosurface_scale>

  </channel>

  <channel name="Yaw">
   <summer name="Rudder Command Sum">
      <input>fcs/rudder-cmd-norm</input>
      <input>fcs/yaw-trim-cmd-norm</input>
      <input>ap/rudder-cmd</input>
      <clipto> <!-- 33 degree each -->
        <min> -1 </min>
        <max>  1 </max>
<!--
        <min> -0.576 </min>
        <max>  0.576 </max>
-->
      </clipto>
   </summer>

   <aerosurface_scale name="Rudder Control">
      <input>fcs/rudder-command-sum</input>
      <range>
        <min> -0.576 </min>
        <max>  0.576 </max>
      </range>
      <output>fcs/rudder-pos-rad</output>
   </aerosurface_scale>

   <aerosurface_scale name="rudder normalization">
      <input>fcs/rudder-pos-rad</input>
      <domain>
        <min> -0.576 </min>
        <max>  0.576 </max>
      </domain>
      <range>
        <min> -1 </min>
        <max>  1 </max>
      </range>
      <output>fcs/rudder-pos-norm</output>
   </aerosurface_scale>

  </channel>

  <channel name="Flaps">
   <kinematic name="Flaps Control">
     <input>fcs/flap-cmd-norm</input>
     <traverse>
       <setting>
          <position>  0 </position>
          <time>      0 </time>
       </setting>
       <setting>
          <position> 20 </position>
          <time>      4 </time>
       </setting>
       <setting>
          <position> 40 </position>
          <time>      4 </time>
       </setting>
       <setting>
          <position> 60 </position>
          <time>      3 </time>
       </setting>
     </traverse>
     <output>fcs/flap-pos-deg</output>
   </kinematic>

   <aerosurface_scale name="flap normalization">
      <input>fcs/flap-pos-deg</input>
      <domain>
        <min>  0 </min>
        <max> 60 </max>
      </domain>
      <range>
        <min> 0 </min>
        <max> 1 </max>
      </range>
      <output>fcs/flap-pos-norm</output>
   </aerosurface_scale>

  </channel>
<!-- Gear code depends on left main, right main and tail being unit[0], unit[1] and unit[2] -->
  <channel name="Landing Gear">
   <kinematic name="Gear Control L">
     <input>gear/gear-cmd-norm</input>
     <traverse>
       <setting>
          <position> 0 </position>
          <time>     0 </time>
       </setting>
       <setting>
          <position> 1 </position>
          <time>     4 </time>
       </setting>
     </traverse>
     <output>gear/unit[0]/pos-norm</output>
     <output>gear/unit[2]/pos-norm</output>
   </kinematic>
<!-- Fix Me: They retract together. -->
  <switch name="gear/gear-cmd-norm_r">
    <default value="0"/>
    <test logic="AND" value="1">
      gear/unit[0]/pos-norm ge 0.98
      gear/gear-cmd-norm ge 0.98
     </test>
    <test logic="AND" value="1">
       gear/unit[0]/pos-norm ge 0.02
       gear/gear-cmd-norm le 0.02
     </test>
  </switch>

   <kinematic name="Gear Control R">
     <input>gear/gear-cmd-norm_r</input>
     <traverse>
       <setting>
          <position> 0 </position>
          <time>     0 </time>
       </setting>
       <setting>
          <position> 1 </position>
          <time>     4 </time>
       </setting>
     </traverse>
     <output>gear/unit[1]/pos-norm</output>
   </kinematic>
  </channel>

 </flight_control>

 <aerodynamics>
  <function name="aero/function/cos-alpha">
   <description>Cosine of alpha</description>
    <cos>
     <property>aero/alpha-rad</property>
    </cos>
  </function>

  <function name="aero/function/sin-alpha">
   <description>Sine of alpha</description>
    <sin>
     <property>aero/alpha-rad</property>
    </sin>
  </function>

  <function name="aero/function/cos-beta">
   <description>Cosine of beta</description>
    <cos>
     <property>aero/beta-rad</property>
    </cos>
  </function>

  <function name="aero/function/sin-beta">
   <description>Sine of beta</description>
    <sin>
     <property>aero/beta-rad</property>
    </sin>
  </function>

  <function name="aero/function/cos2-alpha">
   <description>Cosine Squared of alpha</description>
    <product>
     <property>aero/function/cos-alpha</property>
     <property>aero/function/cos-alpha</property>
    </product>
  </function>

  <function name="aero/function/scos2-alpha">
   <description>Signed Cosine Squared of alpha</description>
    <product>
     <abs><property>aero/function/cos-alpha</property></abs>
     <property>aero/function/cos-alpha</property>
    </product>
  </function>
 <function name="aero/function/velocity-induced-fps">
  <description> velocity including the propulsion induced velocity.</description>
  <sum>
   <property>velocities/u-fps</property>
   <property>propulsion/engine/prop-induced-velocity_fps</property>
  </sum>
 </function> 

 <function name="aero/function/qbar-induced-psf">
  <description> q bar including the propulsion induced velocity.</description>
  <product>
   <property>aero/function/velocity-induced-fps</property>
   <property>aero/function/velocity-induced-fps</property>
   <property>atmosphere/rho-slugs_ft3</property>
   <value>0.5</value>
  </product>
 </function> 

  <function name="aero/function/ground-effect-factor-normal">
   <description>Change in normal due to ground effect factor</description>
   <product>
    <table>
     <independentVar lookup="row">aero/h_b-mac-ft</independentVar>
     <independentVar lookup="column"><property>aero/function/sin-alpha</property></independentVar>
     <tableData>
             -1.0 0.000 1.0
        0.0   1.0 1.203 1.0
        0.1   1.0 1.127 1.0
        0.15  1.0 1.090 1.0
        0.2   1.0 1.073 1.0
        0.3   1.0 1.046 1.0
        0.4   1.0 1.055 1.0
        0.5   1.0 1.019 1.0
        0.6   1.0 1.013 1.0
        0.7   1.0 1.008 1.0
        0.8   1.0 1.006 1.0
        0.9   1.0 1.003 1.0
        1.0   1.0 1.002 1.0
        1.1   1.0 1.000 1.0
     </tableData>
    </table>
   </product>
  </function>

  <function name="aero/function/ground-effect-factor-axial">
   <description>Change in axial force due to ground effect</description>
   <product>
    <table>
     <independentVar lookup="row">aero/h_b-mac-ft</independentVar>
     <independentVar lookup="column"><property>aero/function/sin-alpha</property></independentVar>
     <tableData>
            -1.0 0.000 1.0
        0.0  1.0 0.480 1.0
        0.1  1.0 0.515 1.0
        0.15 1.0 0.629 1.0
        0.2  1.0 0.709 1.0
        0.3  1.0 0.815 1.0
        0.4  1.0 0.882 1.0
        0.5  1.0 0.928 1.0
        0.6  1.0 0.962 1.0
        0.7  1.0 0.988 1.0
        0.8  1.0 1.0   1.0
        0.9  1.0 1.0   1.0
        1.0  1.0 1.0   1.0
        1.1  1.0 1.0   1.0
     </tableData>
    </table>
   </product>
  </function>
  <axis name="NORMAL">

    <function name="aero/coefficient/CNalpha">
      <!-- -16 to 21 degrees from datcom, other range estimated -->
      <description>Normal_due_to_alpha</description>
      <product>
          <property>aero/function/ground-effect-factor-normal</property>
          <property>aero/qbar-psf</property>
          <property>metrics/Sw-sqft</property>
          <table>
            <independentVar lookup="row">aero/alpha-wing-rad</independentVar>
            <tableData>
	-3.1416	0.000
	-2.6180	-0.700
	-2.3562	-0.990
	-2.0944	-1.212
	-1.5708	-1.400
	-1.0472	-1.212
	-0.7854	-0.990
	-0.5236	-0.700
	-0.2793	-1.086
	-0.1396	-0.341
	-0.1047	-0.157
	-0.0698	0.023
	-0.0349	0.206
	-0.0175	0.299
	0.0000	0.393
	0.0175	0.488
	0.0349	0.585
	0.0698	0.780
	0.1047	0.958
	0.1396	1.107
	0.1745	1.223
	0.2094	1.309
	0.2443	1.255
	0.2793	1.135
	0.3142	1.054
	0.3316	1.029
	0.3491	1.000
	0.3665	0.972
	0.5236	0.700
	0.7854	0.990
	1.0472	1.212
	1.5708	1.400
	2.0944	1.212
	2.3562	0.990
	2.6180	0.700
	3.1416	0.000
            </tableData>
          </table>
      </product>
    </function>

    <function name="aero/coefficient/dCNflap">
<!-- Aeromatic -->
       <description>Delta_Lift_due_to_flaps</description>
       <product>
           <property>aero/function/ground-effect-factor-normal</property>
           <property>aero/function/scos2-alpha</property>
           <property>aero/function/qbar-induced-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>fcs/flap-pos-deg</property>
           <value> 0.01000 </value>
       </product>
    </function>

    <function name="aero/coefficient/CNde">
<!-- Aeromatic -->
       <description>Lift_due_to_Elevator_Deflection</description>
       <product>
           <property>aero/function/scos2-alpha</property>
           <property>aero/function/qbar-induced-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>fcs/elevator-pos-rad</property>
           <value>0.2</value>
       </product>
    </function>

  </axis>

  <axis name="AXIAL">

    <function name="aero/coefficient/CX0">
<!-- -16 to 21 degrees from datcom, other range estimated -->
       <description>Drag_at_zero_lift</description>
       <product>
          <property>aero/function/ground-effect-factor-axial</property>
          <property>aero/qbar-psf</property>
          <property>metrics/Sw-sqft</property>
          <table>
            <independentVar lookup="row">aero/alpha-wing-rad</independentVar>
            <tableData>
	-3.1416	0.220
	-2.6180	0.191
	-2.3562	0.156
	-2.0944	0.110
	-1.5708	0.000
	-1.0472	-0.110
	-0.7854	-0.156
	-0.5236	-0.191
	-0.2793	-0.226
	-0.1396	-0.030
	-0.1047	-0.003
	-0.0698	0.014
	-0.0349	0.022
	-0.0175	0.023
	0.0000	0.022
	0.0175	0.019
	0.0349	0.013
	0.0698	-0.006
	0.1047	-0.034
	0.1396	-0.071
	0.1745	-0.115
	0.2094	-0.162
	0.2443	-0.201
	0.2793	-0.222
	0.3142	-0.237
	0.3316	-0.246
	0.3491	-0.255
	0.3665	-0.262
	0.5236	-0.191
	0.7854	-0.156
	1.0472	-0.110
	1.5708	0.000
	2.0944	0.110
	2.3562	0.156
	2.6180	0.191
	3.1416	0.220
            </tableData>
          </table>
       </product>
    </function>
<!--
    <function name="aero/coefficient/CXi">
       <description>Induced_drag</description>
         <product>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>aero/cl-squared</property>
           <value>0.045</value>
         </product>
    </function>
-->
    <function name="aero/coefficient/CXmach">
<!-- Datcom -->
       <description>Drag_due_to_mach</description>
        <product>
          <property>aero/qbar-psf</property>
          <property>metrics/Sw-sqft</property>
          <table>
            <independentVar lookup="row">velocities/mach</independentVar>
            <tableData>
                0.00      0.000
                 .60       .01195
                 .70       .01224
                1.10       .8855
                1.40       .8916
            </tableData>
          </table>
        </product>
    </function>

    <function name="aero/coefficient/CXflap">
<!-- Aeromatic -->
       <description>Drag_due_to_flaps</description>
         <product>
           <property>aero/function/ground-effect-factor-axial</property>
           <property>aero/function/scos2-alpha</property>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>fcs/flap-pos-deg</property>
           <value> 0.00133 </value>
         </product>
    </function>

    <function name="aero/coefficient/CXgear-left">
<!-- Aeromatic Modified for two gears -->
       <description>Drag_due_to_gear</description>
         <product>
           <property>aero/function/scos2-alpha</property>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>gear/unit[0]/pos-norm</property>
           <value>0.015</value>
         </product>
    </function>
    <function name="aero/coefficient/CXgear-right">
<!-- Aeromatic  Modified for two gears -->
       <description>Drag_due_to_gear</description>
         <product>
           <property>aero/function/scos2-alpha</property>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>gear/unit[1]/pos-norm</property>
           <value>0.015</value>
         </product>
    </function>

<!--
    <function name="aero/coefficient/CXbeta">
       <description>Drag_due_to_sideslip</description>
       <product>
          <property>aero/qbar-psf</property>
          <property>metrics/Sw-sqft</property>
          <table>
            <independentVar lookup="row">aero/beta-rad</independentVar>
            <tableData>
              -3.14  0.00
              -2.88  0.050
              -1.57    1.230
              -0.26    0.050
               0.00    0.000
               0.26    0.050
               1.57    1.230
               2.88  0.050
               3.14  0.0
            </tableData>
          </table>
       </product>
    </function>
-->
    <function name="aero/coefficient/CXde">
<!-- Guess -->
       <description>Drag_due_to_Elevator_Deflection</description>
       <product>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>fcs/mag-elevator-pos-rad</property>
           <value>0.04</value>
       </product>
    </function>

  </axis>

  <axis name="SIDE">

    <function name="aero/coefficient/CYb">
<!-- Datcom -->
       <description>Side_force_due_to_beta</description>
       <product>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>aero/function/sin-beta</property>
           <value>-0.8</value>
       </product>
    </function>

    <function name="aero/coefficient/CYr">
<!-- guess -->
       <description>Side_force_due_to_yaw_rate</description>
       <product>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>metrics/bw-ft</property>
           <property>aero/bi2vel</property>
           <property>velocities/r-aero-rad_sec</property>
           <value>0.</value>
       </product>
    </function>

    <function name="aero/coefficient/CYp">
<!-- guess -->
       <description>Side_force_due_to_roll_rate</description>
       <product>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>metrics/bw-ft</property>
           <property>aero/bi2vel</property>
           <property>velocities/p-aero-rad_sec</property>
           <value>0.</value>
       </product>
    </function>

    <function name="aero/coefficient/CYdr">
<!-- guess -->
       <description>Side_force_due_to_rudder</description>
       <product>
           <property>aero/function/cos-beta</property>
           <property>aero/function/qbar-induced-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>fcs/rudder-pos-rad</property>
           <value>0.</value>
       </product>
    </function>

  </axis>

  <axis name="ROLL">

    <function name="aero/coefficient/Clb">
       <description>Roll_moment_due_to_beta</description>
<!-- DATCOM -->
       <product>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>metrics/bw-ft</property>
           <property>aero/function/sin-beta</property>
           <value>-0.072</value>
       </product>
    </function>

    <function name="aero/coefficient/Clp">
       <description>Roll_moment_due_to_roll_rate</description>
<!-- Aeromatic -->
       <product>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>metrics/bw-ft</property>
           <property>aero/bi2vel</property>
           <property>velocities/p-aero-rad_sec</property>
           <value>-0.4</value>
       </product>
    </function>

    <function name="aero/coefficient/Clr">
<!-- Aeromatic -->
       <description>Roll_moment_due_to_yaw_rate</description>
       <product>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>metrics/bw-ft</property>
           <property>aero/bi2vel</property>
           <property>velocities/r-aero-rad_sec</property>
           <value>0.15</value>
       </product>
    </function>

    <function name="aero/coefficient/Clda">
       <description>Roll_moment_due_to_aileron</description>
<!-- Aeromatic -->
       <product>
          <property>aero/qbar-psf</property>
          <property>metrics/Sw-sqft</property>
          <property>metrics/bw-ft</property>
          <property>fcs/left-aileron-pos-rad</property>
          <table>
            <independentVar lookup="row">velocities/mach</independentVar>
            <tableData>
              0.0    0.180
              2.0    0.060
            </tableData>
          </table>
       </product>
    </function>

    <function name="aero/coefficient/Cldr">
       <description>Roll_moment_due_to_rudder</description>
<!-- Aeromatic -->
       <product>
           <property>aero/function/qbar-induced-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>metrics/bw-ft</property>
           <property>fcs/rudder-pos-rad</property>
           <value>0.01</value>
       </product>
    </function>

  </axis>

  <axis name="PITCH">

    <function name="aero/coefficient/Cmalpha">
<!-- Aeromatic -->
       <description>Pitch_moment_due_to_alpha</description>
       <product>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>metrics/cbarw-ft</property>
           <property>aero/function/sin-alpha</property>
           <value>-0.5</value>
       </product>
    </function>

    <function name="aero/coefficient/Cmde">
<!-- Aeromatic -->
       <description>Pitch_moment_due_to_elevator</description>
       <product>
          <property>aero/function/cos-alpha</property>
          <property>aero/function/qbar-induced-psf</property>
          <property>metrics/Sw-sqft</property>
          <property>metrics/cbarw-ft</property>
          <property>fcs/elevator-pos-rad</property>
          <table>
            <independentVar lookup="row">velocities/mach</independentVar>
            <tableData>
              0.0     -1.000
              2.0     -0.250
            </tableData>
          </table>
       </product>
    </function>

    <function name="aero/coefficient/Cmq">
<!-- Aeromatic -->
       <description>Pitch_moment_due_to_pitch_rate</description>
       <product>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>metrics/cbarw-ft</property>
           <property>aero/ci2vel</property>
           <property>velocities/q-aero-rad_sec</property>
           <value>-15</value>
       </product>
    </function>

    <function name="aero/coefficient/Cmadot">
<!-- Aeromatic -->
       <description>Pitch_moment_due_to_alpha_rate</description>
       <product>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>metrics/cbarw-ft</property>
           <property>aero/ci2vel</property>
           <property>aero/alphadot-rad_sec</property>
           <value>-7</value>
       </product>
    </function>

  </axis>

  <axis name="YAW">

    <function name="aero/coefficient/Cnb">
<!-- DATCOM -->
       <description>Yaw_moment_due_to_beta</description>
       <product>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>metrics/bw-ft</property>
           <property>aero/function/sin-beta</property>
           <value>0.049</value>
       </product>
    </function>

    <function name="aero/coefficient/Cnr">
<!-- Aeromatic -->
       <description>Yaw_moment_due_to_yaw_rate</description>
       <product>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>metrics/bw-ft</property>
           <property>aero/bi2vel</property>
           <property>velocities/r-aero-rad_sec</property>
           <value>-0.15</value>
       </product>
    </function>

    <function name="aero/coefficient/Cnp">
<!-- Aeromatic -->
       <description>Yaw_moment_due_to_roll_rate</description>
       <product>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>metrics/bw-ft</property>
           <property>aero/bi2vel</property>
           <property>velocities/p-aero-rad_sec</property>
           <value> 0.018</value>
       </product>
    </function>

    <function name="aero/coefficient/Cndr">
<!-- Aeromatic -->
       <description>Yaw_moment_due_to_rudder</description>
       <product>
           <property>aero/function/qbar-induced-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>metrics/bw-ft</property>
           <property>fcs/rudder-pos-rad</property>
           <value>-0.1</value>
       </product>
    </function>

    <function name="aero/coefficient/Cnda">
<!-- Aeromatic -->
       <description>Adverse_yaw</description>
       <product>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>metrics/bw-ft</property>
           <property>fcs/left-aileron-pos-rad</property>
           <value>-0.003</value> <!-- was 0.003 -->
       </product>
    </function>

    <function name="aero/coefficient/Cngear">
<!-- Axial force for each gear already computed. 11.5 is distance in feet between main gears. -->
       <description>Yaw_force_due_to_asymetric_gear_deflection</description>
       <product>
         <difference>
           <property>aero/coefficient/CXgear-right</property>
           <property>aero/coefficient/CXgear-left</property>
         </difference>
         <value>11.5</value>
       </product>
    </function>     

  </axis>

 </aerodynamics>
 
    <external_reactions>
 
 <!-- Hook-->
 
    <force name="hook" frame="BODY">
        <location unit="IN">
            <x>176</x>
            <y>0.0 </y>
            <z>-20</z>
        </location>
        <direction>
            <x>-1  </x>
            <y>0</y>
            <z>0.15</z>
        </direction>
    </force>
        
    </external_reactions>

</fdm_config>
