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

    <fileheader>
        <author>Gijs de Rooy</author>
        <filecreationdate>2008</filecreationdate>
        <version>20230103</version>
        <description>Boeing 747-400 with GE CF6-80C2B1F engines</description>

        <license>
            <licenseName>GPL</licenseName>
            <licenseURL>http://www.gnu.org/licenses/gpl.html</licenseURL>
        </license>

        <reference
          refID="747 airplane characteristics, D6-58236"
          author="The Boeing Company"
          title="http://www.boeing.com/"
          date="May 1984"/>        
        <reference
          refID=""
          author="The Boeing Company"
          title="747-469/-4F6 Flight Crew Operations Manual, Philipine Airlines"
          date="2 September 1993"/>
        <reference
          refID=""
          author="The Boeing Company"
          title="747-400 Flight Planning and Performance Manual"
          date="2000"/>
        <reference
          refID=""
          author="The Boeing Company"
          title="747-400 Maintenance Manual, JAL"
          date="18 February 2007"/>
        <reference
          refID=""
          author="The Boeing Company"
          title="The Simulation of a Large Jet Transport Aircraft Volume I: Mathematical Model"
          date="March 1971"/>
        <reference
          refID="D6-30643"
          author="The Boeing Company"
          title="The Simulation of a Jumbo Jet Transport Aircraft Volume II: Modeling Data"
          date="September 1970"/>
        <reference
          refID=""
          author="Koray Kosari, Seher Durmaz, Elbrous M. Jafarov"
          title="Longitudinal Dynamics Analysis of Boeing 747-400"
          date="May 2007"/>

    </fileheader>

    <metrics>
        <wingarea unit="FT2"> 5825 </wingarea>
        <wingspan unit="FT"> 211.5 </wingspan>
        <chord unit="IN"> 327.78 </chord>
        <htailarea unit="FT2"> 1470.35 </htailarea>
        <htailarm unit="FT"> 106.63 </htailarm>
        <vtailarea unit="FT2"> 1060 </vtailarea>
        <vtailarm unit="FT"> 0 </vtailarm>
        <wing_incidence unit="DEG"> 2 </wing_incidence>
        <location name="AERORP" unit="IN">
            <x> 1340 </x> <!-- located at 25% MAC = 1258+0.25*327.78, automatically moved to coincide with CoG -->
            <y>    0 </y>
            <z>   39 </z> <!-- GUESSTIMATE -->
        </location>
        <location name="EYEPOINT" unit="IN">
            <x> 218 </x>
            <y> -21 </y>
            <z>  80 </z>
        </location>
        <location name="VRP" unit="IN">
            <x> 1263 </x>
            <y>    0 </y>
            <z>    0 </z>
        </location>
    </metrics>

    <mass_balance>
        <documentation>
          - operational empty weight = 394088 lb
          - empty CG at 23 % MAC (no payload)
            
            inertia for empty weight from NASA
        </documentation>
        <ixx unit="SLUG*FT2"> 1.23e+07 </ixx>
        <iyy unit="SLUG*FT2"> 2.43e+07 </iyy>
        <izz unit="SLUG*FT2"> 3.52e+07 </izz>
        <ixy unit="SLUG*FT2"> 0 </ixy>
        <ixz unit="SLUG*FT2"> 0.74e+06 </ixz>
        <iyz unit="SLUG*FT2"> 0 </iyz>
        <emptywt unit="KG"> 180990  </emptywt> <!-- 3 pilots, 17 cabin crew, includes water, blankets etc. -->
        <location name="CG" unit="IN">
            <x> 1342 </x> <!-- GUESSTIMATE, based on TUI document and CG calculation -->
            <y>    0 </y>
            <z>   39 </z> <!-- GUESSTIMATE -->
        </location>
        
        <!-- average passenger is 80 kg -->
        
        <pointmass name="Passengers 0A">
            <weight unit="KG"> 3200 </weight> <!-- 40 passengers -->
            <location name="POINTMASS" unit="IN">
            <x> 348 </x>
            <y>   0 </y>
            <z>  37 </z> <!-- GUESSTIMATE -->
            </location>
        </pointmass>
        <pointmass name="Passengers 0B (upper)">
            <weight unit="KG"> 2400 </weight> <!-- 30 passengers -->
            <location name="POINTMASS" unit="IN">
            <x> 678 </x>
            <y>   0 </y>
            <z> 142 </z> <!-- GUESSTIMATE -->
            </location>
        </pointmass>
        <pointmass name="Passengers 0B (lower)">
            <weight unit="KG"> 5600 </weight> <!-- 70 passengers -->
            <location name="POINTMASS" unit="IN">
            <x> 678 </x>
            <y>   0 </y>
            <z>  37 </z> <!-- GUESSTIMATE -->
            </location>
        </pointmass>
        <pointmass name="Passengers 0C">
            <weight unit="KG"> 8800 </weight> <!-- 110 passengers -->
            <location name="POINTMASS" unit="IN">
            <x> 1073 </x>
            <y>    0 </y>
            <z>   37 </z> <!-- GUESSTIMATE -->
            </location>
        </pointmass>
        <pointmass name="Passengers 0D">
            <weight unit="KG"> 8000 </weight> <!-- 100 passengers -->
            <location name="POINTMASS" unit="IN">
            <x> 1490 </x>
            <y>    0 </y>
            <z>   37 </z> <!-- GUESSTIMATE -->
            </location>
        </pointmass>
        <pointmass name="Passengers 0E">
            <weight unit="KG"> 12000 </weight> <!-- 150 passengers -->
            <location name="POINTMASS" unit="IN">
            <x> 1968 </x>
            <y>    0 </y>
            <z>   37 </z> <!-- GUESSTIMATE -->
            </location>
        </pointmass>
        <pointmass name="Cargo 1">
            <weight unit="KG"> 0 </weight> <!-- 3 full-width (7000 lbs) or 6 half-width (3500 lbs) containers -->
            <location name="POINTMASS" unit="IN">
               <x> 574 </x>
               <y>   0 </y>
               <z> -54 </z>
            </location>
        </pointmass>
        <pointmass name="Cargo 2">
            <weight unit="KG"> 2000 </weight> <!-- 5 full-width (7000 lbs) or 10 half-width (3500 lbs) containers -->
            <location name="POINTMASS" unit="IN">
               <x> 817 </x>
               <y>   0 </y>
               <z> -54 </z>
            </location>
        </pointmass>
        <pointmass name="Cargo 3">
            <weight unit="KG"> 5000 </weight> <!-- 3 full-width (7000 lbs) or 6 half-width (3500 lbs) containers -->
            <location name="POINTMASS" unit="IN">
               <x> 1576 </x>
               <y>    0 </y>
               <z>  -54 </z>
            </location>
        </pointmass>
        <pointmass name="Cargo 4">
            <weight unit="KG"> 6000 </weight> <!-- 4 full-width (7000 lbs) or 8 half-width (3500 lbs) containers -->
            <location name="POINTMASS" unit="IN">
               <x> 1789 </x>
               <y>    0 </y>
               <z>  -54 </z>
            </location>
        </pointmass>
        <pointmass name="Cargo 5">
            <weight unit="KG"> 500 </weight> <!-- 1 full-width (7000 lbs) or 2 half-width (3500 lbs) containers -->
            <location name="POINTMASS" unit="IN">
               <x> 2008 </x>
               <y>    0 </y>
               <z>  -54 </z>
            </location>
        </pointmass>
    </mass_balance>

    <ground_reactions>
        <documentation>
           - gear height determined by 3D model, supposed at scale.
           - additonal contact points for crash detection, when gear retracted.
        </documentation>

        <contact type="BOGEY" name="NOSE">
            <location unit="IN">
                <x>  395.0  </x>
                <y>    0.0  </y>
                <z> -221.46 </z>
            </location>
            <static_friction> 0.5 </static_friction>
            <dynamic_friction> 0.5 </dynamic_friction>
            <rolling_friction> 0.015 </rolling_friction>
            <spring_coeff unit="LBS/FT"> 160000 </spring_coeff>
            <damping_coeff unit="LBS/FT/SEC"> 80000 </damping_coeff>
            <max_steer unit="DEG"> 70 </max_steer>
            <brake_group> NONE </brake_group>
            <retractable>1</retractable>
        </contact>
        <contact type="BOGEY" name="LEFT_WING">
            <location unit="IN">
                <x> 1342.5  </x>
                <y> -216.6  </y>
                <z> -203.27 </z>
            </location>
            <static_friction> 0.5 </static_friction>
            <dynamic_friction> 0.5 </dynamic_friction>
            <rolling_friction> 0.015 </rolling_friction>
            <spring_coeff unit="LBS/FT"> 833000 </spring_coeff>
            <damping_coeff unit="LBS/FT/SEC"> 166600 </damping_coeff>
            <max_steer unit="DEG"> 0.0 </max_steer>
            <brake_group> LEFT </brake_group>
            <retractable>1</retractable>
        </contact>
        <contact type="BOGEY" name="LEFT_BODY">
            <location unit="IN">
                <x> 1463.5  </x>
                <y>  -75.6  </y>
                <z> -203.27 </z>
            </location>
            <static_friction> 0.5 </static_friction>
            <dynamic_friction> 0.5 </dynamic_friction>
            <rolling_friction> 0.015 </rolling_friction>
            <spring_coeff unit="LBS/FT"> 833000 </spring_coeff>
            <damping_coeff unit="LBS/FT/SEC"> 166600 </damping_coeff>
            <max_steer unit="DEG"> 13 </max_steer>
            <brake_group> LEFT </brake_group>
            <retractable>1</retractable>
        </contact>
        <contact type="BOGEY" name="RIGHT_BODY">
            <location unit="IN">
                <x> 1463.5  </x>
                <y>   75.6  </y>
                <z> -203.27 </z>
            </location>
            <static_friction> 0.5 </static_friction>
            <dynamic_friction> 0.5 </dynamic_friction>
            <rolling_friction> 0.015 </rolling_friction>
            <spring_coeff unit="LBS/FT"> 833000 </spring_coeff>
            <damping_coeff unit="LBS/FT/SEC"> 166600 </damping_coeff>
            <max_steer unit="DEG"> 13 </max_steer>
            <brake_group> RIGHT </brake_group>
            <retractable>1</retractable>
        </contact>
        <contact type="BOGEY" name="RIGHT_WING">
            <location unit="IN">
                <x> 1342.5  </x>
                <y>  216.6  </y>
                <z> -203.27 </z>
            </location>
            <static_friction> 0.8 </static_friction>
            <dynamic_friction> 0.5 </dynamic_friction>
            <rolling_friction> 0.015 </rolling_friction>
            <spring_coeff unit="LBS/FT"> 833000 </spring_coeff>
            <damping_coeff unit="LBS/FT/SEC"> 166600 </damping_coeff>
            <max_steer unit="DEG"> 0.0 </max_steer>
            <brake_group> RIGHT </brake_group>
            <retractable>1</retractable>
        </contact>

        <contact type="BOGEY" name="NOSE_GROUND">
            <location unit="IN">
                <x> 340.0 </x>
                <y>   0.0 </y>
                <z> -90.0 </z>
            </location>
            <static_friction> 0.8 </static_friction>
            <dynamic_friction> 20 </dynamic_friction>
            <rolling_friction> 0.02 </rolling_friction>
            <spring_coeff unit="LBS/FT"> 249900 </spring_coeff>
            <damping_coeff unit="LBS/FT/SEC"> 83300 </damping_coeff>
            <max_steer unit="DEG"> 0 </max_steer>
            <brake_group> NONE </brake_group>
            <retractable>0</retractable>
        </contact>
        <contact type="BOGEY" name="LEFT_GROUND">
            <location unit="IN">
                <x> 1420.0 </x>
                <y>  -78.0 </y>
                <z> -110.0 </z>
            </location>
            <static_friction> 0.8 </static_friction>
            <dynamic_friction> 20 </dynamic_friction>
            <rolling_friction> 0.02 </rolling_friction>
            <spring_coeff unit="LBS/FT"> 249900 </spring_coeff>
            <damping_coeff unit="LBS/FT/SEC"> 83300 </damping_coeff>
            <max_steer unit="DEG"> 0 </max_steer>
            <brake_group> NONE </brake_group>
            <retractable>0</retractable>
        </contact>
        <contact type="BOGEY" name="RIGHT_GROUND">
            <location unit="IN">
                <x> 1420.0 </x>
                <y>   78.0 </y>
                <z> -110.0 </z>
            </location>
            <static_friction> 0.8 </static_friction>
            <dynamic_friction> 20 </dynamic_friction>
            <rolling_friction> 0.02 </rolling_friction>
            <spring_coeff unit="LBS/FT"> 249900 </spring_coeff>
            <damping_coeff unit="LBS/FT/SEC"> 83300 </damping_coeff>
            <max_steer unit="DEG"> 0 </max_steer>
            <brake_group> NONE </brake_group>
            <retractable>0</retractable>
        </contact>

        <contact type="STRUCTURE" name="NOSE_TIP">
            <location unit="IN">
                <x> 90.0  </x>
                <y>  0.0  </y>
                <z> 16.66 </z>
            </location>
            <static_friction> 0.8 </static_friction>
            <dynamic_friction> 0.5 </dynamic_friction>
            <rolling_friction> 0.02 </rolling_friction>
            <spring_coeff unit="LBS/FT"> 249900 </spring_coeff>
            <damping_coeff unit="LBS/FT/SEC"> 83300 </damping_coeff>
            <max_steer unit="DEG"> 0.0 </max_steer>
            <brake_group> NONE </brake_group>
            <retractable>0</retractable>
        </contact>
        <contact type="STRUCTURE" name="LEFT_WING_TIP">
            <location unit="IN">
                <x>  2000.0 </x>
                <y> -1247.0 </y>
                <z>    55.0 </z>
            </location>
            <static_friction> 0.8 </static_friction>
            <dynamic_friction> 0.5 </dynamic_friction>
            <rolling_friction> 0.02 </rolling_friction>
            <spring_coeff unit="LBS/FT"> 833000 </spring_coeff>
            <damping_coeff unit="LBS/FT/SEC"> 166600 </damping_coeff>
            <max_steer unit="DEG"> 0.0 </max_steer>
            <brake_group> NONE </brake_group>
            <retractable>0</retractable>
        </contact>
        <contact type="STRUCTURE" name="RIGHT_WING_TIP">
            <location unit="IN">
                <x> 2000.0 </x>
                <y> 1247.0 </y>
                <z>   55.0 </z>
            </location>
            <static_friction> 0.8 </static_friction>
            <dynamic_friction> 0.5 </dynamic_friction>
            <rolling_friction> 0.02 </rolling_friction>
            <spring_coeff unit="LBS/FT"> 833000 </spring_coeff>
            <damping_coeff unit="LBS/FT/SEC"> 166600 </damping_coeff>
            <max_steer unit="DEG"> 0.0 </max_steer>
            <brake_group> NONE </brake_group>
            <retractable>0</retractable>
        </contact>
        <contact type="STRUCTURE" name="TAIL_TIP">
            <location unit="IN">
                <x> 2792.0 </x>
                <y>    0.0 </y>
                <z>  128.0 </z>
            </location>
            <static_friction> 0.8 </static_friction>
            <dynamic_friction> 0.5 </dynamic_friction>
            <rolling_friction> 0.02 </rolling_friction>
            <spring_coeff unit="LBS/FT"> 249900 </spring_coeff>
            <damping_coeff unit="LBS/FT/SEC"> 83300 </damping_coeff>
            <max_steer unit="DEG"> 0.0 </max_steer>
            <brake_group> NONE </brake_group>
            <retractable>0</retractable>
        </contact>
        
    </ground_reactions>
    
    <propulsion>

        <engine file="GE_CF6-80C2B1F">
            <feed>1</feed>
            <thruster file="direct">
                <location unit="IN">
                    <x> 1400 </x>
                    <y> -834 </y>
                    <z> -100 </z>
                </location>
                <orient unit="DEG">
                    <roll>  0.0 </roll>
                    <pitch> 0.0 </pitch>
                    <yaw>   0.0 </yaw>
                </orient>
            </thruster>
        </engine>

        <engine file="GE_CF6-80C2B1F">
            <feed>2</feed>
            <thruster file="direct">
                <location unit="IN">
                    <x>  900 </x>
                    <y> -470 </y>
                    <z> -100 </z>
                </location>
                <orient unit="DEG">
                    <roll>  0.0 </roll>
                    <pitch> 0.0 </pitch>
                    <yaw>   0.0 </yaw>
                </orient>
            </thruster>
        </engine>

        <engine file="GE_CF6-80C2B1F">
            <feed>3</feed>
            <thruster file="direct">
                <location unit="IN">
                    <x>  900 </x>
                    <y>  470 </y>
                    <z> -100 </z>
                </location>
                <orient unit="DEG">
                    <roll>  0.0 </roll>
                    <pitch> 0.0 </pitch>
                    <yaw>   0.0 </yaw>
                </orient>
            </thruster>
        </engine>

        <engine file="GE_CF6-80C2B1F">
            <feed>4</feed>
            <thruster file="direct">
                <location unit="IN">
                    <x> 1400 </x>
                    <y>  834 </y>
                    <z> -100 </z>
                </location>
                <orient unit="DEG">
                    <roll>  0.0 </roll>
                    <pitch> 0.0 </pitch>
                    <yaw>   0.0 </yaw>
                </orient>
            </thruster>
        </engine>
        
        <engine file="APU_PW901">
            <feed>2</feed>
            <thruster file="direct">
                <location unit="IN">
                    <x> 2700 </x>
                    <y>    0 </y>
                    <z>  120 </z>
                </location>
                <orient unit="DEG">
                    <roll>  0.0 </roll>
                    <pitch> 0.0 </pitch>
                    <yaw>   0.0 </yaw>
                </orient>
            </thruster>
        </engine>

        <!-- Y and Z locations are guestimates
             X locations are based on TUI balance sheet -->
        <tank type="FUEL">    <!-- Tank number 0 == center wing--> 
            <location unit="IN">
                <x> 1107 </x>
                <y>    0 </y>
                <z>  -39 </z>
            </location>
            <capacity unit="LBS"> 114972.0 </capacity>
            <contents unit="LBS">      0.0 </contents>
            <temperature> 70 </temperature>
        </tank>
        
        <tank type="FUEL">    <!-- Tank number 1 == main #1--> 
            <location unit="IN">
                <x> 1491 </x>
                <y> -673 </y>
                <z>   -4 </z>
            </location>
            <capacity unit="LBS"> 29694.4 </capacity>
            <contents unit="LBS"> 29694.4 </contents>
            <temperature> 70 </temperature>
        </tank>

        <tank type="FUEL">    <!-- Tank number 2 == main #2--> 
            <location unit="IN">
                <x> 1212 </x>
                <y> -322 </y>
                <z>  -28 </z>
            </location>
            <capacity unit="LBS"> 84058.0 </capacity>
            <contents unit="LBS"> 66138.0 </contents>
            <temperature> 70 </temperature>
        </tank>

        <tank type="FUEL">    <!-- Tank number 3 == main #3--> 
            <location unit="IN">
                <x> 1212 </x>
                <y>  322 </y>
                <z>  -28 </z>
            </location>
            <capacity unit="LBS"> 84058.0 </capacity>
            <contents unit="LBS"> 66138.0 </contents>
            <temperature> 70 </temperature>
        </tank>

        <tank type="FUEL">    <!-- Tank number 4 == Main #4--> 
            <location unit="IN">
                <x> 1491 </x>
                <y>  673 </y>
                <z>   -4 </z>
            </location>
            <capacity unit="LBS"> 29694.4 </capacity>
            <contents unit="LBS"> 29694.4 </contents>
            <temperature> 70 </temperature>
        </tank>
        
        <tank type="FUEL">    <!-- Tank number 5 == reserve #2--> 
            <location unit="IN">
                <x>  1732 </x>
                <y> -1035 </y>
                <z>    35 </z>
            </location>
            <capacity unit="LBS"> 8857.4 </capacity>
            <contents unit="LBS"> 8857.4 </contents>
            <temperature> 70 </temperature>
        </tank>

        <tank type="FUEL">    <!-- Tank number 6 == reserve #3--> 
            <location unit="IN">
                <x> 1732 </x>
                <y> 1035 </y>
                <z>   35 </z>
            </location>
            <capacity unit="LBS"> 8857.4 </capacity>
            <contents unit="LBS"> 8857.4 </contents>
            <temperature> 70 </temperature>
        </tank>

        <tank type="FUEL">    <!-- Tank number 7 == stab--> 
            <location unit="IN">
                <x> 2560 </x>
                <y>    0 </y>
                <z>   98 </z>
            </location>
            <capacity unit="LBS"> 22110.0 </capacity>
            <contents unit="LBS">     0.0 </contents>
            <temperature> 70 </temperature>
        </tank>
    </propulsion>

    <system file="engines"/>
    <system file="failures"/>
    <system file="flaps"/>
    <system file="fuel"/>
    <system file="gear"/>
    <system file="hydraulics"/>
    <system file="systems"/>
    <system file="wingflex"/>

    <flight_control name="747-400">
    <property>fcs/LE-flap-cmd-norm</property>
    <property>fcs/stabilizer/pos-deg</property>
    <property>fcs/speed-brake-handle-pos-deg</property>
    <property>fcs/wheel-pos-deg</property>
    
    <channel name="Pitch">
    
        <!-- elevator -->
        
        <!-- When the control column is in the neutral position, 
            the inboard sections are deflected 1 deg trailing edge up and 
            the outboard sections are deflected 1 deg trailing edge down.
            http://www.mlit.go.jp/jtsb/eng-air_report/JA8903.pdf -->
        <fcs_function name="fcs/elevator[1]/int-pos-rad">
            <function>
                <toradians>
                    <table>
                        <independentVar>fcs/elevator-cmd-norm</independentVar>
                        <tableData>
                            -1 -25
                             0  -1
                             1  15
                        </tableData>
                    </table>
                </toradians>
            </function>
        </fcs_function>
        
        <fcs_function name="fcs/elevator[0]/int-pos-rad">
            <function>
                <toradians>
                    <table>
                        <independentVar>fcs/elevator-cmd-norm</independentVar>
                        <tableData>
                            -1 -23
                             0   1
                             1  17
                        </tableData>
                    </table>
                </toradians>
            </function>
        </fcs_function>
        
        <fcs_function name="fcs/inboard-elevator-float-pos-rad">
            <function>
                <sum>
                    <toradians>
                        <table>
                            <independentVar lookup="row">velocities/mach</independentVar>
                            <independentVar lookup="column">atmosphere/density-altitude</independentVar>
                            <tableData>
                                       0    40000
                                0      0        0
                                0.3   -2        0
                                0.7   -0.6     -0.6
                            </tableData>
                        </table>
                    </toradians>
                    <product>
                        <table>
                            <independentVar>velocities/mach</independentVar>
                            <tableData>
                                0     -0.18
                                0.3   -0.17
                                0.6   -0.08
                                0.85   0.28
                            </tableData>
                        </table>
                        <property>fcs/stabilizer/pos-deg</property>
                    </product>
                </sum>
            </function>
        </fcs_function>
        
        <fcs_function name="fcs/inboard-elevator-float-blowdown-min">
            <function>
                <toradians>
                    <table>
                        <independentVar lookup="row">velocities/ve-kts</independentVar>
                        <independentVar lookup="column">atmosphere/density-altitude</independentVar>
                        <tableData>
                                      0  40000
                               0    -25    -24
                             270    -25    -24
                             276    -25    -23.2
                             313    -25    -23.2
                             430    -15    -23.2
                        </tableData>
                    </table>
                </toradians>
            </function>
        </fcs_function>
        
        <fcs_function name="fcs/inboard-elevator-float-blowdown-max">
            <function>
                <toradians>
                    <table>
                        <independentVar lookup="row">velocities/ve-kts</independentVar>
                        <independentVar lookup="column">atmosphere/density-altitude</independentVar>
                        <tableData>
                                      0  40000
                               0     15     15
                             247     15     15
                             276     15     14
                        </tableData>
                    </table>
                </toradians>
            </function>
        </fcs_function>
        
        <switch name="fcs/elevator[1]/int-pos-rad">
            <default value="fcs/elevator[1]/int-pos-rad"/>
            <test logic="AND" value="fcs/inboard-elevator-float-pos-rad">
                /systems/hydraulic/pressure[0] LT 1000
                /systems/hydraulic/pressure[3] LT 1000
            </test>
        </switch>
        
        <switch name="fcs/elevator-rate-down">
            <default value="0.646" /> <!-- 37 deg/s -->
            <test logic="AND" value="0.524"> <!-- 30 deg/s -->
                /systems/hydraulic/pressure[0] GT 1000
                /systems/hydraulic/pressure[3] LT 1000
            </test>
            <test logic="AND" value="0.524"> <!-- 30 deg/s -->
                /systems/hydraulic/pressure[0] LT 1000
                /systems/hydraulic/pressure[3] GT 1000
            </test>
        </switch>
        
        <switch name="fcs/elevator-rate-up">
            <default value="0.646" /> <!-- 37 deg/s -->
            <test logic="AND" value="0.4538"> <!-- 26 deg/s -->
                /systems/hydraulic/pressure[0] GT 1000
                /systems/hydraulic/pressure[3] LT 1000
            </test>
            <test logic="AND" value="0.4538"> <!-- 26 deg/s -->
                /systems/hydraulic/pressure[0] LT 1000
                /systems/hydraulic/pressure[3] GT 1000
            </test>
        </switch>
        
        <actuator name="fcs/elevator[1]/actuator">
            <input>fcs/elevator[1]/int-pos-rad</input>
            <rate_limit sense="decr"> fcs/elevator-rate-down </rate_limit> <!-- I assume this is right? when I move elevator down, it is going from -1 to 1. When I move elevator up it is going back to -1? -->
            <rate_limit sense="incr"> fcs/elevator-rate-up </rate_limit>
            <clipto>
                <min>fcs/inboard-elevator-float-blowdown-min</min>
                <max>fcs/inboard-elevator-float-blowdown-max</max>
            </clipto>
            <output>fcs/elevator[1]/pos-rad</output>
        </actuator>
    
        <aerosurface_scale name="fcs/elevator[1]/pos-norm">
            <input>fcs/elevator[1]/pos-rad</input>
            <domain>
                <min>-0.4363</min> <!-- -25 deg -->
                <max> 0.2618</max> <!-- +15 deg -->
            </domain>
            <zero_centered>false</zero_centered>
            <range>
                <min>-1</min>
                <max>1</max>
            </range>
        </aerosurface_scale>
        
        <fcs_function name="fcs/outboard-elevator-float-pos-rad">
            <function>
                <sum>
                    <toradians>
                        <table>
                            <independentVar lookup="row">velocities/mach</independentVar>
                            <independentVar lookup="column">atmosphere/density-altitude</independentVar>
                            <tableData>
                                      0    40000
                                0     0        0
                                0.3   0        0
                                0.6   2        0
                                0.8   1.5      1.4
                                0.97  0        0
                            </tableData>
                        </table>
                    </toradians>
                    <product>
                        <table>
                            <independentVar>velocities/mach</independentVar>
                            <tableData>
                                0     -0.4
                                0.3   -0.4
                                0.6   -0.35
                                0.85  -0.14
                            </tableData>
                        </table>
                        <property>fcs/stabilizer/pos-deg</property>
                    </product>
                </sum>
            </function>
        </fcs_function>
        
        <switch name="fcs/elevator[0]/int-pos-rad">
            <default value="fcs/elevator[0]/int-pos-rad"/>
            <test logic="AND" value="fcs/outboard-elevator-float-pos-rad">
                /systems/hydraulic/pressure[0] LT 1000
                /systems/hydraulic/pressure[3] LT 1000
            </test>
        </switch>
        
        <actuator name="fcs/elevator[0]/actuator">
            <input>fcs/elevator[0]/int-pos-rad</input>
            <rate_limit sense="decr"> fcs/elevator-rate-down </rate_limit> <!-- I assume this is right? when I move elevator down, it is going from -1 to 1. When I move elevator up it is going back to -1? -->
            <rate_limit sense="incr"> fcs/elevator-rate-up </rate_limit>
            <output>fcs/elevator[0]/pos-rad</output>
        </actuator>
        
        <aerosurface_scale name="fcs/elevator[0]/pos-norm">
            <input>fcs/elevator[0]/pos-rad</input>
            <domain>
                <min>-0.4014</min> <!-- -23 deg -->
                <max> 0.2967</max> <!-- +17 deg -->
            </domain>
            <zero_centered>false</zero_centered>
            <range>
                <min>-1</min>
                <max>1</max>
            </range>
        </aerosurface_scale>
        
        <aerosurface_scale name="fcs/stabilizer/int-pos-rad">
            <input>fcs/pitch-trim-cmd-norm</input>
            <domain>
                <min>-1</min>
                <max>0.25</max>
            </domain>
            <zero_centered>false</zero_centered>
            <range>
                <min>-0.20944</min> <!-- -12 deg -->
                <max> 0.05236</max> <!-- +03 deg -->
            </range>
        </aerosurface_scale>
        
        <fcs_function name="fcs/stabilizer/rate-deg_sec">
            <function>
                <toradians>
                    <table> <!-- graph 8.3-2 -->
                        <!-- TODO: add single trim rates -->
                        <independentVar>velocities/vc-kts</independentVar>
                        <tableData>
                              0 0.5
                            180 0.5
                            250 0.2
                            450 0.2
                        </tableData>
                    </table>
                </toradians>
            </function>
        </fcs_function>
        
        <actuator name="fcs/stabilizer/actuator">
            <input>fcs/stabilizer/int-pos-rad</input>
            <rate_limit> fcs/stabilizer/rate-deg_sec </rate_limit>
            <output>fcs/stabilizer/pos-rad</output>
        </actuator>
        
        <fcs_function name="fcs/stabilizer/pos-deg">
            <function>
                <todegrees><property>fcs/stabilizer/pos-rad</property></todegrees>
            </function>
        </fcs_function>
        
        <fcs_function name="fcs/stabilizer/int-pos-deg">
            <function>
                <todegrees><property>fcs/stabilizer/int-pos-rad</property></todegrees>
            </function>
        </fcs_function>
        
        <aerosurface_scale name="fcs/stabilizer/trim-units">
            <input>fcs/stabilizer/pos-deg</input>
            <domain>
                <min>-12</min>
                <max>3</max>
            </domain>
            <zero_centered>false</zero_centered>
            <range>
                <min>15</min>
                <max>0</max>
            </range>
        </aerosurface_scale>
        
        <!--<aerosurface_scale name="Stabilizer Control Normalizer">
            <input>fcs/stabilizer/pos-rad</input>
            <domain>
                <min>-0.209</min>
                <max> 0.052</max>
            </domain>
            <zero_centered>false</zero_centered>
            <range>
                <min>-1</min>
                <max>1</max>
            </range>
            <output>fcs/stabilizer-pos-norm</output>
        </aerosurface_scale>-->

     </channel>
     
     <channel name="Roll">

        <!-- ailerons -->
        
        
        <!-- TODO: limit aileron trim to -/+ 47 deg = 6 units -->
        <summer name="Roll Trim Sum">
            <input>fcs/aileron-cmd-norm</input>
            <input>fcs/roll-trim-cmd-norm</input>
            <clipto>
                <min>-1</min>
                <max>1</max>
            </clipto>
        </summer>
        
        <aerosurface_scale name="fcs/wheel-pos-deg">
            <input>fcs/aileron-cmd-norm</input>
            <domain>
                <min>-1</min>
                <max> 1</max>
            </domain>
            <range>
                <min>-89</min>
                <max> 89</max>
            </range>
        </aerosurface_scale>
        
        <!-- Should be both flap and speed dependant, according to AMM 27-11-00 -->
        <switch name="fcs/outboard-ailerons-unlocked">
            <default value="fcs/outboard-ailerons-unlocked"/>
            <test logic="AND" value="0">
                <test logic="OR">
                    velocities/vc-kts > 238
                    velocities/mach > 0.53
                </test>
                fcs/flap-pos-norm == 0
            </test>
            <test logic="AND" value="1">
                <test logic="AND">
                    velocities/vc-kts LT 232
                    velocities/mach LT 0.51
                </test>
                fcs/flap-pos-norm == 0
            </test>
        </switch>
        
        <fcs_function name="fcs/outboard-aileron-cmd-norm">
            <function>
                <product>
                    <property>fcs/roll-trim-sum</property>
                    <property>fcs/outboard-ailerons-unlocked</property>
                </product>
            </function>
        </fcs_function>

        <aerosurface_scale name="fcs/aileron[0]/int-pos-rad">
            <input>-fcs/outboard-aileron-cmd-norm</input>
            <range>
                <min>-0.44</min>
                <max> 0.26</max>
            </range>
        </aerosurface_scale>
        
        <actuator name="fcs/aileron[0]/actuator">
            <input>fcs/aileron[0]/int-pos-rad</input>
            <rate_limit sense="incr"> systems/hydraulic/left-outboard-aileron/range-limit-down-rad_sec </rate_limit>
            <rate_limit sense="decr"> systems/hydraulic/left-outboard-aileron/range-limit-up-rad_sec </rate_limit>
            <output>fcs/aileron[0]/pos-rad</output>
        </actuator>
        
        <aerosurface_scale name="fcs/aileron[0]/pos-norm">
            <input>fcs/aileron[0]/pos-rad</input>
            <domain>
                <min>-0.4363</min>
                <max> 0.2618</max>
            </domain>
            <range>
                <min>-1</min>
                <max>1</max>
            </range>
        </aerosurface_scale>
        
        <aerosurface_scale name="fcs/aileron[3]/int-pos-rad">
            <input>fcs/outboard-aileron-cmd-norm</input>
            <range>
                <min>-0.4363</min>
                <max> 0.2618</max>
            </range>
        </aerosurface_scale>
        
        <actuator name="fcs/aileron[3]/actuator">
            <input>fcs/aileron[3]/int-pos-rad</input>
            <rate_limit sense="incr"> systems/hydraulic/right-outboard-aileron/range-limit-down-rad_sec </rate_limit>
            <rate_limit sense="decr"> systems/hydraulic/right-outboard-aileron/range-limit-up-rad_sec </rate_limit>
            <output>fcs/aileron[3]/pos-rad</output>
        </actuator>
        
        <aerosurface_scale name="fcs/aileron[3]/pos-norm">
            <input>fcs/aileron[3]/pos-rad</input>
            <domain>
                <min>-0.4363</min>
                <max> 0.2618</max>
            </domain>
            <range>
                <min>-1</min>
                <max>1</max>
            </range>
        </aerosurface_scale>
        
        <aerosurface_scale name="fcs/aileron[1]/int-pos-rad">
            <input>-fcs/roll-trim-sum</input>
            <range>
                <min>-0.3491</min>
                <max> 0.3491</max>
            </range>
        </aerosurface_scale>
        
        <actuator name="fcs/aileron[1]/actuator">
            <input>fcs/aileron[1]/int-pos-rad</input>
            <rate_limit sense="incr"> systems/hydraulic/left-inboard-aileron/range-limit-down-rad_sec </rate_limit>
            <rate_limit sense="decr"> systems/hydraulic/left-inboard-aileron/range-limit-up-rad_sec </rate_limit>
            <output>fcs/aileron[1]/pos-rad</output>
        </actuator>
        
        <aerosurface_scale name="fcs/aileron[1]/pos-norm">
            <input>fcs/aileron[1]/pos-rad</input>
            <domain>
                <min>-0.3491</min>
                <max> 0.3491</max>
            </domain>
            <range>
                <min>-1</min>
                <max>1</max>
            </range>
        </aerosurface_scale>
        
        <aerosurface_scale name="fcs/aileron[2]/int-pos-rad">
            <input>fcs/roll-trim-sum</input>
            <range>
                <min>-0.3491</min>
                <max> 0.3491</max>
            </range>
        </aerosurface_scale>
        
        <actuator name="fcs/aileron[2]/actuator">
            <input>fcs/aileron[2]/int-pos-rad</input>
            <rate_limit sense="incr"> systems/hydraulic/right-inboard-aileron/range-limit-down-rad_sec </rate_limit>
            <rate_limit sense="decr"> systems/hydraulic/right-inboard-aileron/range-limit-up-rad_sec </rate_limit>
            <output>fcs/aileron[2]/pos-rad</output>
        </actuator>
        
        <aerosurface_scale name="fcs/aileron[2]/pos-norm">
            <input>fcs/aileron[2]/pos-rad</input>
            <domain>
                <min>-0.3491</min>
                <max> 0.3491</max>
            </domain>
            <range>
                <min>-1</min>
                <max>1</max>
            </range>
        </aerosurface_scale>
        
        <fcs_function name="fcs/aileron[0]/pos-deg">
            <function>
                <todegrees><property>fcs/aileron[0]/pos-rad</property></todegrees>
            </function>
        </fcs_function>
        
        <fcs_function name="fcs/aileron[1]/pos-deg">
            <function>
                <todegrees><property>fcs/aileron[1]/pos-rad</property></todegrees>
            </function>
        </fcs_function>
        
        <fcs_function name="fcs/aileron[2]/pos-deg">
            <function>
                <todegrees><property>fcs/aileron[2]/pos-rad</property></todegrees>
            </function>
        </fcs_function>
        
        <fcs_function name="fcs/aileron[3]/pos-deg">
            <function>
                <todegrees><property>fcs/aileron[3]/pos-rad</property></todegrees>
            </function>
        </fcs_function>
        
        <!-- Spoilers -->
        
        <!-- 
          Step = Lever Deg = Setting
           0   =     0     = DN
           1   =     6     = ARM
                    21.5   = Intermediate (NASA)
           2   =    37     = FLIGHT DETENT
           3   =    77     = UP
        -->
        <fcs_function name="fcs/speed-brake-handle-pos-deg">
            <function>
                <table> <!-- graph 19.0-10 -->
                    <independentVar>/autopilot/autospoilers/step</independentVar>
                    <tableData>
                         0.0  0.0
                         1.0  6.0
                         2.0 37.0
                         3.0 77.0
                    </tableData>
                </table>
            </function>
        </fcs_function>

        <!-- spoilers 1 and 2 -->
        <fcs_function name="fcs/spoiler[0]/cmd-deg">
            <function>
                <table> <!-- graph 19.0-10 -->
                    <independentVar lookup="row">fcs/speed-brake-handle-pos-deg</independentVar>
                    <independentVar lookup="column">fcs/wheel-pos-deg</independentVar>
                    <tableData>
                             -80.0  -10.0  0.0  10.0  80.0
                         0.0  45.0   0.0   0.0   0.0   0.0
                         6.0  45.0   0.0   0.0   0.0   0.0  
                        21.5  45.0   0.0   0.0   0.0   0.0
                        37.0  45.0   0.0   0.0   0.0   0.0
                        77.0  45.0  45.0  45.0  45.0   0.0
                    </tableData>
                </table>
            </function>
            <output>fcs/spoiler[1]/cmd-deg</output>
        </fcs_function>
        
        <actuator name="fcs/spoiler[0]/actuator">
            <input>fcs/spoiler[0]/cmd-deg</input>
            <rate_limit> 75 </rate_limit> <!-- 75 deg/sec -->
            <output>fcs/spoiler[0]/pos-deg</output>
        </actuator>
        
        <actuator name="fcs/spoiler[1]/actuator">
            <input>fcs/spoiler[1]/cmd-deg</input>
            <rate_limit> 75 </rate_limit> <!-- 75 deg/sec -->
            <output>fcs/spoiler[1]/pos-deg</output>
        </actuator>
        
        
        <!-- spoilers 3 and 4 -->
        <fcs_function name="fcs/spoiler[2]/cmd-deg">
            <function>
                <table> <!-- graph 19.0-10 -->
                    <independentVar lookup="row">fcs/speed-brake-handle-pos-deg</independentVar>
                    <independentVar lookup="column">fcs/wheel-pos-deg</independentVar>
                    <tableData>
                             -80.0 -38.0 -10.0   0.0  10.0  80.0
                         0.0  45.0   0.0   0.0   0.0   0.0   0.0
                         6.0  45.0   0.0   0.0   0.0   0.0   0.0
                        21.5  45.0  45.0  25.0  22.5  20.0   0.0
                        37.0  45.0  45.0  45.0  45.0  45.0   0.0
                        77.0  45.0  45.0  45.0  45.0  45.0   0.0
                    </tableData>
                </table>
            </function>
            <output>fcs/spoiler[3]/cmd-deg</output>
        </fcs_function>

        <actuator name="fcs/spoiler[2]/actuator">
            <input>fcs/spoiler[2]/cmd-deg</input>
            <rate_limit> 75 </rate_limit> <!-- 75 deg/sec -->
            <output>fcs/spoiler[2]/pos-deg</output>
        </actuator>
        
        <actuator name="fcs/spoiler[3]/actuator">
            <input>fcs/spoiler[3]/cmd-deg</input>
            <rate_limit> 75 </rate_limit> <!-- 75 deg/sec -->
            <output>fcs/spoiler[3]/pos-deg</output>
        </actuator>
        
        
        <!-- spoiler 5 -->
        <fcs_function name="fcs/spoiler[4]/cmd-deg">
            <function>
                <table> <!-- graph 19.0-10 -->
                    <independentVar lookup="row">fcs/speed-brake-handle-pos-deg</independentVar>
                    <independentVar lookup="column">fcs/wheel-pos-deg</independentVar>
                    <tableData>
                             -80.0 -42.0 -10.0   0.0  10.0  40.0  80.0
                         0.0  20.0  20.0   0.0   0.0   0.0   0.0   0.0
                         6.0  20.0  20.0   0.0   0.0   0.0   0.0   0.0
                        21.5  20.0  20.0  20.0  20.0  20.0   0.0   0.0
                        37.0  20.0  20.0  20.0  20.0  20.0  20.0   0.0
                        77.0  20.0  20.0  20.0  20.0  20.0  20.0   0.0
                    </tableData>
                </table>
            </function>
        </fcs_function>

        <actuator name="fcs/spoiler[4]/actuator">
            <input>fcs/spoiler[4]/cmd-deg</input>
            <rate_limit> 75 </rate_limit> <!-- 75 deg/sec -->
            <output>fcs/spoiler[4]/pos-deg</output>
        </actuator>

        <!-- spoilers 6 and 7 -->
        <fcs_function name="fcs/spoiler[5]/cmd-deg">
            <function>
                <table> <!-- graph 19.0-10 -->
                    <independentVar>fcs/speed-brake-handle-pos-deg</independentVar>
                    <tableData>
                         0.0   0.0
                         6.0   0.0
                        21.5   0.0
                        37.0  20.0
                        77.0  20.0
                    </tableData>
                </table>
            </function>
            <output>fcs/spoiler[6]/cmd-deg</output>
        </fcs_function>

        <actuator name="fcs/spoiler[5]/actuator">
            <input>fcs/spoiler[5]/cmd-deg</input>
            <rate_limit> 25 </rate_limit> <!-- 25 deg/sec -->
            <output>fcs/spoiler[5]/pos-deg</output>
        </actuator>
        
        <actuator name="fcs/spoiler[6]/actuator">
            <input>fcs/spoiler[6]/cmd-deg</input>
            <rate_limit> 25 </rate_limit> <!-- 25 deg/sec -->
            <output>fcs/spoiler[6]/pos-deg</output>
        </actuator>
        
        
        <!-- spoiler 8 -->
        <fcs_function name="fcs/spoiler[7]/cmd-deg">
            <function>
                <table> <!-- graph 19.0-10 -->
                    <independentVar lookup="row">fcs/speed-brake-handle-pos-deg</independentVar>
                    <independentVar lookup="column">fcs/wheel-pos-deg</independentVar>
                    <tableData>
                             -80.0 -40.0 -10.0   0.0  10.0  42.0  80.0
                         0.0   0.0   0.0   0.0   0.0   0.0  20.0  20.0
                         6.0   0.0   0.0   0.0   0.0   0.0  20.0  20.0
                        21.5   0.0   0.0  20.0  20.0  20.0  20.0  20.0
                        37.0   0.0  20.0  20.0  20.0  20.0  20.0  20.0
                        77.0   0.0  20.0  20.0  20.0  20.0  20.0  20.0
                    </tableData>
                </table>
            </function>
        </fcs_function>

        <actuator name="fcs/spoiler[7]/actuator">
            <input>fcs/spoiler[7]/cmd-deg</input>
            <rate_limit> 75 </rate_limit> <!-- 75 deg/sec -->
            <output>fcs/spoiler[7]/pos-deg</output>
        </actuator>
        
        <!-- spoilers 9 and 10 -->
        <fcs_function name="fcs/spoiler[8]/cmd-deg">
            <function>
                <table> <!-- graph 19.0-10 -->
                    <independentVar lookup="row">fcs/speed-brake-handle-pos-deg</independentVar>
                    <independentVar lookup="column">fcs/wheel-pos-deg</independentVar>
                    <tableData>
                             -80.0 -10.0   0.0  10.0  38.0  80.0
                         0.0   0.0   0.0   0.0   0.0   0.0  45.0
                         6.0   0.0   0.0   0.0   0.0   0.0  45.0
                        21.5   0.0  20.0  22.5  25.0  45.0  45.0
                        37.0   0.0  45.0  45.0  45.0  45.0  45.0
                        77.0   0.0  45.0  45.0  45.0  45.0  45.0
                    </tableData>
                </table>
            </function>
            <output>fcs/spoiler[9]/cmd-deg</output>
        </fcs_function>

        <actuator name="fcs/spoiler[8]/actuator">
            <input>fcs/spoiler[8]/cmd-deg</input>
            <rate_limit> 75 </rate_limit> <!-- 75 deg/sec -->
            <output>fcs/spoiler[8]/pos-deg</output>
        </actuator>
        
        <actuator name="fcs/spoiler[9]/actuator">
            <input>fcs/spoiler[9]/cmd-deg</input>
            <rate_limit> 75 </rate_limit> <!-- 75 deg/sec -->
            <output>fcs/spoiler[9]/pos-deg</output>
        </actuator>
        
        <!-- spoilers 11 and 12 -->
        <fcs_function name="fcs/spoiler[10]/cmd-deg">
            <function>
                <table> <!-- graph 19.0-10 -->
                    <independentVar lookup="row">fcs/speed-brake-handle-pos-deg</independentVar>
                    <independentVar lookup="column">fcs/wheel-pos-deg</independentVar>
                    <tableData>
                             -80.0 -10.0   0.0  10.0  80.0
                         0.0   0.0   0.0   0.0   0.0  45.0
                         6.0   0.0   0.0   0.0   0.0  45.0  
                        21.5   0.0   0.0   0.0   0.0  45.0
                        37.0   0.0   0.0   0.0   0.0  45.0
                        77.0   0.0  45.0  45.0  45.0  45.0
                    </tableData>
                </table>
            </function>
            <output>fcs/spoiler[11]/cmd-deg</output>
        </fcs_function>

        <actuator name="fcs/spoiler[10]/actuator">
            <input>fcs/spoiler[10]/cmd-deg</input>
            <rate_limit> 75 </rate_limit> <!-- 75 deg/sec -->
            <output>fcs/spoiler[10]/pos-deg</output>
        </actuator>
        
        <actuator name="fcs/spoiler[11]/actuator">
            <input>fcs/spoiler[11]/cmd-deg</input>
            <rate_limit> 75 </rate_limit> <!-- 75 deg/sec -->
            <output>fcs/spoiler[11]/pos-deg</output>
        </actuator>
        
     </channel>
     
     <channel name="Yaw">

        <aerosurface_scale name="Rudder Trim Control">
            <input>fcs/yaw-trim-cmd-norm</input>
            <range>
                <min>-0.234</min> <!-- 8.2 degrees / 35 degrees -->
                <max>0.234</max>
            </range>
            <output>fcs/rudder-trim-cmd-norm</output>
        </aerosurface_scale>
        
        <summer name="Rudder Command Sum">
            <input>fcs/rudder-cmd-norm</input>
            <input>fcs/rudder-trim-cmd-norm</input>
            <clipto>
                <min>-1</min>
                <max>1</max>
            </clipto>
        </summer>

        <scheduled_gain name="Yaw Damper Rate">
            <input>velocities/r-aero-rad_sec</input>
            <table>
                <independentVar>aero/qbar-psf</independentVar>
                <tableData>
                    3.0000    0.0000    
                    11.0000    2.0000    
                </tableData>
            </table>
        </scheduled_gain>

        <scheduled_gain name="Yaw Damper Beta">
            <input>aero/beta-rad</input>
            <table>
                <independentVar>aero/qbar-psf</independentVar>
                <tableData>
                    3.0000    0.0000    
                    11.0000    0.0000    
                </tableData>
            </table>
        </scheduled_gain>

        <summer name="Yaw Damper Sum">
            <input>fcs/yaw-damper-beta</input>
            <input>fcs/yaw-damper-rate</input>
            <clipto>
                <min>-0.103</min> <!-- +/- 3.6 deg -->
                <max>0.103</max>
            </clipto>
        </summer>

        <scheduled_gain name="Yaw Damper Final">
            <input>fcs/yaw-damper-sum</input>
            <table>
                <independentVar>aero/qbar-psf</independentVar>
                <tableData>
                    2.9900    0.0000
                    3.0000    1.0000
                </tableData>
            </table>
        </scheduled_gain>

        <summer name="Rudder Sum">
            <input>fcs/rudder-command-sum</input>
            <input>fcs/yaw-damper-final</input>
            <clipto>
                <min>-1.0000</min>
                <max>1.0000</max>
            </clipto>
        </summer>
        
        <aerosurface_scale name="Rudder Control">
            <input>fcs/rudder-sum</input>
            <range>
                <min>-0.5498</min> <!-- 31.5 deg (on -400, 25 deg on older models) -->
                <max>0.5498</max>
            </range>
            <output>fcs/rudder-pos-int-rad</output>
        </aerosurface_scale>
        
        <fcs_function name="fcs/rudder-limiter"> <!-- linearly limit rudder to 31.5 deg below 150 kt and to 5 deg above 450 kt -->
            <function>
                <table>
                  <independentVar lookup="row">fcs/rudder-pos-int-rad</independentVar>
                  <independentVar lookup="column">velocities/vc-kts</independentVar>
                  <tableData>
                            150.0000 450.0000
                    -0.5498  -0.5498  -0.0873
                     0.0000   0.0000   0.0000
                     0.5498   0.5498   0.0873
                  </tableData>
                </table>
            </function>
        </fcs_function>
        
        <actuator name="Rudder Actuator">
            <input>fcs/rudder-limiter</input>
            <rate_limit> 0.8727 </rate_limit> <!-- 50 deg/sec -->
            <output>fcs/rudder-pos-rad</output>
        </actuator>
        
        <aerosurface_scale name="Rudder Control Normalizer">
            <input>fcs/rudder-pos-rad</input>
            <domain>
                <min>-0.5498</min>
                <max>0.5498</max>
            </domain>
            <range>
                <min>-1</min>
                <max>1</max>
            </range>
            <output>fcs/rudder-pos-norm</output>
        </aerosurface_scale>

     </channel>
     <channel name="Aeromechanical">

        <kinematic name="fcs/flaps/pos-deg">
            <input>fcs/flaps/int-cmd-deg</input>
            <noscale/>
            <traverse>
                <setting>
                    <position>0</position>
                    <time>0</time>
                </setting>
                <setting>
                    <position>1</position>
                    <time>6</time>
                </setting>
                <setting>
                    <position>5</position>
                    <time>18</time>
                </setting>
                <setting>
                    <position>10</position>
                    <time>4</time>
                </setting>
                <setting>
                    <position>20</position>
                    <time>6</time>
                </setting>
                <setting>
                    <position>25</position>
                    <time>4</time>
                </setting>
                <setting>
                    <position>30</position>
                    <time>5</time>
                </setting>
            </traverse>
        </kinematic>
        
        <aerosurface_scale name="Flap Control Normalizer">
            <input>fcs/flaps/pos-deg</input>
            <domain>
                <min>0</min>
                <max>30</max>
            </domain>
            <range>
                <min>0</min>
                <max>1</max>
            </range>
            <output>fcs/flap-pos-norm</output>
        </aerosurface_scale>
        
        <kinematic name="gear/unit[0]/pos">
            <input>gear/unit[0]/pos-cmd-norm</input>
            <traverse>
                <setting>
                    <position>0.0000</position>
                    <time>0.0000</time>
                </setting>
                <setting>
                    <position>1.0000</position>
                    <time>25.0000</time>
                </setting>
            </traverse>
            <output>gear/unit[0]/pos-norm</output>
        </kinematic>
        <kinematic name="gear/unit[1]/pos">
            <input>gear/unit[1]/pos-cmd-norm</input>
            <traverse>
                <setting>
                    <position>0.0000</position>
                    <time>0.0000</time>
                </setting>
                <setting>
                    <position>1.0000</position>
                    <time>25.0000</time>
                </setting>
            </traverse>
            <output>gear/unit[1]/pos-norm</output>
        </kinematic>
        <kinematic name="gear/unit[2]/pos">
            <input>gear/unit[2]/pos-cmd-norm</input>
            <traverse>
                <setting>
                    <position>0.0000</position>
                    <time>0.0000</time>
                </setting>
                <setting>
                    <position>1.0000</position>
                    <time>25.0000</time>
                </setting>
            </traverse>
            <output>gear/unit[2]/pos-norm</output>
        </kinematic>
        <kinematic name="gear/unit[3]/pos">
            <input>gear/unit[3]/pos-cmd-norm</input>
            <traverse>
                <setting>
                    <position>0.0000</position>
                    <time>0.0000</time>
                </setting>
                <setting>
                    <position>1.0000</position>
                    <time>25.0000</time>
                </setting>
            </traverse>
            <output>gear/unit[3]/pos-norm</output>
        </kinematic>
        <kinematic name="gear/unit[4]/pos">
            <input>gear/unit[4]/pos-cmd-norm</input>
            <traverse>
                <setting>
                    <position>0.0000</position>
                    <time>0.0000</time>
                </setting>
                <setting>
                    <position>1.0000</position>
                    <time>25.0000</time>
                </setting>
            </traverse>
            <output>gear/unit[4]/pos-norm</output>
        </kinematic>
        
        <switch name="/controls/gear/tiller-disabled">
            <default value="0"/>
            <test logic="AND" value="1">
                /controls/gear/tiller-enabled == 0
            </test>
        </switch>
        
        <fcs_function name="Nose Wheel Steering 0">
          <function name="fcs/steer-nose-deg[0]">
            <description>Steering command for nose gear</description>
            <ifthen>
              <eq>
                <property>/sim/model/autopush/connected</property>
                <value>1</value>
              </eq>
              <product>
                <property>/sim/model/autopush/autopush-cmd-norm</property>
                <value>70</value>
              </product>
              <sum>
                <product>
                  <table>
                    <independentVar lookup="row">/controls/gear/tiller-cmd-norm</independentVar>
                    <independentVar lookup="column">/controls/flight/rudder</independentVar>
                    <tableData>
                    -1   0   1
                    -1 -70 -70 -70
                     0  -7   0   7
                     1  70  70  70
                    </tableData>
                  </table>
                  <property>/controls/gear/tiller-enabled</property>
                </product>
                <product>
                  <product>
                    <property>/controls/flight/rudder</property>
                    <value>70</value>
                  </product>
                  <property>/controls/gear/tiller-disabled</property>
                </product>
              </sum>
            </ifthen>
          </function>
        </fcs_function>
        
        <!-- simulate rotational friction -->
        <actuator name="Gear Nose Actuator">
          <input>fcs/steer-nose-deg[0]</input>
          <rate_limit>70</rate_limit>
          <output>fcs/steer-pos-deg[0]</output>
        </actuator>
        
        <fcs_function name="Rear Wheel Steering 2">
          <function name="fcs/steer-rear-deg[2]">
            <description>Steering command for left body gear</description>
            <table>
              <independentVar lookup="row">fcs/steer-pos-deg</independentVar>
              <independentVar lookup="column">velocities/vg-fps</independentVar>
              <tableData>
                      0  34  40  45
                -70  13  13   0   0 
                -65  13  13   0   0
                -20   0   0   0   0
                  0   0   0   0   0
                 20   0   0   0   0
                 70 -10 -10   0   0 
              </tableData>
            </table>
          </function>
          <output>fcs/steer-pos-deg[2]</output>
        </fcs_function>
        
        <fcs_function name="Rear Wheel Steering 3">
          <function name="fcs/steer-rear-deg[3]">
            <description>Steering command for right body gear</description>
            <table>
              <independentVar lookup="row">fcs/steer-pos-deg</independentVar>
              <independentVar lookup="column">velocities/vg-fps</independentVar>
              <tableData>
                      0  34  40  45
                -70  10  10   0   0 
                -20   0   0   0   0
                  0   0   0   0   0
                 20   0   0   0   0
                 65 -13 -13   0   0
                 70 -13 -13   0   0 
              </tableData>
            </table> 
          </function>
          <output>fcs/steer-pos-deg[3]</output>
        </fcs_function>
        
        <switch name="Group A Leading Edge Flaps">
            <default value="0"/>
            <test logic="AND" value="1.0">
                fcs/flaps/int-cmd-deg GE 1
            </test>
            <output>fcs/flaps-leading-edge/A/cmd-norm</output>
        </switch>
        
        <switch name="Group B Leading Edge Flaps">
            <default value="0"/>
            <test logic="AND" value="1.0">
                fcs/flaps/int-cmd-deg GE 5
            </test>
            <output>fcs/flaps-leading-edge/B/cmd-norm</output>
        </switch>

        <kinematic name="Group A Leading Edge Flaps Control">
            <input>fcs/flaps-leading-edge/A/cmd-norm</input>
            <traverse>
                <setting>
                    <position>0.0</position>
                    <time>0.0</time>
                </setting>
                <setting>
                    <position>1.0</position>
                    <time>3.0</time>
                </setting>
            </traverse>
            <output>fcs/flaps-leading-edge/A/pos-norm</output>
        </kinematic>

        <kinematic name="Group B Leading Edge Flaps Control">
            <input>fcs/flaps-leading-edge/B/cmd-norm</input>
            <traverse>
                <setting>
                    <position>0.0</position>
                    <time>0.0</time>
                </setting>
                <setting>
                    <position>1.0</position>
                    <time>3.0</time>
                </setting>
            </traverse>
            <output>fcs/flaps-leading-edge/B/pos-norm</output>
        </kinematic>

     </channel>
     
     <property>/autopilot/autobrake/left-brake-output</property>
     <property>/autopilot/autobrake/right-brake-output</property>
     <property>/controls/flight/speedbrakes</property>
     
     <channel name="Brakes">
         <fcs_function name="left brake">
             <function name="fcs/left-brake-cmd">
              <property>/autopilot/autobrake/left-brake-output</property>
             </function>
             <output>fcs/left-brake-cmd-norm</output>
        </fcs_function>
        
        <fcs_function name="right brake">
             <function name="fcs/right-brake-cmd">
              <property>/autopilot/autobrake/right-brake-output</property>
             </function>
             <output>fcs/right-brake-cmd-norm</output>
        </fcs_function>
    </channel>
    </flight_control>
    
    <aerodynamics>
    
        <!-- aero RP must coincide with center of gravity, since
             pitching moment is already corrected for CG position -->
        <aero_ref_pt_shift_x>
            <function name="aero/function/aero-rp">
            <description>Shift_of_center_of_pressure</description>
                <product>
                    <sum>
                        <value>-1340</value> <!-- initial value of ARP -->
                        <property>inertia/cg-x-in</property>
                    </sum>
                    <value>0.00302590171</value>
                </product>
            </function>
        </aero_ref_pt_shift_x>
    
        <function name="inertia/weight-kg">
            <product>
                <property>inertia/weight-lbs</property>
                <value>0.45359237</value>
            </product>
        </function>
        
        <function name="aero/alpha-wing-deg">
            <todegrees><property>aero/alpha-wing-rad</property></todegrees>
        </function>
        
        <!-- FACTORS and CONSTANTS for re-use in multiple functions -->
        <function name="aero/function/FD">
        <description>Ground effect lateral control factor FD</description>
            <table> <!-- graph 3.0-14 -->
                <independentVar lookup="row">aero/alpha-wing-deg</independentVar>
                <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                <tableData>
                           0.00  20.00  25.00  30.00
                   0.00    0.04   0.12   0.14   0.16
                  14.00    0.13   0.26   0.61   0.69
                </tableData>
            </table>
        </function>
        <function name="aero/function/Kge">
            <description>Ground_effect_height_factor</description>
            <table> <!-- graph 19.0-3 (revised from 2.0-31) -->
                <independentVar>aero/h_b-mac-ft</independentVar>
                <tableData>
                    0.0000 1.0000
                    0.1277 0.8000
                    0.2270 0.4000
                    0.2837 0.2000
                    0.3901 0.0000
                </tableData>
            </table>
        </function>
        <function name="aero/function/Kgear">
            <description>Effectiveness_factor_landing_gear</description>
            <product> <!-- graph 2.0-28 -->
                <avg>
                    <property>gear/unit[0]/pos-norm</property>
                    <property>gear/unit[1]/pos-norm</property>
                    <property>gear/unit[2]/pos-norm</property>
                    <property>gear/unit[3]/pos-norm</property>
                    <property>gear/unit[4]/pos-norm</property>
                </avg>
                <value>1.0000</value>
            </product>
        </function>
        <function name="aero/function/k_stab"> <!-- come up with a better name -->
            <description>Effectiveness_factor_stabilizer_and_elevator</description>
            <table> <!-- graph 4.0-19 -->
                <independentVar lookup="row">aero/alpha-wing-deg</independentVar>
                <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                <tableData>
                            0.000  1.000  5.000 10.000 20.000 25.000 30.000
                    -5.000  1.000  1.000  1.000  1.000  1.000  1.000  1.000
                    15.000  1.000  1.000  1.000  1.000  1.000  1.000  1.000
                    20.000  0.995  0.925  0.990  0.865  0.855  0.720  0.825
                    22.800  0.960  0.835  0.935  0.775  0.800  0.695  0.705
                    25.000  0.925  0.780  0.865  0.735  0.795  0.695  0.770
                </tableData>
            </table>
        </function>
        <function name="aero/function/kCD"> <!-- come up with a better name -->
            <description>Effectiveness_factor_of_flaps_for_drag</description>
            <table>
                <independentVar>fcs/flaps/pos-deg</independentVar>
                <tableData>
                      0.0000   0.0000
                      1.0000   1.0000
                     30.0000   1.0000
                </tableData>
            </table>
        </function>
        
        <function name="aero/CoG-mac-pct">
            <description>Center_of_Gravity_in_percentage_MAC</description>
            <quotient>
                <sum>
                    <property>inertia/cg-x-in</property>
                    <value>-1258</value>
                    <!--
                    25MAC = B STA 1339.91
                    MAC   = 327.78 inch
                    327.78 * 0.25 = 81.945
                    LEMAC = 1339.91 - 81.945 = B STA 1258
                    -->
                </sum>
                <value>3.2778</value>
            </quotient>
        </function>
        <function name="aero/stab-trim-units">
            <description>Recommended stabilizer trim units</description>
            <table>
                <independentVar lookup="row">inertia/weight-kg</independentVar>
                <independentVar lookup="column">aero/CoG-mac-pct</independentVar>
                <tableData>
                             9    13    17    21    25    29    33
                    200000   0     4     3.5   3     2.5   2     2
                    220000   0     5     4     3.5   3     2     2
                    240000   0     6     5     4.5   3.5   2.5   2
                    260000   8     7     6     5     4     3     2
                    280000   8.5   7.5   6.5   5.5   4.5   3.5   2.5
                    300000   9     8     7     6     5     4     3
                    320000   9.5   8.5   7.5   6.5   5.5   4     3
                    340000   9.5   8.5   7.5   6.5   5.5   4.5   3.5
                    360000   9.5   8.5   7.5   6.5   5.5   4.5   3.5
                    380000   9.5   9     8     7     5.5   5     3.5
                    400000   9.5   9     8     7     6     5     4
                </tableData>
            </table>
        </function>
        
        <function name="aero/stab-trim-greenband-min-weight-kg">
            <table>
                <independentVar>aero/CoG-mac-pct</independentVar>
                <tableData>
                    13   190509
                    22   226796
                    27   272155
                    30   317515
                    32   382514
                </tableData>
            </table>
        </function>
        <function name="aero/stab-trim-greenband-max-weight-kg">
            <table>
                <independentVar>aero/CoG-mac-pct</independentVar>
                <tableData>
                    13   208653
                    18   226796
                    24   272155
                    27   317515
                    29   395170
                    32   382514
                </tableData>
            </table>
        </function>
        <function name="aero/stab-trim-greenband-min-units">
            <table>
                <independentVar lookup="row">aero/stab-trim-greenband-min-weight-kg</independentVar>
                <independentVar lookup="column">aero/CoG-mac-pct</independentVar>
                <tableData>
                             9    13    17    21    25    29    33
                    200000   0     4     3.5   3     2.5   2     2
                    220000   0     5     4     3.5   3     2     2
                    240000   0     6     5     4.5   3.5   2.5   2
                    260000   8     7     6     5     4     3     2
                    280000   8.5   7.5   6.5   5.5   4.5   3.5   2.5
                    300000   9     8     7     6     5     4     3
                    320000   9.5   8.5   7.5   6.5   5.5   4     3
                    340000   9.5   8.5   7.5   6.5   5.5   4.5   3.5
                    360000   9.5   8.5   7.5   6.5   5.5   4.5   3.5
                    380000   9.5   9     8     7     5.5   5     3.5
                    400000   9.5   9     8     7     6     5     4
                </tableData>
            </table>
        </function>
        <function name="aero/stab-trim-greenband-max-units">
            <table>
                <independentVar lookup="row">aero/stab-trim-greenband-max-weight-kg</independentVar>
                <independentVar lookup="column">aero/CoG-mac-pct</independentVar>
                <tableData>
                             9    13    17    21    25    29    33
                    200000   0     4     3.5   3     2.5   2     2
                    220000   0     5     4     3.5   3     2     2
                    240000   0     6     5     4.5   3.5   2.5   2
                    260000   8     7     6     5     4     3     2
                    280000   8.5   7.5   6.5   5.5   4.5   3.5   2.5
                    300000   9     8     7     6     5     4     3
                    320000   9.5   8.5   7.5   6.5   5.5   4     3
                    340000   9.5   8.5   7.5   6.5   5.5   4.5   3.5
                    360000   9.5   8.5   7.5   6.5   5.5   4.5   3.5
                    380000   9.5   9     8     7     5.5   5     3.5
                    400000   9.5   9     8     7     6     5     4
                </tableData>
            </table>
        </function>
        
        <function name="weight-index[0]">
            <product>
                <property>inertia/pointmass-weight-lbs[0]</property>
                <value>0.005714</value> <!-- convert to pax -->
                <value>-0.383</value>
            </product>
        </function>
        <function name="weight-index[1]">
            <product>
                <sum>
                    <property>inertia/pointmass-weight-lbs[1]</property>
                    <property>inertia/pointmass-weight-lbs[2]</property>
                </sum>
                <value>0.005714</value> <!-- convert to pax -->
                <value>-0.251</value>
            </product>
        </function>
        <function name="weight-index[2]">
            <product>
                <property>inertia/pointmass-weight-lbs[3]</property>
                <value>0.005714</value> <!-- convert to pax -->
                <value>-0.093</value>
            </product>
        </function>
        <function name="weight-index[3]">
            <product>
                <property>inertia/pointmass-weight-lbs[4]</property>
                <value>0.005714</value> <!-- convert to pax -->
                <value>0.074</value>
            </product>
        </function>
        <function name="weight-index[4]">
            <product>
                <property>inertia/pointmass-weight-lbs[5]</property>
                <value>0.005714</value> <!-- convert to pax -->
                <value>0.265</value>
            </product>
        </function>
        <function name="weight-index[5]">
            <product>
                <property>inertia/pointmass-weight-lbs[6]</property>
                <value>-0.00163294928</value>
            </product>
        </function>
        <function name="weight-index[6]">
            <product>
                <property>inertia/pointmass-weight-lbs[7]</property>
                <value>-0.00117935226</value>
            </product>
        </function>
        <function name="weight-index[7]">
            <product>
                <property>inertia/pointmass-weight-lbs[8]</property>
                <value>0.00061688076</value>
            </product>
        </function>
        <function name="weight-index[8]">
            <product>
                <property>inertia/pointmass-weight-lbs[9]</property>
                <value>0.00117935226</value>
            </product>
        </function>
        <function name="weight-index[9]">
            <product>
                <property>inertia/pointmass-weight-lbs[10]</property>
                <value>0.00163294928</value>
            </product>
        </function>
        
        <function name="inertia/pointmass-weight-kg">
            <product>
                <property>inertia/pointmass-weight-lbs</property>
                <value>0.45359237</value>
            </product>
        </function>
        <function name="inertia/pointmass-weight-kg[1]">
            <product>
                <property>inertia/pointmass-weight-lbs[1]</property>
                <value>0.45359237</value>
            </product>
        </function>
        <function name="inertia/pointmass-weight-kg[2]">
            <product>
                <property>inertia/pointmass-weight-lbs[2]</property>
                <value>0.45359237</value>
            </product>
        </function>
        <function name="inertia/pointmass-weight-kg[3]">
            <product>
                <property>inertia/pointmass-weight-lbs[3]</property>
                <value>0.45359237</value>
            </product>
        </function>
        <function name="inertia/pointmass-weight-kg[4]">
            <product>
                <property>inertia/pointmass-weight-lbs[4]</property>
                <value>0.45359237</value>
            </product>
        </function>
        <function name="inertia/pointmass-weight-kg[5]">
            <product>
                <property>inertia/pointmass-weight-lbs[5]</property>
                <value>0.45359237</value>
            </product>
        </function>
        <function name="inertia/pointmass-weight-kg[6]">
            <product>
                <property>inertia/pointmass-weight-lbs[6]</property>
                <value>0.45359237</value>
            </product>
        </function>
        <function name="inertia/pointmass-weight-kg[7]">
            <product>
                <property>inertia/pointmass-weight-lbs[7]</property>
                <value>0.45359237</value>
            </product>
        </function>
        <function name="inertia/pointmass-weight-kg[8]">
            <product>
                <property>inertia/pointmass-weight-lbs[8]</property>
                <value>0.45359237</value>
            </product>
        </function>
        <function name="inertia/pointmass-weight-kg[9]">
            <product>
                <property>inertia/pointmass-weight-lbs[9]</property>
                <value>0.45359237</value>
            </product>
        </function>
        <function name="inertia/pointmass-weight-kg[10]">
            <product>
                <property>inertia/pointmass-weight-lbs[10]</property>
                <value>0.45359237</value>
            </product>
        </function>
        
        <function name="propulsion/tank[0]/contents-kg">
            <product>
                <property>propulsion/tank[0]/contents-lbs</property>
                <value>0.45359237</value>
            </product>
        </function>
        <function name="propulsion/tank[1]/contents-kg">
            <product>
                <property>propulsion/tank[1]/contents-lbs</property>
                <value>0.45359237</value>
            </product>
        </function>
        <function name="propulsion/tank[2]/contents-kg">
            <product>
                <property>propulsion/tank[2]/contents-lbs</property>
                <value>0.45359237</value>
            </product>
        </function>
        <function name="propulsion/tank[3]/contents-kg">
            <product>
                <property>propulsion/tank[3]/contents-lbs</property>
                <value>0.45359237</value>
            </product>
        </function>
        <function name="propulsion/tank[4]/contents-kg">
            <product>
                <property>propulsion/tank[4]/contents-lbs</property>
                <value>0.45359237</value>
            </product>
        </function>
        <function name="propulsion/tank[5]/contents-kg">
            <product>
                <property>propulsion/tank[5]/contents-lbs</property>
                <value>0.45359237</value>
            </product>
        </function>
        <function name="propulsion/tank[6]/contents-kg">
            <product>
                <property>propulsion/tank[6]/contents-lbs</property>
                <value>0.45359237</value>
            </product>
        </function>
        <function name="propulsion/tank[7]/contents-kg">
            <product>
                <property>propulsion/tank[7]/contents-lbs</property>
                <value>0.45359237</value>
            </product>
        </function>
        <function name="propulsion/tank-1-4-contents-kg">
            <sum>
                <property>propulsion/tank[1]/contents-kg</property>
                <property>propulsion/tank[4]/contents-kg</property>
            </sum>
        </function>
        <function name="propulsion/tank-2-3-contents-kg">
            <sum>
                <property>propulsion/tank[2]/contents-kg</property>
                <property>propulsion/tank[3]/contents-kg</property>
            </sum>
        </function>
        <function name="propulsion/tank-5-6-contents-kg">
            <sum>
                <property>propulsion/tank[5]/contents-kg</property>
                <property>propulsion/tank[6]/contents-kg</property>
            </sum>
        </function>
        <function name="weight-index-fuel">
            <sum>
                <table>
                    <independentVar>propulsion/tank[0]/contents-kg</independentVar>
                    <tableData>
                            0.0    0.0
                        51300.0  -51.0
                    </tableData>
                </table>
                <table>
                    <independentVar>propulsion/tank-1-4-contents-kg</independentVar>
                    <tableData>
                         0000.0    0.0
                        26800.0   24.8
                    </tableData>
                </table>
                <table>
                    <independentVar>propulsion/tank-2-3-contents-kg</independentVar>
                    <tableData>
                            0.0    0.0
                        75000.0  -34.8
                    </tableData>
                </table>
                <table>
                    <independentVar>propulsion/tank-5-6-contents-kg</independentVar>
                    <tableData>
                            0.0    0.0
                         7900.0   16.8
                    </tableData>
                </table>
                <table>
                    <independentVar>propulsion/tank[7]/contents-kg</independentVar>
                    <tableData>
                            0.0    0.0
                         9900.0   61.7
                    </tableData>
                </table>
            </sum>
        </function>
        <function name="weight-index-zfw">
            <sum>
                <value>65.2</value> <!-- dry operating index -->
                <property>weight-index[0]</property>
                <property>weight-index[1]</property>
                <property>weight-index[2]</property>
                <property>weight-index[3]</property>
                <property>weight-index[4]</property>
                <property>weight-index[5]</property>
                <property>weight-index[6]</property>
                <property>weight-index[7]</property>
                <property>weight-index[8]</property>
                <property>weight-index[9]</property>
            </sum>
        </function>
        <function name="weight-index-to">
            <sum>
                <property>weight-index-zfw</property>
                <property>weight-index-fuel</property>
            </sum>
        </function>
        <function name="inertia/zero-fuel-weight-kg">
            <product>
                <sum>
                    <property>inertia/weight-lbs</property>
                    <product>
                        <property>propulsion/total-fuel-lbs</property>
                        <value>-1</value>
                    </product>
                </sum>
                <value>0.45359237</value>
            </product>
        </function>
        <function name="aero/calculated-CoG-to-mac-pct">
            <description>Calculated_TO_CoG_in_percent_MAC</description>
            <table>
                <independentVar lookup="row">inertia/weight-kg</independentVar>
                <independentVar lookup="column">weight-index-to</independentVar>
                <tableData>
                             1.0   29.0   80.0  91.0  132.0
                    174000  14.0   14.0   32.0  35.8   32.0
                    352000   9.6   14.1   23.0  25.0   32.0
                    390000  14.1   14.1   22.1  23.9   32.0
                </tableData>
            </table>
        </function>
        <function name="aero/calculated-CoG-zfw-mac-pct">
            <description>Calculated_ZFW_CoG_in_percent_MAC</description>
            <table>
                <independentVar lookup="row">inertia/zero-fuel-weight-kg</independentVar>
                <independentVar lookup="column">weight-index-zfw</independentVar>
                <tableData>
                             1.0   29.0   80.0  91.0  132.0
                    174000  14.0   14.0   32.0  35.8   32.0
                    352000   9.6   14.1   23.0  25.0   32.0
                    390000  14.1   14.1   22.1  23.9   32.0
                </tableData>
            </table>
        </function>
        <function name="aero/calculated-CoG-from-index-zfw-mac-pct">
            <description>Calculated_ZFW_CoG_in_percent_MAC</description>
            <quotient>
                <sum>
                    <product>
                        <value>200000</value>
                        <sum>
                            <property>weight-index-to</property>
                            <value>-30</value>
                        </sum>
                    </product>
                    <product>
                        <value>47</value>
                        <property>inertia/weight-kg</property>
                    </product>
                </sum>
                <product>
                    <value>3.278</value>
                    <property>inertia/weight-kg</property>
                </product>
            </quotient>
        </function>
        
        <function name="aero/outside-cog-envelope">
            <description>Not_zero_if_the_CoG_outside_the_envelope</description>
            <table>
                <independentVar lookup="row">inertia/weight-kg</independentVar>
                <independentVar lookup="column">weight-index-to</independentVar>
                <tableData>
                            1   9  29  80  132
                    174000  1   1   0   1    1
                    256000  1   1   0   0    1
                    272000  1   1   0   0    1
                    350000  1   0   0   0    1
                    364000  1   0   0   0    1
                    390000  1   1   0   0    1
                    397000  1   1   1   1    1
                </tableData>
            </table>
        </function>

        <!-- SIDE -->
        <function name="aero/coefficient/CYb">
            <description>Side_force_due_to_beta_total</description>
            <product>
                <property>aero/beta-deg</property>
                <property>aero/coefficient/dCyb</property>
            </product>
        </function>
        
        <function name="aero/coefficient/dCyb">
            <description>Side_force_due_to_beta_total</description> <!-- used for yawing moment coefficient -->
            <product>
                <sum>
                    <product>
                        <property>aero/coefficient/dCybsideslip</property>
                        <property>aero/coefficient/dCybaeroelastic</property>
                    </product>
                    <product>
                        <property>aero/function/Kgear</property>
                        <value>-0.002</value>
                    </product>
                </sum>
                <property>aero/coefficient/FCybGE</property>
            </product>
        </function>
        
        <function name="aero/coefficient/dCybsideslip">
            <description>Side_force_due_to_beta</description>
            <table> <!-- graph 7.0-5 -->
                <independentVar lookup="row">aero/alpha-wing-rad</independentVar>
                <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                <tableData>
                        -0.0000  1.0000  5.0000  10.0000  20.0000  25.0000  30.0000
               -0.0873  -0.0170 -0.0170 -0.0170  -0.0170  -0.0185  -0.0175  -0.0187
                0.0000  -0.0160 -0.0160 -0.0160  -0.0160  -0.0175  -0.0172  -0.0180
                0.0873  -0.0160 -0.0160 -0.0160  -0.0160  -0.0175  -0.0175  -0.0185
                0.1745  -0.0150 -0.0150 -0.0150  -0.0150  -0.0170  -0.0180  -0.0190
                0.2618  -0.0155 -0.0155 -0.0155  -0.0155  -0.0167  -0.0185  -0.0200
                0.3491  -0.0150 -0.0150 -0.0150  -0.0150  -0.0170  -0.0180  -0.0190
                0.4363  -0.0150 -0.0150 -0.0150  -0.0150  -0.0170  -0.0173  -0.0175
                </tableData>
            </table>
        </function>
        
        <function name="aero/coefficient/dCybaeroelastic">
            <description>Side_force_due_to_beta_aeroelastic</description>
            <table> <!-- graph 7.0-5 -->
                <independentVar lookup="row">velocities/mach</independentVar>
                <independentVar lookup="column">atmosphere/density-altitude</independentVar>
                <tableData>
                          0   10000  20000  30000  40000
                0.0     1.0    1.0    1.0    1.0    1.0
                0.1     0.99   1.0    1.0    1.0    1.0
                0.2     0.98   0.99   1.0    1.0    1.0
                0.3     0.96   0.98   0.99   1.0    0.99
                0.4     0.94   0.97   0.98   0.99   0.99
                0.5     0.93   0.96   0.97   0.99   1.0
                0.6     0.92   0.95   0.96   0.98   1.0
                0.7     0.87   0.92   0.95   0.97   0.98
                0.8     0.82   0.85   0.88   0.92   0.94
                0.9     0.82   0.84   0.87   0.91   0.93
                0.95    0.82   0.79   0.83   0.87   0.88
                </tableData>
            </table>
        </function>
        
        <function name="aero/coefficient/FyB">
            <description>Side_force_due_to_beta_GE_factor</description>
            <table> <!-- graph 7.0-6 -->
                <independentVar lookup="row">aero/alpha-wing-rad</independentVar>
                <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                <tableData>
                         0.0000  1.0000  5.0000  10.0000  20.0000  25.0000  30.0000
                0.0000   0.170   0.170   0.170    0.170    0.070   -0.070   -0.130
                0.0349   0.150   0.150   0.150    0.150    0.050   -0.100   -0.160
                0.0698   0.130   0.130   0.130    0.130    0.010   -0.140   -0.210
                0.1047   0.100   0.100   0.100    0.100   -0.020   -0.170   -0.240
                0.1396   0.070   0.070   0.070    0.070   -0.050   -0.210   -0.280
                0.1745   0.030   0.030   0.030    0.030   -0.080   -0.240   -0.320
                0.2094   0.000   0.000   0.000    0.000   -0.120   -0.260   -0.340
                0.2443  -0.040  -0.040  -0.040   -0.040   -0.150   -0.250   -0.330
                </tableData>
            </table>
        </function>
        
        <function name="aero/coefficient/FCybGE">
            <description>Side_force_due_to_beta_GE</description>
            <sum>
                <value>1</value>
                <product>
                    <property>aero/function/Kge</property>
                    <property>aero/coefficient/FyB</property>
                </product>
            </sum>
        </function>
        
        <function name="aero/coefficient/Cyp">
            <description>Side_force_due_to_roll_rate</description>
            <product>
                <property>aero/bi2vel</property>
                <property>velocities/p-aero-rad_sec</property>
                <sum>
                    <product>
                        <table>
                            <independentVar>fcs/flaps/pos-deg</independentVar>
                            <tableData>
                                0 0
                                1 1
                               30 1
                            </tableData>
                        </table>
                        <table> <!-- graph 7.0-7 -->
                            <independentVar lookup="row">aero/alpha-wing-deg</independentVar>
                            <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                            <tableData>
                                    0.000  1.000  5.000 10.000 20.000 25.000 30.000
                            -5.000 -0.380 -0.380 -0.370 -0.270 -0.230 -0.190 -0.110
                             0.000 -0.170 -0.170 -0.160 -0.060 -0.000  0.080  0.220
                             5.000  0.060  0.060  0.070  0.175  0.260  0.410  0.570
                            10.000  0.320  0.320  0.330  0.420  0.550  0.710  0.880
                            15.000  0.550  0.550  0.630  0.720  0.820  0.950  1.150
                            20.000  0.740  0.740  0.880  0.950  1.050  1.150  1.350
                            25.000  0.780  0.780  0.980  1.050  1.100  1.150  1.150
                            </tableData>
                        </table>
                    </product>
                    <product>
                        <table>
                            <independentVar>fcs/flaps/pos-deg</independentVar>
                            <tableData>
                                0 1
                                1 0
                               30 0
                            </tableData>
                        </table>
                        <table> <!-- graph 7.0-7 -->
                            <independentVar lookup="row">aero/alpha-wing-deg</independentVar>
                            <independentVar lookup="column">velocities/mach</independentVar>
                            <tableData>
                                    0.000  0.600  0.800  0.900  0.950
                            -5.000 -0.380 -0.380 -0.380 -0.380 -0.380 
                             0.000 -0.170 -0.170 -0.170 -0.170 -0.170
                             5.000  0.060  0.060  0.060  0.060  0.060
                            10.000  0.320  0.320  0.290  0.210  0.115
                            15.000  0.550  0.550  0.300  0.210  0.115
                            20.000  0.740  0.740  0.300  0.210  0.115
                            25.000  0.780  0.780  0.300  0.210  0.115
                            </tableData>
                        </table>
                    </product>
                </sum>
            </product>
        </function>
        
        <function name="aero/coefficient/Cyr">
            <description>Side_force_due_to_yaw_rate</description>
            <product>
                <product>
                    <table> <!-- graph 7.0-8 -->
                        <independentVar lookup="row">aero/alpha-wing-rad</independentVar>
                        <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                        <tableData>
                                 0.0000  1.0000  5.0000  10.0000  20.0000  25.0000  30.0000
                       -0.0873   0.310   0.310   0.310    0.290    0.270    0.350    0.340
                        0.0000   0.320   0.320   0.320    0.300    0.270    0.310    0.250
                        0.0873   0.310   0.310   0.310    0.290    0.250    0.160    0.050
                        0.1745   0.260   0.260   0.250    0.200    0.120    0.010   -0.140
                        0.2618   0.130   0.130   0.080    0.040   -0.060   -0.190   -0.310
                        0.3491   0.030   0.030  -0.070   -0.120   -0.200   -0.310   -0.420
                        0.4363  -0.020  -0.020  -0.150   -0.180   -0.250   -0.350   -0.440
                        </tableData>
                    </table>
                    <table> <!-- graph 7.0-9 -->
                        <independentVar lookup="row">velocities/mach</independentVar>
                        <independentVar lookup="column">atmosphere/density-altitude</independentVar>
                        <tableData>
                                  0   10000  20000  40000
                        0.0     1.0     1.0    1.0    1.0
                        0.1     1.0     0.99   1.0    1.0
                        0.2     0.98    0.99   0.99   0.99
                        0.3     0.92    0.95   0.97   0.97
                        0.4     0.86    0.92   0.94   0.95
                        0.5     0.81    0.87   0.90   0.93
                        0.6     0.75    0.83   0.87   0.90
                        0.7     0.70    0.78   0.84   0.90
                        0.8     0.64    0.75   0.83   0.94
                        0.9     0.64    0.68   0.77   0.96
                        0.95    0.64    0.62   0.70   0.80
                        </tableData>
                    </table>
                </product>
                <property>velocities/r-aero-rad_sec</property>
                <property>aero/bi2vel</property>
            </product>
        </function>
        
        <function name="aero/coefficient/CyRu">
            <description>side_force_due_to_upper_rudder_alpha</description>
            <table> <!-- graph 7.0-13 -->
                <independentVar lookup="row">aero/alpha-wing-rad</independentVar>
                <tableData>
               -0.0873   0.0465
                0.0000   0.0445
                0.0873   0.0430
                0.1745   0.0420
                0.2618   0.0410
                0.3491   0.0385
                0.4363   0.0340
                </tableData>
            </table>
        </function>
        
        <function name="aero/coefficient/CyRl">
            <description>side_force_due_to_lower_rudder_alpha</description>
            <table> <!-- graph 7.0-13 -->
                <independentVar lookup="row">aero/alpha-wing-rad</independentVar>
                <tableData>
               -0.0873   0.0340
                0.0000   0.0340
                0.0873   0.0340
                0.1745   0.0340
                0.2618   0.0340
                0.3491   0.0340
                0.4363   0.0320
                </tableData>
            </table>
        </function>
        
        <function name="aero/coefficient/CyRuaeroelastic">
            <description>Side_force_due_to_rudder_upper_aeroelastic</description>
            <table> <!-- graph 7.0-14 -->
                <independentVar lookup="row">velocities/mach</independentVar>
                <independentVar lookup="column">atmosphere/density-altitude</independentVar>
                <tableData>
                          0   10000  20000  30000  40000
                0.0     1.0     1.0    1.0    1.0    1.0
                0.1     0.98    0.99   1.0    1.0    1.0
                0.2     0.92    0.94   0.96   0.98   0.99
                0.3     0.83    0.87   0.90   0.93   0.95
                0.4     0.70    0.75   0.80   0.85   0.88
                0.5     0.55    0.64   0.70   0.75   0.78
                0.6     0.40    0.50   0.58   0.65   0.70
                0.7     0.25    0.35   0.45   0.55   0.63
                0.8     0.06    0.24   0.35   0.48   0.55
                0.9     0.06    0.10   0.20   0.30   0.40
                0.95    0.06    0.02   0.05   0.07   0.09
                </tableData>
            </table>
        </function>
        
        <function name="aero/coefficient/CyRlaeroelastic">
            <description>Side_force_due_to_rudder_lower_aeroelastic</description>
            <table> <!-- graph 7.0-15 -->
                <independentVar lookup="row">velocities/mach</independentVar>
                <independentVar lookup="column">atmosphere/density-altitude</independentVar>
                <tableData>
                          0   10000  20000  30000  40000
                0.0     1.0     1.0    1.0    1.0    1.0
                0.1     1.0     1.0    1.0    1.0    1.0
                0.2     0.98    0.99   1.0    1.0    1.0
                0.3     0.94    0.96   0.98   0.99   1.0
                0.4     0.88    0.91   0.94   0.96   0.99
                0.5     0.79    0.85   0.89   0.93   0.96
                0.6     0.69    0.77   0.83   0.86   0.90
                0.7     0.55    0.65   0.71   0.75   0.80
                0.8     0.35    0.45   0.51   0.57   0.63
                0.9     0.35    0.15   0.16   0.18   0.20
                0.95    0.35    0.05   0.06   0.08   0.10
                </tableData>
            </table>
        </function>
    
        <function name="aero/coefficient/CYrudder">
            <description>Side_force_due_to_rudder</description>
            <sum>
                <product>
                    <property>-aero/function/kRu</property>
                    <property>aero/coefficient/CyRu</property>
                    <property>aero/coefficient/CyRuaeroelastic</property>
                </product>
                <product>
                    <property>-aero/function/kRl</property>
                    <property>aero/coefficient/CyRl</property>
                    <property>aero/coefficient/CyRlaeroelastic</property>
                </product>
            </sum>
        </function>
            
        <function name="aero/coefficient/CY">
            <description>Side_force_due_to_beta</description>
            <sum>
                <property>aero/coefficient/CYb</property>
                <property>aero/coefficient/Cyp</property>
                <property>aero/coefficient/Cyr</property>
                <property>aero/coefficient/CYrudder</property>
            </sum>
        </function>
        
        <axis name="SIDE">
            <function name="my_side">
                <description>Side_force</description>
                <product>
                    <property>aero/qbar-psf</property>
                    <property>metrics/Sw-sqft</property>
                    <property>aero/coefficient/CY</property>
                </product>
            </function>
        </axis>
        
        <!-- LIFT -->
        
        <function name="aero/coefficient/CLalpha">
            <description>Lift_due_to_alpha</description>
            <sum>
                <product>
                    <property>fcs/failures-wings-lift</property>
                    <table>
                        <independentVar>fcs/flaps/pos-deg</independentVar>
                        <tableData>
                            0 0
                            1 1
                           30 1
                        </tableData>
                    </table>
                    <table> <!-- graph 2.0-7 -->
                        <independentVar lookup="row">aero/alpha-wing-deg</independentVar>
                        <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                        <tableData>
                                0.0000   1.0000   5.0000  10.0000  20.0000  25.0000  30.0000
                           -5  -0.5500  -0.4400  -0.5500  -0.4000  -0.2600  -0.0400   0.2000
                            0  -0.0800   0.0300  -0.0400   0.1300   0.3600   0.5900   0.8700
                            5   0.3900   0.5000   0.5000   0.6400   0.9300   1.1100   1.4000
                           10   0.8700   0.9600   1.0200   1.1600   1.4600   1.6200   1.9200
                           15   1.1400   1.3200   1.5400   1.6700   1.9000   2.1000   2.3300
                           20   1.2600   1.4800   1.8000   1.8800   2.0800   2.2500   2.4500
                           25   1.3700   1.5700   1.8200   1.9200   2.0200   2.0900   2.1900
                        </tableData>
                    </table>
                </product>
                <product>
                    <property>fcs/failures-wings-lift</property>
                    <table>
                        <independentVar>fcs/flaps/pos-deg</independentVar>
                        <tableData>
                            0 1
                            1 0
                           30 0
                        </tableData>
                    </table>
                    <table> <!-- graph 2.0-8 -->
                        <independentVar lookup="row">aero/alpha-wing-deg</independentVar>
                        <independentVar lookup="column">velocities/mach</independentVar>
                        <tableData>
                                  0.30  0.80  0.84  0.97
                           -5.00 -0.47 -0.38 -0.40 -0.40
                            5.00  0.41  0.61  0.65  0.54
                           10.00  0.86  1.04  1.07  0.93
                           15.00  1.15  1.20  1.25  1.18
                           25.00  1.37  1.42  1.46  1.67
                        </tableData>
                    </table>
                </product>
            </sum>
        </function>
        
        <function name="aero/coefficient/dCLae">
            <description>Change_in_basic_lift_coefficient_due_to_aeroelasticity_at_low_speed</description>
            <sum>
                <product>
                    <table>
                        <independentVar>fcs/flaps/pos-deg</independentVar>
                        <tableData>
                            0 0
                            1 1
                           30 1
                        </tableData>
                    </table>
                    <table> <!-- graph 2.0-9 -->
                        <independentVar lookup="row">velocities/ve-kts</independentVar>
                        <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                        <tableData>
                                     1.000    5.000   10.000   20.000   25.000   30.000
                            0.000    0.000    0.000    0.000    0.000    0.000    0.000
                           50.000    0.000    0.000   -0.002   -0.004   -0.006   -0.008
                          100.000   -0.006   -0.006   -0.012   -0.026   -0.040   -0.044
                          250.000   -0.028   -0.028   -0.058   -0.120   -0.204   -0.228
                        </tableData>
                    </table>
                </product>
                <product>
                    <table>
                        <independentVar>fcs/flaps/pos-deg</independentVar>
                        <tableData>
                            0 1
                            1 0
                           30 0
                        </tableData>
                    </table>
                    <table> <!-- graph 2.0-10 -->
                        <independentVar lookup="row">velocities/mach</independentVar>
                        <independentVar lookup="column">atmosphere/density-altitude</independentVar>
                        <tableData>
                                     0.000  10000.000  40000.000
                            0.0      0.000      0.000      0.000
                            0.2     -0.004     -0.002     -0.001
                            0.5     -0.023     -0.019     -0.006
                            0.8     -0.049     -0.043     -0.022
                            0.85    -0.050     -0.050     -0.026
                            0.90    -0.050     -0.055     -0.030
                            0.92    -0.050     -0.050     -0.027
                            0.97    -0.050      0.002      0.002
                        </tableData>
                    </table>
                </product>
            </sum>
        </function>
        
        <function name="aero/coefficient/dCLalphaae">
            <description>Change_in_basic_lift_coefficient_due_to_aeroelastic_effect_on_the_rigid_airplane_basic_lift_coefficient_curve_slope</description>
            <sum>
                <product>
                    <table>
                        <independentVar>fcs/flaps/pos-deg</independentVar>
                        <tableData>
                            0 0
                            1 1
                           30 1
                        </tableData>
                    </table>
                    <table> <!-- graph 2.0-11 -->
                        <independentVar lookup="row">velocities/ve-kts</independentVar>
                        <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                        <tableData>
                                      1.0000    5.0000   10.0000   20.0000   25.0000   30.0000
                            0.0000    0.0000    0.0000    0.0000    0.0000    0.0000    0.0000
                           80.0000   -0.0016   -0.0018   -0.0018   -0.0020   -0.0018   -0.0016
                          250.0000   -0.0122   -0.0130   -0.0134   -0.0146   -0.0130   -0.0118
                        </tableData>
                    </table>
                    <property>aero/alpha-wing-deg</property>
                </product>
                <product>
                    <table>
                        <independentVar>fcs/flaps/pos-deg</independentVar>
                        <tableData>
                            0 1
                            1 0
                           30 0
                        </tableData>
                    </table>
                    <table> <!-- graph 2.0-12 -->
                        <independentVar lookup="row">velocities/mach</independentVar>
                        <independentVar lookup="column">atmosphere/density-altitude</independentVar>
                        <tableData>
                                      0.000 10000.000 40000.000
                            0.000     0.000     0.000     0.000
                            0.400    -0.010    -0.008    -0.002
                            0.600    -0.020    -0.016    -0.006
                            0.800    -0.035    -0.029    -0.012
                            0.875    -0.037    -0.038    -0.017
                            0.920    -0.037    -0.035    -0.015
                            0.970    -0.037    -0.047    -0.026
                        </tableData>
                    </table>
                    <property>aero/alpha-wing-deg</property>
                </product>
            </sum>
        </function>
        
        <function name="aero/coefficient/dCLalphadot">
            <description>Change_in_basic_lift_coefficient_due_to_rate_of_change_angle_of_attack</description>
            <product>
                <table> <!-- graph 2.0-13 --> <!-- not 100% sure that this should be negative -->
                    <independentVar>velocities/mach</independentVar>
                    <tableData>
                        0.00  -6.7
                        0.30  -6.7
                        0.70  -6.4
                        0.90  -5.5
                        0.95  -6.0
                        0.97  -6.2
                    </tableData>
                </table>
                <property>aero/ci2vel</property>
                <property>aero/alphadot-rad_sec</property>
            </product>
        </function>
        
        <function name="aero/coefficient/dCLqdot">
            <description>Change_in_basic_lift_coefficient_due_to_pitch_rate</description>
            <product>
                <!-- center of gravity factor -->
                <table>
                    <independentVar>aero/CoG-mac-pct</independentVar>
                    <tableData>
                        10.00   1.27
                        40.00   0.77
                    </tableData>
                </table>
                <table> <!-- graph 2.0-14 -->
                    <independentVar lookup="row">velocities/mach</independentVar>
                    <independentVar lookup="column">atmosphere/density-altitude</independentVar>
                    <tableData>
                                 0.00 20000.00 40000.00
                        0.00     6.80     6.80     6.80
                        0.40     4.80     5.30     6.10
                        0.70     3.70     5.10     5.80
                        0.80     3.40     5.00     6.00
                        0.85     3.40     5.10     6.30
                        0.90     3.60     5.50     6.90
                        0.94     2.30     4.40     6.10
                    </tableData>
                </table>
                <property>aero/ci2vel</property>
                <property>velocities/q-aero-rad_sec</property>
            </product>
        </function>
        
        <function name="aero/coefficient/dCLnz">
            <description>Change_in_basic_lift_coefficient_due_to_aeroelastic_inertia_relief_caused_by_normal_load_factor</description>
            <product>
                <sum>
                    <product>
                        <table>
                            <independentVar>fcs/flaps/pos-deg</independentVar>
                            <tableData>
                                 0  0
                                 1  1
                                30  1
                            </tableData>
                        </table>
                        <table> <!-- graph 2.0-15 -->
                            <independentVar lookup="row">velocities/ve-kts</independentVar>
                            <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                            <tableData>
                                          1.0000  5.0000 20.0000 25.0000 30.0000
                                  0.0000  0.0328  0.0346  0.0346  0.0374  0.0351
                                100.0000  0.0312  0.0330  0.0330  0.0352  0.0335
                                250.0000  0.0258  0.0269  0.0269  0.0295  0.0278
                            </tableData>
                        </table>
                    </product>
                    <product>
                        <table>
                            <independentVar>fcs/flaps/pos-deg</independentVar>
                            <tableData>
                                 0  1
                                 1  0
                                30  0
                            </tableData>
                        </table>
                        <table> <!-- graph 2.0-16 -->
                            <independentVar lookup="row">velocities/mach</independentVar>
                            <independentVar lookup="column">atmosphere/density-altitude</independentVar> <!-- data beyond m0.82 at sea level extrapolated -->
                            <tableData>
                                         0.0000 10000.0000 20000.0000 30000.0000 40000.0000
                                0.00     0.0258     0.0258     0.0258     0.0258     0.0258
                                0.10     0.0250     0.0254     0.0256     0.0256     0.0258
                                0.20     0.0242     0.0248     0.0253     0.0256     0.0258
                                0.30     0.0230     0.0237     0.0248     0.0256     0.0258
                                0.40     0.0218     0.0230     0.0242     0.0250     0.0258
                                0.50     0.0205     0.0220     0.0235     0.0248     0.0259
                                0.60     0.0189     0.0210     0.0228     0.0244     0.0259
                                0.70     0.0172     0.0198     0.0222     0.0243     0.0262
                                0.80     0.0160     0.0192     0.0223     0.0251     0.0277
                                0.82     0.0158     0.0192     0.0224     0.0256     0.0284
                                0.90     0.0155     0.0174     0.0210     0.0241     0.0273
                                0.95     0.0140     0.0150     0.0182     0.0215     0.0248
                                0.97     0.0110     0.0144     0.0176     0.0213     0.0250
                            </tableData>
                        </table>
                    </product>
                </sum>
                <property>forces/load-factor</property>
            </product>
        </function>
        
        <function name="aero/dCL_stabilizer">
            <product>
                <property>aero/function/k_stab</property>
                <table> <!-- graph 2.0-17 -->
                    <independentVar lookup="row">velocities/mach</independentVar>
                    <independentVar lookup="column">atmosphere/density-altitude</independentVar>
                    <tableData>
                                   0.0000 10000.0000 40000.0000
                        0.0000     0.0142     0.0142     0.0142
                        0.4000     0.0128     0.0130     0.0139
                        0.6000     0.0117     0.0123     0.0140
                        0.8150     0.0096     0.0115     0.0150
                        0.8500     0.0096     0.0114     0.0152
                        0.9000     0.0096     0.0110     0.0150
                        0.9700     0.0096     0.0092     0.0135
                    </tableData>
                </table>
                <property>fcs/stabilizer/pos-deg</property>
            </product>
        </function>

        <function name="aero/dCLsp45[0]">
            <table> <!-- graph 2.0-21 top (simplified) -->
                <independentVar>fcs/flaps/pos-deg</independentVar>
                <tableData>
                     0.00 -0.04
                     1.00 -0.04
                     5.00 -0.04
                    10.00 -0.04
                    20.00 -0.06
                    25.00 -0.09
                    30.00 -0.10
                </tableData>
            </table>
        </function>
        
        <function name="aero/dCLsp45[1]">
            <table> <!-- graph 2.0-21 bottom (simplified) -->
                <independentVar lookup="row">aero/alpha-wing-deg</independentVar>
                <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                <tableData>
                            0.000  1.000  5.000 10.000 20.000 25.000 30.000
                    -5.000 -0.030 -0.030 -0.040 -0.054 -0.071 -0.071 -0.076
                    10.000 -0.052 -0.052 -0.046 -0.070 -0.108 -0.145 -0.154
                    25.000 -0.004 -0.006 -0.050 -0.068 -0.090 -0.040 -0.042
                </tableData>
            </table>
        </function>
        
        <function name="aero/dCLsp45[2]">
            <table> <!-- graph 2.0-22 (simplified) -->
                <independentVar lookup="row">aero/alpha-wing-deg</independentVar>
                <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                <tableData>
                            0.000  1.000  5.000 10.000 20.000 25.000 30.000
                    -5.000 -0.052 -0.052 -0.064 -0.086 -0.132 -0.179 -0.195
                    14.000 -0.058 -0.058 -0.078 -0.089 -0.126 -0.162 -0.142
                    25.000  0.038  0.038  0.022  0.008 -0.014 -0.050 -0.039
                </tableData>
            </table>
        </function>
        
        <function name="aero/dCLsp_aeroelastic[0]">
            <table> <!-- graph 2.0-24 (simplified) -->
                <independentVar lookup="row">velocities/mach</independentVar>
                <independentVar lookup="column">atmosphere/density-altitude</independentVar>
                <tableData>
                             0.00 40000.00
                    0.00     1.00     1.00
                    0.40     0.93     0.98
                    0.80     0.74     0.92
                    0.97     0.73     0.82
                </tableData>
            </table>
        </function>
        
        <function name="aero/dCLsp_aeroelastic[1]">
            <table> <!-- graph 2.0-25 (simplified) -->
                <independentVar lookup="row">velocities/mach</independentVar>
                <independentVar lookup="column">atmosphere/density-altitude</independentVar>
                <tableData>
                             0.00 40000.00
                    0.00     1.00     1.00
                    0.40     0.73     0.94
                    0.80     0.23     0.73
                    0.97     0.21     0.55
                </tableData>
            </table>
        </function>
        
        <function name="aero/dCLsp_aeroelastic[2]">
            <table> <!-- graph 2.0-26 -->
                <independentVar lookup="row">velocities/mach</independentVar>
                <independentVar lookup="column">atmosphere/density-altitude</independentVar>
                <tableData>
                              0.000 10000.000 20000.000 30000.000 40000.000
                    0.000     1.000     1.000     1.000     1.000     1.000
                    0.100     0.972     0.976     0.986     0.990     0.995
                    0.200     0.904     0.934     0.956     0.976     0.988
                    0.300     0.785     0.856     0.902     0.943     0.975
                    0.400     0.657     0.742     0.823     0.891     0.941
                    0.500     0.513     0.613     0.723     0.813     0.886
                    0.600     0.364     0.482     0.611     0.729     0.822
                    0.700     0.207     0.351     0.495     0.638     0.752
                    0.800     0.048     0.212     0.366     0.514     0.659
                    0.900     0.048     0.057     0.237     0.405     0.575
                    0.970     0.048     0.004     0.140     0.276     0.442
                </tableData>
            </table>
        </function>
                    
        <function name="aero/coefficient/dCLspoilers">
            <description>Change in basic lift coefficient due to spoiler or speedbrake deflection</description>
            <product>
                <sum>
                    <product> <!-- panel 1 -->
                        <table> <!-- graph 2.0-20 -->
                            <independentVar lookup="row">fcs/spoiler[0]/pos-deg</independentVar>
                            <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                            <tableData>
                                       0.00  1.00  5.00 30.00
                                 0.00  0.00  0.00  0.00  0.00
                                10.00  0.14  0.14  0.16  0.22
                                15.00  0.22  0.22  0.30  0.50
                                30.00  0.49  0.49  0.57  0.72  
                                45.00  1.00  1.00  1.00  1.00
                            </tableData>
                        </table>
                        <property>aero/dCLsp45[0]</property>
                        <value>0.5</value>
                        <property>aero/dCLsp_aeroelastic[2]</property>
                    </product>
                    <product> <!-- panels 2, 3, 4 -->
                        <avg>
                            <table> <!-- graph 2.0-20 -->
                                <independentVar lookup="row">fcs/spoiler[1]/pos-deg</independentVar>
                                <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                                <tableData>
                                           0.00  1.00  5.00 30.00
                                     0.00  0.00  0.00  0.00  0.00
                                    10.00  0.14  0.14  0.16  0.22
                                    15.00  0.22  0.22  0.30  0.50
                                    30.00  0.49  0.49  0.57  0.72  
                                    45.00  1.00  1.00  1.00  1.00
                                </tableData>
                            </table>
                            <table> <!-- graph 2.0-20 -->
                                <independentVar lookup="row">fcs/spoiler[2]/pos-deg</independentVar>
                                <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                                <tableData>
                                           0.00  1.00  5.00 30.00
                                     0.00  0.00  0.00  0.00  0.00
                                    10.00  0.14  0.14  0.16  0.22
                                    15.00  0.22  0.22  0.30  0.50
                                    30.00  0.49  0.49  0.57  0.72  
                                    45.00  1.00  1.00  1.00  1.00
                                </tableData>
                            </table>
                            <table> <!-- graph 2.0-20 -->
                                <independentVar lookup="row">fcs/spoiler[3]/pos-deg</independentVar>
                                <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                                <tableData>
                                           0.00  1.00  5.00 30.00
                                     0.00  0.00  0.00  0.00  0.00
                                    10.00  0.14  0.14  0.16  0.22
                                    15.00  0.22  0.22  0.30  0.50
                                    30.00  0.49  0.49  0.57  0.72  
                                    45.00  1.00  1.00  1.00  1.00
                                </tableData>
                            </table>
                        </avg>
                        <property>aero/dCLsp45[1]</property>
                        <property>aero/dCLsp_aeroelastic[1]</property>
                    </product>
                    <product> <!-- panel 5 -->
                        <table> <!-- graph 2.0-20 -->
                            <independentVar lookup="row">fcs/spoiler[4]/pos-deg</independentVar>
                            <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                            <tableData>
                                       0.00  1.00  5.00 30.00
                                 0.00  0.00  0.00  0.00  0.00
                                10.00  0.14  0.14  0.16  0.22
                                15.00  0.22  0.22  0.30  0.50
                                30.00  0.49  0.49  0.57  0.72  
                                45.00  1.00  1.00  1.00  1.00
                            </tableData>
                        </table>
                        <property>aero/dCLsp45[0]</property>
                        <property>aero/dCLsp_aeroelastic[0]</property>
                    </product>
                    <product> <!-- panel 6 and 7 -->
                        <avg>
                            <table> <!-- graph 2.0-20 -->
                                <independentVar lookup="row">fcs/spoiler[5]/pos-deg</independentVar>
                                <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                                <tableData>
                                           0.00  1.00  5.00 30.00
                                     0.00  0.00  0.00  0.00  0.00
                                    10.00  0.14  0.14  0.16  0.22
                                    15.00  0.22  0.22  0.30  0.50
                                    30.00  0.49  0.49  0.57  0.72  
                                    45.00  1.00  1.00  1.00  1.00
                                </tableData>
                            </table>
                            <table> <!-- graph 2.0-20 -->
                                <independentVar lookup="row">fcs/spoiler[6]/pos-deg</independentVar>
                                <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                                <tableData>
                                           0.00  1.00  5.00 30.00
                                     0.00  0.00  0.00  0.00  0.00
                                    10.00  0.14  0.14  0.16  0.22
                                    15.00  0.22  0.22  0.30  0.50
                                    30.00  0.49  0.49  0.57  0.72  
                                    45.00  1.00  1.00  1.00  1.00
                                </tableData>
                            </table>
                        </avg>
                        <property>aero/dCLsp45[2]</property>
                        <property>aero/dCLsp_aeroelastic[0]</property>
                    </product>
                    <product> <!-- panel 8 -->
                        <table> <!-- graph 2.0-20 -->
                            <independentVar lookup="row">fcs/spoiler[7]/pos-deg</independentVar>
                            <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                            <tableData>
                                       0.00  1.00  5.00 30.00
                                 0.00  0.00  0.00  0.00  0.00
                                10.00  0.14  0.14  0.16  0.22
                                15.00  0.22  0.22  0.30  0.50
                                30.00  0.49  0.49  0.57  0.72  
                                45.00  1.00  1.00  1.00  1.00
                            </tableData>
                        </table>
                        <property>aero/dCLsp45[0]</property>
                        <property>aero/dCLsp_aeroelastic[0]</property>
                    </product>
                    <product> <!-- panels 9, 10, 11 -->
                        <avg>
                            <table> <!-- graph 2.0-20 -->
                                <independentVar lookup="row">fcs/spoiler[8]/pos-deg</independentVar>
                                <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                                <tableData>
                                           0.00  1.00  5.00 30.00
                                     0.00  0.00  0.00  0.00  0.00
                                    10.00  0.14  0.14  0.16  0.22
                                    15.00  0.22  0.22  0.30  0.50
                                    30.00  0.49  0.49  0.57  0.72  
                                    45.00  1.00  1.00  1.00  1.00
                                </tableData>
                            </table>
                            <table> <!-- graph 2.0-20 -->
                                <independentVar lookup="row">fcs/spoiler[9]/pos-deg</independentVar>
                                <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                                <tableData>
                                           0.00  1.00  5.00 30.00
                                     0.00  0.00  0.00  0.00  0.00
                                    10.00  0.14  0.14  0.16  0.22
                                    15.00  0.22  0.22  0.30  0.50
                                    30.00  0.49  0.49  0.57  0.72  
                                    45.00  1.00  1.00  1.00  1.00
                                </tableData>
                            </table>
                            <table> <!-- graph 2.0-20 -->
                                <independentVar lookup="row">fcs/spoiler[10]/pos-deg</independentVar>
                                <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                                <tableData>
                                           0.00  1.00  5.00 30.00
                                     0.00  0.00  0.00  0.00  0.00
                                    10.00  0.14  0.14  0.16  0.22
                                    15.00  0.22  0.22  0.30  0.50
                                    30.00  0.49  0.49  0.57  0.72  
                                    45.00  1.00  1.00  1.00  1.00
                                </tableData>
                            </table>
                        </avg>
                        <property>aero/dCLsp45[1]</property>
                        <property>aero/dCLsp_aeroelastic[1]</property>
                    </product>
                    <product> <!-- panel 12 -->
                        <table> <!-- graph 2.0-20 -->
                            <independentVar lookup="row">fcs/spoiler[11]/pos-deg</independentVar>
                            <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                            <tableData>
                                       0.00  1.00  5.00 30.00
                                 0.00  0.00  0.00  0.00  0.00
                                10.00  0.14  0.14  0.16  0.22
                                15.00  0.22  0.22  0.30  0.50
                                30.00  0.49  0.49  0.57  0.72  
                                45.00  1.00  1.00  1.00  1.00
                            </tableData>
                        </table>
                        <property>aero/dCLsp45[0]</property>
                        <value>0.5</value>
                        <property>aero/dCLsp_aeroelastic[2]</property>
                    </product>
                </sum>
                <table> <!-- graph 2.0-23 -->
                    <independentVar lookup="row">velocities/mach</independentVar>
                    <independentVar lookup="column">aero/alpha-wing-deg</independentVar>
                    <tableData>
                             0.00 8.00
                        0.00 1.00 1.00
                        0.20 1.00 1.00
                        0.70 1.36 1.36
                        0.80 1.54 1.54
                        0.90 1.88 0.20
                        0.97 1.30 0.36
                    </tableData>
                </table>
                <property>aero/coefficient/FClspGE</property> <!-- graph 5.0-29 -->
            </product>
        </function>

        <function name="aero/coefficient/dCLge">
            <description>Delta_Lift_due_to_groundeffect</description>
            <table> <!-- graph 2.0-32 -->
                <independentVar lookup="row">aero/alpha-wing-deg</independentVar>
                <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                <tableData>
                            0.000  1.000  5.000 10.000 20.000 25.000 30.000
                     0.000 -0.075 -0.060 -0.045  0.040  0.080  0.240  0.225
                     5.000  0.025  0.045  0.065  0.145  0.200  0.280  0.220
                    10.000  0.150  0.170  0.190  0.230  0.225  0.225  0.115
                    14.500  0.175  0.195  0.200  0.230  0.185  0.075 -0.040
                </tableData>
            </table>
        </function>

        <function name="aero/coefficient/CLde_inboard">
            <description>Lift_due_to_inboard_elevator_deflection</description>
            <product>
                <todegrees><property>fcs/elevator[1]/pos-rad</property></todegrees>
                <property>aero/function/k_stab</property>
                <table> <!-- graph 2.0-18 -->
                    <independentVar lookup="row">velocities/mach</independentVar>
                    <independentVar lookup="column">atmosphere/density-altitude</independentVar>
                    <tableData>
                                    0.00000 10000.00000 40000.00000
                        0.00000     0.00325     0.00325     0.00325
                        0.40000     0.00255     0.00290     0.00350
                        0.70000     0.00175     0.00245     0.00355
                        0.90000     0.00170     0.00210     0.00310
                        0.97000     0.00170     0.00150     0.00235
                    </tableData>
                </table>
            </product>
        </function>
        
        <function name="aero/coefficient/CLde_outboard">
            <description>Lift_due_to_outboard_elevator_deflection</description>
            <product>
                <todegrees><property>fcs/elevator[0]/pos-rad</property></todegrees>
                <property>aero/function/k_stab</property>
                <table> <!-- graph 2.0-19 -->
                    <independentVar lookup="row">velocities/mach</independentVar>
                    <independentVar lookup="column">atmosphere/density-altitude</independentVar>
                    <tableData>
                                    0.00000 10000.00000 40000.00000
                        0.00000     0.00380     0.00380     0.00380
                        0.40000     0.00240     0.00285     0.00390
                        0.60000     0.00155     0.00220     0.00375
                        0.81500     0.00050     0.00110     0.00285
                        0.97000     0.00050    -0.00020     0.00160
                    </tableData>
                </table>
            </product>
        </function>
        
        <!-- TODO: graph 2.0-27 -->
        
        <function name="aero/coefficient/dCLgear">
            <description>Delta_lift_due_to_landing_gear</description>
            <product>
                <property>aero/function/Kgear</property>
                <table> <!-- graph 2.0-29 -->
                    <independentVar lookup="row">aero/alpha-wing-deg</independentVar>
                    <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                    <tableData>
                                0.000  1.000  5.000 10.000 20.000 25.000 30.000
                        -5.000  0.046  0.046  0.046  0.037  0.042 -0.005 -0.005
                         0.000  0.042  0.042  0.039  0.029  0.029 -0.025 -0.025
                         5.000  0.036  0.036  0.032  0.021  0.018 -0.030 -0.030
                        18.000  0.017  0.017  0.010  0.002 -0.003 -0.024 -0.024
                        25.000  0.002  0.002 -0.005 -0.006 -0.011 -0.028 -0.028
                    </tableData>
                </table>
                <table> <!-- graph 2.0-30 -->
                    <independentVar>velocities/mach</independentVar>
                    <tableData>
                        0.0   1.0
                        0.3   1.0
                        0.6   1.9
                        0.7   2.4
                        0.8   3.5
                    </tableData>
                </table>
            </product>
        </function>
        
        <documentation>
          CL = CL0 + ... + dCL_inboard_elevators + dCL_outboard_elevators + dCL_outboard_ailerons + dCL_landing_gear + dCL_ground_effect
        </documentation>
            
        <!-- CL_star is needed for CD -->
        <function name="aero/coefficient/CL_star">
            <description>Lift coefficient of first six terms</description>
            <sum>
                <property>aero/coefficient/CLalpha</property>
                <property>aero/coefficient/dCLae</property>
                <property>aero/coefficient/dCLalphaae</property>
                <property>aero/coefficient/dCLalphadot</property>
                <property>aero/coefficient/dCLqdot</property>
                <property>aero/coefficient/dCLnz</property>
            </sum>
        </function>
        <function name="aero/coefficient/CL_total">
            <description>Total lift coefficient</description>
            <sum>
                <property>aero/coefficient/CL_star</property>
                <property>aero/dCL_stabilizer</property>
                <property>aero/coefficient/CLde_inboard</property>
                <property>aero/coefficient/CLde_outboard</property>
                <property>aero/coefficient/dCLge</property>
                <property>aero/coefficient/dCLgear</property>
                <property>aero/coefficient/dCLspoilers</property>
            </sum>
        </function>
            
        <axis name="LIFT">
            <documentation>
              CL = CL0 + ... + dCL_inboard_elevators + dCL_outboard_elevators + dCL_outboard_ailerons + dCL_landing_gear + dCL_ground_effect
            </documentation>
            
            <function name="my_lift">
                <description>Lift_force</description>
                <product>
                    <property>aero/qbar-psf</property>
                    <property>metrics/Sw-sqft</property>
                    <property>aero/coefficient/CL_total</property>
                    <property>fcs/failures-wings-lift</property>
                </product>
            </function>            
        </axis>
        
        <!-- DRAG -->
        
        <function name="aero/coefficient/CD0">
            <description>Basic drag coefficient for the rigid airplane</description>
            <table> <!-- graph 3.0-5 -->
                <independentVar lookup="row">aero/alpha-wing-deg</independentVar>
                <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                <tableData>
                            1.000  5.000 10.000 20.000 25.000 30.000
                    -5.000  0.091  0.122  0.104  0.104  0.093  0.136
                     0.000  0.036  0.056  0.051  0.060  0.070  0.116
                     2.000  0.028  0.044  0.042  0.058  0.075  0.127
                     5.000  0.030  0.041  0.047  0.072  0.095  0.161
                    10.000  0.061  0.077  0.091  0.129  0.165  0.249
                    15.000  0.129  0.152  0.171  0.214  0.278  0.357
                    20.000  0.294  0.254  0.283  0.323  0.443  0.533
                    25.000  0.447  0.435  0.458  0.510  0.625  0.690
                </tableData>
            </table>
        </function>
        
        <function name="aero/coefficient/dCD_stabilizer">
            <description>Change in basic drag coefficient due to change in stabilizer angle</description>
            <product>
                <property>fcs/stabilizer/pos-deg</property>
                <table> <!-- graphs 3.0-6 and 3.0-7 -->
                    <independentVar lookup="row">aero/alpha-wing-deg</independentVar>
                    <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                    <tableData>
                               0.0000 10.0000 20.0000 30.0000
                      -5.0000 -0.0022 -0.0031 -0.0038 -0.0051
                       0.0000 -0.0008 -0.0011 -0.0015 -0.0032
                       8.0000  0.0008  0.0005  0.0005 -0.0001
                      20.0000  0.0035  0.0018  0.0025  0.0025
                      25.0000  0.0058  0.0041  0.0049  0.0034
                    </tableData>
                </table>
            </product>
        </function>
        
        <function name="aero/coefficient/CDmach">
            <description>Drag_due_to_mach</description>
            <product>
                <sum>
                    <value>1</value>
                    <product>
                        <property>aero/function/kCD</property>
                        <value>-1</value>
                    </product>
                </sum>
                <table> <!-- graph 3.0-8 and 3.0-9 -->
                    <independentVar lookup="row">aero/coefficient/CL_star</independentVar>
                    <independentVar lookup="column">velocities/mach</independentVar>
                    <tableData>
                               0.0000  0.3000  0.5000  0.7000  0.9200
                        0.000  0.0190  0.0190  0.0180  0.0174  0.0286
                        0.200  0.0190  0.0190  0.0180  0.0174  0.0281
                        0.400  0.0240  0.0240  0.0230  0.0220  0.0370
                        0.600  0.0350  0.0350  0.0340  0.0340  0.0680
                        1.300  0.1800  0.1800  0.1800  0.2100  0.2580
                    </tableData> <!-- mach 0.92 at 1.300 is guessed -->
                </table>
            </product>
        </function>
        
        <!-- THIS IS CURRENTLY ONLY TRACKING GROUND SPOILTERS (panels 6 and 7) -->
        <!-- TODO: add other spoilers -->
        <function name="aero/coefficient/dCDsp">
            <description>Delta_drag_due_to_spoilers</description>
            <product>
                <sum>
                    <table> <!-- graph 3.0-12 -->
                        <independentVar>fcs/flaps/pos-deg</independentVar>
                        <tableData>
                           0.0000    0.0008
                           1.0000    0.0008
                           5.0000    0.0020
                          10.0000    0.0020
                          15.0000    0.0016
                          20.0000   -0.0008
                          25.0000   -0.0036
                          30.0000   -0.0054
                        </tableData>
                    </table>
                    <product>
                        <table> <!-- graph 3.0-12 -->
                            <independentVar>fcs/flaps/pos-deg</independentVar>
                            <tableData>
                               0.0000   -0.00013
                               1.0000   -0.00013
                               5.0000   -0.00012
                              10.0000   -0.00016
                              15.0000   -0.00032
                              20.0000   -0.00056
                              25.0000   -0.00060
                              30.0000   -0.00106
                            </tableData>
                        </table>
                        <sum>
                            <property>aero/alpha-wing-deg</property>
                            <value>-4</value>
                        </sum>
                    </product>
                </sum>
                <quotient> <!-- normalize to 2 * 20 deg = 1 -->
                    <sum>
                        <property>fcs/spoiler[5]/pos-deg</property>
                        <property>fcs/spoiler[6]/pos-deg</property>
                    </sum>
                    <value>40</value>
                </quotient>
            </product>
        </function>
        
        <function name="aero/coefficient/dCDspoilers">
            <description>Change in drag coefficient due to spoiler or speedbrake deflection</description>
            <sum>
                <product>
                    <property>aero/coefficient/dCDsp</property>
                    <sum>
                        <value>1</value>
                        <product>
                            <property>aero/function/FD</property>
                            <property>aero/function/Kge</property>
                        </product>
                    </sum>
                </product>
                <product>
                    <value>0.05</value>
                    <property>aero/function/FD</property>
                    <property>aero/function/Kge</property>
                    <value>0.00185</value> <!-- 1/(45n), where n = 12 -->
                    <sum>
                        <property>fcs/spoiler[0]/pos-deg</property>
                        <property>fcs/spoiler[1]/pos-deg</property>
                        <property>fcs/spoiler[2]/pos-deg</property>
                        <property>fcs/spoiler[3]/pos-deg</property>
                        <property>fcs/spoiler[4]/pos-deg</property>
                        <property>fcs/spoiler[5]/pos-deg</property>
                        <property>fcs/spoiler[6]/pos-deg</property>
                        <property>fcs/spoiler[7]/pos-deg</property>
                        <property>fcs/spoiler[8]/pos-deg</property>
                        <property>fcs/spoiler[9]/pos-deg</property>
                        <property>fcs/spoiler[10]/pos-deg</property>
                        <property>fcs/spoiler[11]/pos-deg</property>
                    </sum>
                </product>
            </sum>
        </function>
        
        <function name="aero/coefficient/dCDgear">
            <description>Change_in_drag_due_to_gear</description>
            <product>
                <property>aero/function/Kgear</property>
                <table> <!-- graph 3.0-15 -->
                    <independentVar lookup="row">aero/alpha-wing-deg</independentVar>
                    <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                    <tableData>
                              0.0000  1.0000 20.0000 25.0000 30.0000
                     -5.0000  0.0275  0.0275  0.0245  0.0185  0.0155
                      0.0000  0.0280  0.0280  0.0245  0.0170  0.0115
                      5.0000  0.0280  0.0280  0.0235  0.0140  0.0085
                     10.0000  0.0270  0.0270  0.0200  0.0100  0.0070
                     15.0000  0.0245  0.0245  0.0180  0.0100  0.0076
                     20.0000  0.0225  0.0225  0.0160  0.0140  0.0122
                     25.0000  0.0200  0.0200  0.0140  0.0080  0.0062
                    </tableData>
                </table>
                <table> <!-- graph 3.0-16 -->
                    <independentVar>velocities/mach</independentVar>
                    <tableData>
                       0.00  1.00
                       0.50  1.00
                       0.60  1.02
                       0.70  1.08
                       0.80  1.20
                       0.82  1.23
                    </tableData>
                </table>
            </product>
        </function>
        
        <function name="aero/coefficient/dCDge">
            <description>Drag_due_to_ground_effect</description>
            <product>
                <property>aero/function/Kge</property>
                <table> <!-- graph 3.0-18 -->
                    <independentVar lookup="row">aero/alpha-wing-deg</independentVar>
                    <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                    <tableData>
                             0.000   1.000  25.000  30.000
                         0  -0.021  -0.017  -0.030  -0.033
                         5  -0.026  -0.019  -0.046  -0.050
                        10  -0.034  -0.024  -0.072  -0.078
                        15  -0.043  -0.041  -0.084  -0.091
                    </tableData>
                </table>
            </product>
        </function>
        
        <function name="aero/coefficient/dCDbeta">
            <description>Drag_due_to_sideslip</description>
            <table> <!-- graph 3.0-19 -->
                <independentVar lookup="row">aero/beta-deg</independentVar>
                <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                <tableData>
                             0.0000 20.0000 25.0000 30.0000
                   -15.0000 -0.0225 -0.0225 -0.0280 -0.0310
                    -6.0000 -0.0050 -0.0050 -0.0060 -0.0075
                    -2.0000 -0.0010 -0.0010 -0.0010 -0.0010
                     0.0000  0.0000  0.0000  0.0000  0.0000
                     2.0000 -0.0010 -0.0010 -0.0010 -0.0010
                     6.0000 -0.0050 -0.0050 -0.0060 -0.0075 
                    15.0000 -0.0225 -0.0225 -0.0280 -0.0310
                </tableData>
            </table>
        </function>
        
        <function name="aero/coefficient/dCDrudder">
            <description>Drag_due_to_rudder_deflection</description>
            <table> <!-- graph 3.0-19 -->
                <independentVar lookup="row">fcs/rudder-pos-rad</independentVar>
                <independentVar lookup="column">aero/beta-deg</independentVar>
                <tableData>
                           -0.2618  0.0000  0.2618
                  -25.0000  0.0650  0.0800  0.0950
                    0.0000  0.0000  0.0000  0.0000
                   25.0000  0.0950  0.0800  0.0650
                </tableData>
            </table>
        </function>
        
        <function name="aero/coefficient/dCDreversers">
            <description>Drag due to thrust reversers</description>
            <product>
                <value>0.25</value>
                <sum>
                    <property>propulsion/engine[0]/reversed</property>
                    <property>propulsion/engine[1]/reversed</property>
                    <property>propulsion/engine[2]/reversed</property>
                    <property>propulsion/engine[3]/reversed</property>
                </sum>
                <sum>
                    <property>propulsion/engine[0]/n1</property>
                    <property>propulsion/engine[1]/n1</property>
                    <property>propulsion/engine[2]/n1</property>
                    <property>propulsion/engine[3]/n1</property>
                </sum>
                <value>0.00212765957</value> <!-- 1/4*117.5 -->
                <table>
                    <independentVar>velocities/ve-kts</independentVar>
                    <tableData>
                          0    0
                         20    0.19
                        100    0.11
                        320    0.028
                    </tableData>
                </table>
            </product>
        </function>
        
        <function name="aero/coefficient/CD">
            <description>Total_drag_coefficient</description>
            <sum>
                <product>
                    <property>aero/function/kCD</property>
                    <sum>
                        <property>aero/coefficient/CD0</property>
                        <property>aero/coefficient/dCD_stabilizer</property>
                    </sum>
                </product>
                <property>aero/coefficient/CDmach</property>
                <property>aero/coefficient/dCDspoilers</property>
                <property>aero/coefficient/dCDbeta</property>
                <property>aero/coefficient/dCDgear</property>
                <property>aero/coefficient/dCDge</property>
                <property>aero/coefficient/dCDrudder</property>
                <property>aero/coefficient/dCDreversers</property>
            </sum>
        </function>
            
        <axis name="DRAG">
            <function name="my_drag">
                <description>Drag_force</description>
                <product>
                    <property>aero/qbar-psf</property>
                    <property>metrics/Sw-sqft</property>
                    <property>aero/coefficient/CD</property>
                </product>
            </function>
        </axis>

        <!-- ROLL -->
        
        <function name="aero/coefficient/Clb">
            <description>Roll_moment_due_to_beta</description> <!-- angle of sideslip -->
            <product>
                <product>
                    <sum>
                        <product>
                            <sum>
                                <product>
                                    <table>
                                        <independentVar>fcs/flaps/pos-deg</independentVar>
                                        <tableData>
                                             0  0
                                             1  1
                                            30  1
                                        </tableData>
                                    </table>
                                    <table> <!-- graph 5.0-7 -->
                                        <independentVar lookup="row">aero/alpha-wing-rad</independentVar>
                                        <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                                        <tableData>
                                                 0.0000  1.0000  5.0000  10.0000  20.0000  25.0000  30.0000
                                       -0.0873  -0.0024 -0.0019 -0.0019  -0.0020  -0.0022  -0.0021  -0.0028
                                        0.0000  -0.0026 -0.0022 -0.0023  -0.0024  -0.0025  -0.0034  -0.0039
                                        0.0873  -0.0030 -0.0028 -0.0029  -0.0032  -0.0034  -0.0041  -0.0044
                                        0.1745  -0.0034 -0.0032 -0.0034  -0.0036  -0.0041  -0.0045  -0.0048
                                        0.2618  -0.0020 -0.0034 -0.0036  -0.0039  -0.0046  -0.0050  -0.0055
                                        0.3491  -0.0013 -0.0027 -0.0047  -0.0052  -0.0058  -0.0062  -0.0056
                                        0.4363  -0.0020 -0.0036 -0.0042  -0.0043  -0.0044  -0.0046  -0.0046
                                        </tableData>
                                    </table>
                                </product>
                                <product>
                                    <table>
                                        <independentVar>fcs/flaps/pos-deg</independentVar>
                                        <tableData>
                                             0  1
                                             1  0
                                            30  0
                                        </tableData>
                                    </table>
                                    <table> <!-- graph 5.0-8 -->
                                        <independentVar lookup="row">aero/alpha-wing-deg</independentVar>
                                        <independentVar lookup="column">velocities/mach</independentVar>
                                        <tableData>
                                                  0.30000  0.50000  0.70000  0.80000  0.84000  0.90000  0.92000  0.95000  0.97000
                                        -2.00000 -0.00247 -0.00254 -0.00243 -0.00254 -0.00264 -0.00283 -0.00289 -0.00236 -0.00164
                                        -1.00000 -0.00253 -0.00257 -0.00250 -0.00261 -0.00273 -0.00293 -0.00297 -0.00120 -0.00093
                                         0.00000 -0.00260 -0.00264 -0.00258 -0.00270 -0.00285 -0.00310 -0.00301 -0.00079 -0.00061
                                         1.00000 -0.00267 -0.00268 -0.00267 -0.00282 -0.00301 -0.00326 -0.00279 -0.00080 -0.00050
                                         2.00000 -0.00275 -0.00276 -0.00277 -0.00297 -0.00320 -0.00316 -0.00229 -0.00088 -0.00043
                                         3.00000 -0.00284 -0.00284 -0.00288 -0.00313 -0.00345 -0.00278 -0.00174 -0.00075 -0.00040
                                         4.00000 -0.00294 -0.00293 -0.00301 -0.00333 -0.00382 -0.00200 -0.00113 -0.00038 -0.00040
                                         5.00000 -0.00304 -0.00305 -0.00314 -0.00366 -0.00448 -0.00099 -0.00052 -0.00011 -0.00042
                                         6.00000 -0.00315 -0.00319 -0.00335 -0.00441 -0.00429 -0.00051 -0.00011 -0.00001 -0.00046
                                         7.00000 -0.00328 -0.00336 -0.00372 -0.00510 -0.00363 -0.00096 -0.00036 -0.00010 -0.00080
                                         8.00000 -0.00340 -0.00353 -0.00386 -0.00430 -0.00317 -0.00137 -0.00072 -0.00033 -0.00105
                                         9.00000 -0.00349 -0.00328 -0.00312 -0.00359 -0.00317 -0.00168 -0.00105 -0.00059 -0.00117
                                        10.00000 -0.00338 -0.00301 -0.00240 -0.00316 -0.00323 -0.00191 -0.00136 -0.00083 -0.00125
                                        11.00000 -0.00303 -0.00274 -0.00215 -0.00287 -0.00318 -0.00210 -0.00161 -0.00107 -0.00130
                                        12.00000 -0.00263 -0.00250 -0.00209 -0.00264 -0.00308 -0.00225 -0.00183 -0.00129 -0.00134
                                        </tableData>
                                    </table>
                                </product>
                            </sum>
                            <table> <!-- graph 5.0-9 -->
                                <independentVar lookup="row">aero/beta-deg</independentVar>
                                <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                                <tableData>
                                            0.000  1.000  5.000 10.000 20.000 25.000 30.000
                                   -15.000  0.480  0.480  0.700  0.740  0.740  0.800  0.800
                                   -10.000  0.720  0.720  0.900  0.925  0.925  0.975  0.975
                                    -5.000  0.940  0.940  1.000  1.000  1.000  1.000  1.000
                                    -3.000  1.000  1.000  1.000  1.000  1.000  1.000  1.000
                                     0.000  1.000  1.000  1.000  1.000  1.000  1.000  1.000
                                     3.000  1.000  1.000  1.000  1.000  1.000  1.000  1.000
                                     5.000  0.940  0.940  1.000  1.000  1.000  1.000  1.000
                                    10.000  0.720  0.720  0.900  0.925  0.925  0.975  0.975
                                    15.000  0.480  0.480  0.700  0.740  0.740  0.800  0.800
                                </tableData>
                            </table>
                            <table> <!-- graph 5.0-10 -->
                                <independentVar lookup="row">velocities/mach</independentVar>
                                <independentVar lookup="column">atmosphere/density-altitude</independentVar>
                                <tableData>
                                          0   10000  20000  30000  40000
                                0.0     1.0     1.0    1.0    1.0    1.0
                                0.1     1.0     1.0    1.0    1.0    1.0
                                0.2     1.0     1.0    1.0    1.0    1.0
                                0.3     0.99    1.0    1.0    1.0    1.0
                                0.4     0.98    1.0    1.0    1.0    1.0
                                0.5     0.97    0.99   1.0    1.0    1.0
                                0.6     0.95    0.98   0.99   1.0    1.0
                                0.7     0.93    0.95   0.97   0.99   1.0
                                0.8     0.90    0.92   0.94   0.97   0.98
                                0.9     0.90    0.90   0.93   0.96   0.97
                                0.95    0.90    0.30   0.50   0.60   0.70  
                                </tableData>
                            </table>
                        </product>
                        <product>
                            <property>aero/function/Kgear</property>
                            <value>-0.0003</value>
                        </product>
                    </sum>
                    <sum>
                        <value>1</value>
                        <product>
                            <property>aero/coefficient/Fbeta</property>
                            <property>aero/function/Kge</property>
                        </product>
                    </sum>
                </product>
                <property>aero/beta-deg</property>
            </product>
        </function>
        
        <function name="aero/coefficient/Fbeta">
            <description>Roll_moment_due_to_beta_groundeffect</description>
            <table> <!-- graph 5.0-11 -->
                <independentVar lookup="row">aero/alpha-wing-rad</independentVar>
                <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                <tableData>
                         0.0000  1.0000  5.0000  10.0000  20.0000  25.0000  30.0000
                0.0000   0.3400  0.3400  0.3400   0.5000   0.5000   0.3700   0.2500
                0.0350   0.3400  0.3400  0.3400   0.4200   0.4200   0.2200   0.1750
                0.0698   0.3200  0.3200  0.3200   0.3600   0.3600   0.1500   0.0900
                0.1047   0.3000  0.3000  0.3000   0.2900   0.2900   0.1300   0.0700
                0.1396   0.2800  0.2800  0.2800   0.2600   0.2600   0.1200   0.0600
                0.1745   0.2500  0.2500  0.2500   0.2000   0.2000   0.1100   0.0600
                0.2094   0.2200  0.2200  0.2200   0.1800   0.1800   0.1300   0.0850
                0.2443   0.1990  0.1990  0.1990   0.1750   0.1750   0.1500   0.0975
                </tableData>
            </table>
        </function>
        
        <function name="aero/coefficient/Clp">
            <description>Roll_moment_due_to_roll_rate</description>
            <product>
                <product>
                    <table> <!-- graph 5.0-12 -->
                        <independentVar lookup="row">aero/alpha-wing-rad</independentVar>
                        <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                        <tableData>
                                 0.0000  1.0000  5.0000  10.0000  20.0000  25.0000  30.0000
                       -0.0873   -0.400  -0.420  -0.435   -0.470   -0.495   -0.520   -0.530
                        0.0000   -0.400  -0.420  -0.435   -0.470   -0.495   -0.510   -0.520
                        0.0873   -0.390  -0.415  -0.440   -0.480   -0.495   -0.520   -0.530
                        0.1745   -0.370  -0.410  -0.450   -0.475   -0.495   -0.525   -0.532
                        0.2618   -0.300  -0.350  -0.415   -0.460   -0.475   -0.490   -0.500
                        0.3491   -0.180  -0.235  -0.295   -0.330   -0.350   -0.375   -0.390
                        0.4363   -0.095  -0.130  -0.160   -0.180   -0.215   -0.235   -0.272
                        </tableData>
                    </table>
                    <table> <!-- graph 5.0-13 -->
                        <independentVar lookup="row">velocities/mach</independentVar>
                        <independentVar lookup="column">atmosphere/density-altitude</independentVar>
                        <tableData>
                                  0   10000  20000  30000  40000
                        0.0     1.0     1.0    1.0    1.0    1.0
                        0.1     0.99    0.99   0.99   1.0    1.0
                        0.2     0.94    0.96   0.98   0.99   1.0
                        0.3     0.88    0.91   0.92   0.95   0.97
                        0.4     0.83    0.85   0.87   0.92   0.94
                        0.5     0.79    0.83   0.85   0.90   0.91
                        0.6     0.75    0.80   0.83   0.86   0.87
                        0.7     0.73    0.78   0.81   0.82   0.85
                        0.8     0.73    0.78   0.80   0.82   0.85
                        0.9     0.73    0.70   0.72   0.74   0.75
                        0.95    0.73    0.60   0.65   0.68   0.70  
                        </tableData>
                    </table>
                </product>
                <property>velocities/p-aero-rad_sec</property>
                <property>aero/bi2vel</property>
            </product>
        </function>
        
        <function name="aero/coefficient/Clr">
            <description>Roll_moment_due_to_yaw_rate</description>
            <product>
                <property>aero/bi2vel</property>
                <property>velocities/r-aero-rad_sec</property>
                <product>
                    <table> <!-- 5.0-14 -->
                        <independentVar lookup="row">aero/alpha-wing-rad</independentVar>
                        <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                        <tableData>
                                 0.0000  1.0000  5.0000  10.0000  20.0000  25.0000  30.0000
                       -0.0873   -0.015  -0.015  -0.008   -0.008   -0.035   -0.035    0.028
                        0.0000    0.048   0.048   0.042    0.042    0.015    0.015    0.082
                        0.0873    0.147   0.147   0.100    0.100    0.078    0.078    0.138
                        0.1745    0.237   0.237   0.160    0.160    0.130    0.130    0.195
                        0.2618    0.290   0.290   0.205    0.205    0.180    0.180    0.245
                        0.3491    0.312   0.312   0.235    0.235    0.202    0.202    0.274
                        0.4363    0.260   0.260   0.203    0.203    0.166    0.166    0.235
                        </tableData>
                    </table>
                    <property>aero/coefficient/dClraeroelastic</property>
                </product>
            </product>
        </function>
        
        <function name="aero/coefficient/dClraeroelastic">
            <description>Roll_moment_due_to_yaw_rate_aeroelastic</description>
            <table> <!-- graph 5.0-15 -->
                <independentVar lookup="row">velocities/mach</independentVar>
                <independentVar lookup="column">atmosphere/density-altitude</independentVar>
                <tableData>
                          0   10000  20000  25000   30000  40000
                0.0     1.0     1.0    1.0    1.0     1.0    1.0
                0.1     1.0     1.0    1.0    1.0     1.0    1.0
                0.2    0.98    0.99    1.0   1.01     1.01   1.02
                0.3    0.92    0.96   0.99   1.02     1.03   1.04
                0.4    0.86    0.90   0.96   1.03     1.06   1.07
                0.5    0.78    0.86   0.98   1.01     1.07   1.10
                0.6    0.72    0.84    1.0   1.04     1.10   1.14
                0.7    0.70    0.85   1.04   1.14     1.20   1.26
                0.8    0.70    0.90   1.16   1.33     1.57   1.70
                0.9    0.70    0.40   0.50   0.70      1.0   1.50
                0.95   0.70    0.10   0.15   0.20     0.38   0.72
                </tableData>
            </table>
        </function>
        
        <!-- for panels 8 or 12 (individual) - reverse sign for 1 and 5 -->
        <function name="aero/coefficient/dClsp1">
            <description>Roll_moment_due_to_spoiler_deflection</description>
            <table> <!-- graph 5.0-17 -->
                <independentVar lookup="row">aero/alpha-wing-rad</independentVar>
                <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                <tableData>
                         0.0000  30.0000
               -0.0870   0.0040   0.0065
                0.0000   0.0040   0.0070
                0.1750   0.0040   0.0080
                0.4360  -0.0005   0.0050
                </tableData>
            </table>
        </function>
        
        <!-- for panels 9, 10 and 11 - reverse sign for 2, 3 and 4 -->
        <function name="aero/coefficient/dClsp2">
            <description>Roll_moment_due_to_spoiler_deflection</description>
            <product>
                <table> <!-- graph 5.0-17 -->
                    <independentVar lookup="row">aero/alpha-wing-rad</independentVar>
                    <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                    <tableData>
                             0.0000  30.0000
                   -0.0870   0.0070   0.0175
                    0.0000   0.0115   0.0240
                    0.1750   0.0121   0.0325
                    0.4360   0.0005   0.0221
                    </tableData>
                </table>
                <value>0.33</value> <!-- values in table are for the complete group of 3 panels -->
            </product>
        </function>
        
        <function name="aero/coefficient/dClsp[0]">
            <description>Rolling_moment_coefficient_due_to_spoiler_1_deflection</description>
            <product>
                <value>-1</value>
                <property>aero/coefficient/dClsp1</property>
                <property>fcs/spoiler[0]/pos-deg</property>
                <value>0.0222</value> <!-- per 45 deg -->
                <property>aero/coefficient/ClspM</property>
                <property>aero/coefficient/FClspGE</property>
            </product>
        </function>
        
        <function name="aero/coefficient/dClsp[1]">
            <description>Rolling_moment_coefficient_due_to_spoiler_2_deflection</description>
            <product>
                <value>-1</value>
                <property>aero/coefficient/dClsp2</property>
                <property>fcs/spoiler[1]/pos-deg</property>
                <value>0.0222</value> <!-- per 45 deg -->
                <property>aero/coefficient/ClspM</property>
                <property>aero/coefficient/FClspGE</property>
            </product>
        </function>
        
        <function name="aero/coefficient/dClsp[2]">
            <description>Rolling_moment_coefficient_due_to_spoiler_3_deflection</description>
            <product>
                <value>-1</value>
                <property>aero/coefficient/dClsp2</property>
                <property>fcs/spoiler[2]/pos-deg</property>
                <value>0.0222</value> <!-- per 45 deg -->
                <property>aero/coefficient/ClspM</property>
                <property>aero/coefficient/FClspGE</property>
            </product>
        </function>
        
        <function name="aero/coefficient/dClsp[3]">
            <description>Rolling_moment_coefficient_due_to_spoiler_4_deflection</description>
            <product>
                <value>-1</value>
                <property>aero/coefficient/dClsp2</property>
                <property>fcs/spoiler[3]/pos-deg</property>
                <value>0.0222</value> <!-- per 45 deg -->
                <property>aero/coefficient/ClspM</property>
                <property>aero/coefficient/FClspGE</property>
            </product>
        </function>
        
        <function name="aero/coefficient/dClsp[4]">
            <description>Rolling_moment_coefficient_due_to_spoiler_5_deflection</description>
            <product>
                <value>-1</value>
                <property>aero/coefficient/dClsp1</property>
                <property>fcs/spoiler[4]/pos-deg</property>
                <value>0.0222</value> <!-- per 45 deg -->
                <property>aero/coefficient/ClspM</property>
                <property>aero/coefficient/FClspGE</property>
            </product>
        </function>
        
        <function name="aero/coefficient/dClsp[7]">
            <description>Rolling_moment_coefficient_due_to_spoiler_8_deflection</description>
            <product>
                <property>aero/coefficient/dClsp1</property>
                <property>fcs/spoiler[7]/pos-deg</property>
                <value>0.0222</value> <!-- per 45 deg -->
                <property>aero/coefficient/ClspM</property>
                <property>aero/coefficient/FClspGE</property>
            </product>
        </function>
        
        <function name="aero/coefficient/dClsp[8]">
            <description>Rolling_moment_coefficient_due_to_spoiler_9_deflection</description>
            <product>
                <property>aero/coefficient/dClsp2</property>
                <property>fcs/spoiler[8]/pos-deg</property>
                <value>0.0222</value> <!-- per 45 deg -->
                <property>aero/coefficient/ClspM</property>
                <property>aero/coefficient/FClspGE</property>
            </product>
        </function>
        
        <function name="aero/coefficient/dClsp[9]">
            <description>Rolling_moment_coefficient_due_to_spoiler_10_deflection</description>
            <product>
                <property>aero/coefficient/dClsp2</property>
                <property>fcs/spoiler[9]/pos-deg</property>
                <value>0.0222</value> <!-- per 45 deg -->
                <property>aero/coefficient/ClspM</property>
                <property>aero/coefficient/FClspGE</property>
            </product>
        </function>
        
        <function name="aero/coefficient/dClsp[10]">
            <description>Rolling_moment_coefficient_due_to_spoiler_11_deflection</description>
            <product>
                <property>aero/coefficient/dClsp2</property>
                <property>fcs/spoiler[10]/pos-deg</property>
                <value>0.0222</value> <!-- per 45 deg -->
                <property>aero/coefficient/ClspM</property>
                <property>aero/coefficient/FClspGE</property>
            </product>
        </function>
        
        <function name="aero/coefficient/dClsp[11]">
            <description>Rolling_moment_coefficient_due_to_spoiler_12_deflection</description>
            <product>
                <property>aero/coefficient/dClsp1</property>
                <property>fcs/spoiler[11]/pos-deg</property>
                <value>0.0222</value> <!-- per 45 deg -->
                <property>aero/coefficient/ClspM</property>
                <property>aero/coefficient/FClspGE</property>
            </product>
        </function>
        
        <function name="aero/coefficient/ClspM">
            <description>Rolling_moment_coefficient_due_to_mach_spoilers</description>
            <table> <!-- graph 5.0-18 -->
                <independentVar lookup="row">velocities/mach</independentVar>
                <independentVar lookup="column">aero/alpha-wing-deg</independentVar>
                <tableData>
                          0     2      4      6     8  
                0.0       1.0   1.0    1.0    1.0   1.0
                0.1       1.0   1.0    1.0    1.0   1.0
                0.2       1.0   1.0    1.0    1.0   1.0
                0.3       1.0   1.0    1.0    1.0   1.0
                0.4       1.02  1.02   1.02   1.02  1.02   
                0.5       1.04  1.04   1.04   1.04  1.04   
                0.6       1.09  1.09   1.09   1.09  1.09
                0.7       1.17  1.17   1.17   1.17  1.17
                0.8       1.29  1.29   1.29   1.29  1.29
                0.9       1.60  1.60   1.54   0.90  0.10
                0.95      1.70  1.20   0.80   0.38  0.20
                </tableData>
            </table>
        </function>
        
        <function name="aero/coefficient/dClspoilers">
            <description>Rolling_moment_coefficient_due_to_spoiler_deflection</description>
            <sum>
                <property>aero/coefficient/dClsp[0]</property>
                <property>aero/coefficient/dClsp[1]</property>
                <property>aero/coefficient/dClsp[2]</property>
                <property>aero/coefficient/dClsp[3]</property>
                <property>aero/coefficient/dClsp[4]</property>
                <property>aero/coefficient/dClsp[7]</property>
                <property>aero/coefficient/dClsp[8]</property>
                <property>aero/coefficient/dClsp[9]</property>
                <property>aero/coefficient/dClsp[10]</property>
                <property>aero/coefficient/dClsp[11]</property>
            </sum>
        </function>
        
        <function name="aero/coefficient/FClspGE">
            <description>Roll_moment_due_to_spoilers_groundeffect_function</description>
            <sum>
                <value>1</value>
                <product>
                    <property>aero/coefficient/FspoilersGE</property>
                    <property>aero/function/Kge</property>
                </product>
            </sum>
        </function>
        
        <function name="aero/coefficient/FspoilersGE">
            <description>Roll_moment_due_to_spoilers_groundeffect</description>
            <table> <!-- graph 5.0-29 -->
                <independentVar lookup="row">aero/alpha-wing-rad</independentVar>
                <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                <tableData>
                         0.0000  1.0000  5.0000  10.0000  20.0000  25.0000  30.0000
                0.0000   0.18    0.18    0.16     0.14      0.06    0.00    -0.04
                0.0350   0.16    0.16    0.14     0.12      0.05   -0.03    -0.07
                0.0698   0.14    0.14    0.12     0.09      0.04   -0.05    -0.11
                0.1047   0.12    0.12    0.09     0.07      0.02   -0.08    -0.15
                0.1396   0.10    0.10    0.07     0.04     -0.02   -0.11    -0.18
                0.1745   0.07    0.07    0.05     0.01     -0.06   -0.15    -0.25
                0.2094   0.04    0.04    0.00    -0.04     -0.10   -0.20    -0.29
                0.2443   0.00    0.00   -0.04    -0.08     -0.17   -0.27    -0.35
                </tableData>
            </table>
        </function>
        
        <function name="aero/coefficient/dClinboardailerons">
            <description>Roll_moment_due_to_inboard_ailerons</description>
            <product>
                <value>2</value>
                <property>aero/function/KdAI</property>
                <property>aero/coefficient/Clinboardeffect</property>
                <property>aero/coefficient/dClinboardaeroelastic</property>
                <property>aero/coefficient/dCl_rera_inboard_aeroelastic</property>
                <property>aero/coefficient/FClspGE</property>
            </product>
        </function>
        
        <function name="aero/function/KdAI">
            <description>Inboard_aileron_effectiveness_factor</description>
            <table> <!-- graph 5.0-22 -->
                <independentVar lookup="row">fcs/aileron[1]/pos-deg</independentVar>
                <tableData>
                -20 -1.00
                -15 -0.80
                -10 -0.60
                 -5 -0.26
                  0  0.00
                  5  0.26
                 10  0.60
                 15  0.80
                 20  1.00
                </tableData>
            </table>
        </function>
        
        <function name="aero/coefficient/Clinboardeffect">
            <description>Rolling moment coefficient effect of inboard aileron</description>
            <table> <!-- graph 5.0-23 -->
                <independentVar lookup="row">aero/alpha-wing-rad</independentVar>
                <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                <tableData>
                             0.0000  1.0000   5.0000  10.0000 20.0000  25.0000  30.0000
                   -0.0873   0.0039  0.0039   0.0036   0.0036  0.0035   0.0038   0.0038
                    0.0000   0.0042  0.0042   0.0038   0.0038  0.0037   0.0038   0.0038
                    0.0873   0.0041  0.0041   0.0037   0.0037  0.0036   0.0038   0.0038
                    0.1745   0.0036  0.0036   0.0034   0.0034  0.0034   0.0037   0.0037
                    0.2618   0.0020  0.0020   0.0027   0.0027  0.0031   0.0035   0.0035
                    0.3491   0.0002  0.0002   0.0012   0.0012  0.0027   0.0021   0.0021
                    0.4363  -0.0009 -0.0009  -0.0002  -0.0002  0.0002   0.0004   0.0004
                </tableData>
            </table>
        </function>
        
        <function name="aero/coefficient/dClinboardaeroelastic">
            <description>Rolling_moment_coefficient_due_to_mach_inboard</description>
            <table> <!-- graph 5.0-24 -->
                <independentVar lookup="row">velocities/mach</independentVar>
                <tableData>  
                    0.00 1.000
                    0.70 1.000
                    0.80 1.050
                    0.90 1.150
                    0.95 0.900
                    0.97 0.715
                </tableData>
            </table>
        </function>
        
        <function name="aero/coefficient/dCl_rera_inboard_aeroelastic">
            <description>Rolling moment coefficient aeroelastic effect on rolling moment coefficient due to inboard ailerons</description>
            <table> <!-- graph 5.0-25 -->
                <independentVar lookup="row">velocities/mach</independentVar>
                <independentVar lookup="column">atmosphere/density-altitude</independentVar>
                <tableData>
                         0.00 10000.00 20000.00 30000.00 40000.00
                0.00     1.00     1.00     1.00     1.00     1.00
                0.15     1.00     1.00     1.00     1.00     1.00
                0.80     0.50     0.59     0.68     0.76     0.83
                0.90     0.48     0.39     0.51     0.63     0.74
                </tableData>
            </table>
        </function>
        
        <function name="aero/coefficient/dCloutboardailerons">
            <description>Roll_moment_due_to_outboard_ailerons</description>
            <product>
                <sum>
                    <!-- graph 5.0-26 is incorporated through the breakpoints -->
                    <table> <!-- graph 5.0-27 -->
                        <independentVar lookup="row">aero/alpha-wing-deg</independentVar>
                        <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                        <independentVar lookup="table">fcs/aileron[0]/pos-rad</independentVar> 
                        <tableData breakPoint="-0.4363">
                                    0.000 30.000
                             0.000  0.015  0.015
                            25.000  0.015  0.015
                        </tableData>
                        <tableData breakPoint="0">
                                  0.0 30.0
                             0.0  0.0  0.0
                            25.0  0.0  0.0
                        </tableData>
                        <tableData breakPoint="0.2618">
                                    0.000 30.000
                             0.000 -0.008 -0.008
                            25.000 -0.008 -0.008
                        </tableData>
                    </table>
                    <table> <!-- graph 5.0-27 -->
                        <independentVar lookup="row">aero/alpha-wing-deg</independentVar>
                        <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                        <independentVar lookup="table">fcs/aileron[3]/pos-rad</independentVar> 
                        <tableData breakPoint="-0.4363">
                                    0.000 30.000
                             0.000 -0.015 -0.015
                            25.000 -0.015 -0.015
                        </tableData>
                        <tableData breakPoint="0">
                                  0.0 30.0
                             0.0  0.0  0.0
                            25.0  0.0  0.0
                        </tableData>
                        <tableData breakPoint="0.2618">
                                    0.000 30.000
                             0.000  0.008  0.008
                            25.000  0.008  0.008
                        </tableData>
                    </table>
                </sum>
                <property>aero/coefficient/FClspGE</property>
            </product>
        </function>
        
        <!-- rudder needs to be split in upper and lower -->
        <function name="aero/coefficient/dClRu">
            <description>Rolling_moment_coefficient_due_to_full_deflection_of_the_upper_rudder</description>
            <table>
                <independentVar>aero/alpha-wing-rad</independentVar>
                <tableData>
                 -0.0872   0.0105
                  0.0000   0.0075
                  0.2618  -0.0010
                  0.4363  -0.0020
                </tableData>
            </table>
        </function>
        <function name="aero/coefficient/dClRl">
            <description>Rolling_moment_coefficient_due_to_full_deflection_of_the_lower_rudder</description>
            <table>
                <independentVar>aero/alpha-wing-rad</independentVar>
                <tableData>
                 -0.0872   0.0045
                  0.0000   0.0035
                  0.2618  -0.0035
                  0.4363  -0.0050
                </tableData>
            </table>
        </function>
        
        <function name="aero/function/kRu">
            <description>Upper_rudder_effectiveness_factor</description>
            <product>
                <property>fcs/rudder-pos-rad</property>
                <value>2.294</value>
            </product>
        </function>
        
        <function name="aero/function/kRl">
            <description>Lower_rudder_effectiveness_factor</description>
            <product>
                <property>fcs/rudder-pos-rad</property>
                <value>2.294</value>
            </product>
        </function>
        
        <function name="aero/coefficient/dClRu_aeroelastic">
            <description>Upper_rudder_aeroelastic_effect</description>
            <table>
                <independentVar lookup="row">atmosphere/density-altitude</independentVar>
                <independentVar lookup="column">velocities/mach</independentVar>
                <tableData>
                            0.00   0.50   0.80   1.00
                        0   1.00   0.62   0.12   0.00
                    40000   1.00   0.91   0.72   0.00
                </tableData>
            </table>
        </function>
        
        <function name="aero/coefficient/dClRl_aeroelastic">
            <description>Lower_rudder_aeroelastic_effect</description>
            <table>
                <independentVar lookup="row">atmosphere/density-altitude</independentVar>
                <independentVar lookup="column">velocities/mach</independentVar>
                <tableData>
                            0.00   0.10   0.50   0.80   1.00
                        0   1.00   1.00   0.72   0.22   0.03
                    40000   1.00   1.00   0.87   0.35   0.03
                </tableData>
            </table>
        </function>
            
        <function name="aero/coefficient/Cl">
            <description>Total_rolling_moment_coefficient</description>
            <sum>
                <property>aero/coefficient/Clb</property>
                <property>aero/coefficient/Clp</property>
                <property>aero/coefficient/Clr</property>
                <property>aero/coefficient/dClspoilers</property>
                <property>aero/coefficient/dClinboardailerons</property>
                <property>aero/coefficient/dCloutboardailerons</property>
                <product>
                    <property>aero/function/kRu</property>
                    <property>aero/coefficient/dClRu</property>
                    <property>aero/coefficient/dClRu_aeroelastic</property>
                </product>
                <product>
                    <property>aero/function/kRl</property>
                    <property>aero/coefficient/dClRl</property>
                    <property>aero/coefficient/dClRl_aeroelastic</property>
                </product>
            </sum>
        </function>
        
        <axis name="ROLL">
        
            <function name="my_roll">
                <description>Roll_moment</description>
                <product>
                    <property>aero/qbar-psf</property>
                    <property>metrics/Sw-sqft</property>
                    <property>metrics/bw-ft</property>
                    <property>aero/coefficient/Cl</property>
                </product>
            </function>    
            
        </axis>
        
        <!-- PITCH -->
        <function name="aero/coefficient/Cmalpha">
            <description>Basic pitching moment coefficient</description>
            <table> <!-- graphs 4.0-8 and 4.0-9 -->
                <independentVar lookup="row">aero/alpha-wing-deg</independentVar>
                <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                <tableData>
                            0.000  1.000  5.000 10.000 20.000 25.000 30.000
                    -5.000  0.269  0.230  0.263  0.278  0.194  0.147  0.116
                    -4.000  0.244  0.206  0.236  0.251  0.167  0.123  0.089
                    -3.000  0.218  0.182  0.208  0.223  0.140  0.100  0.062
                    -2.000  0.193  0.157  0.181  0.196  0.113  0.077  0.035
                    -1.000  0.168  0.133  0.153  0.168  0.086  0.054  0.008
                     0.000  0.143  0.109  0.126  0.140  0.060  0.030 -0.021
                     1.000  0.117  0.084  0.098  0.112  0.033  0.007 -0.050
                     2.000  0.092  0.060  0.071  0.085  0.007 -0.017 -0.080
                     3.000  0.067  0.035  0.044  0.058 -0.020 -0.041 -0.110
                     4.000  0.041  0.010  0.016  0.030 -0.047 -0.066 -0.140
                     5.000  0.016 -0.015 -0.012  0.003 -0.074 -0.092 -0.171
                     6.000 -0.010 -0.040 -0.040 -0.025 -0.101 -0.119 -0.203
                     7.000 -0.037 -0.064 -0.069 -0.054 -0.129 -0.146 -0.238
                     8.000 -0.063 -0.087 -0.097 -0.083 -0.157 -0.173 -0.273
                     9.000 -0.086 -0.109 -0.125 -0.111 -0.184 -0.200 -0.306
                    10.000 -0.099 -0.128 -0.153 -0.140 -0.211 -0.228 -0.337
                    11.000 -0.109 -0.145 -0.179 -0.169 -0.237 -0.257 -0.366
                    12.000 -0.117 -0.157 -0.203 -0.199 -0.262 -0.285 -0.391
                    13.000 -0.125 -0.169 -0.227 -0.233 -0.286 -0.311 -0.413
                    14.000 -0.132 -0.181 -0.249 -0.269 -0.309 -0.335 -0.431
                    15.000 -0.139 -0.196 -0.271 -0.287 -0.331 -0.358 -0.446
                    16.000 -0.146 -0.215 -0.289 -0.295 -0.354 -0.379 -0.457
                    17.000 -0.158 -0.237 -0.300 -0.301 -0.364 -0.390 -0.458
                    18.000 -0.191 -0.263 -0.309 -0.305 -0.355 -0.345 -0.429
                    19.000 -0.241 -0.291 -0.320 -0.311 -0.328 -0.313 -0.380
                    20.000 -0.291 -0.323 -0.362 -0.317 -0.303 -0.309 -0.360
                    21.000 -0.340 -0.358 -0.438 -0.337 -0.311 -0.341 -0.378
                    22.000 -0.389 -0.396 -0.531 -0.389 -0.363 -0.409 -0.483
                    23.000 -0.439 -0.437 -0.632 -0.467 -0.466 -0.512 -0.639
                    24.000 -0.489 -0.479 -0.738 -0.557 -0.574 -0.629 -0.815
                    25.000 -0.538 -0.522 -0.850 -0.649 -0.672 -0.758 -0.983
                </tableData>
            </table>
            <!-- TODO: graph 4.0-10 -->
        </function>

        <function name="aero/coefficient/dCm_aeroelasticity">
            <description>Change_in_basic_pitching_moment_due_to_aeroelasticity</description>
            <sum>
                <product>
                    <table>
                        <independentVar>fcs/flaps/pos-deg</independentVar>
                        <tableData>
                             0  0
                             1  1
                            30  1
                        </tableData>
                    </table>
                    <table> <!-- graph 4.0-11 -->
                        <independentVar lookup="row">velocities/ve-kts</independentVar>
                        <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                        <tableData>
                                   1.000  5.000 10.000 20.000 25.000 30.000
                            0.000  0.000  0.000  0.000  0.000  0.000  0.000
                           50.000 -0.002 -0.002 -0.002 -0.002 -0.002 -0.002
                          100.000 -0.004 -0.005 -0.003 -0.001  0.000  0.000
                          250.000 -0.007 -0.009 -0.002  0.014  0.026  0.026
                        </tableData>
                    </table>
                </product>
                <product>
                    <table>
                        <independentVar>fcs/flaps/pos-deg</independentVar>
                        <tableData>
                             0  1
                             1  0
                            30  0
                        </tableData>
                    </table>
                    <table> <!-- graph 4.0-12 -->
                        <independentVar lookup="row">velocities/mach</independentVar>
                        <independentVar lookup="column">atmosphere/density-altitude</independentVar>
                        <tableData>
                                     0.0000 10000.0000 40000.0000
                          0.0000     0.0000     0.0000     0.0000
                          0.4000    -0.0095    -0.0065    -0.0015
                          0.8150    -0.0235    -0.0175    -0.0045
                          0.8750    -0.0235    -0.0160    -0.0040
                          0.9000    -0.0235    -0.0190    -0.0050
                          0.9700    -0.0235    -0.0675    -0.0265
                        </tableData>
                    </table>
                </product>
            </sum>
        </function>
        
        <function name="aero/coefficient/dCm_alphaae">
            <description>Change_in_basic_pitching_moment_coefficient_due_to_aeroelastic_effect_on_the_rigid_airplane_basic_pitching_moment_coefficient_curve_slope</description>
            <product>
                <sum>
                    <product>
                        <table>
                            <independentVar>fcs/flaps/pos-deg</independentVar>
                            <tableData>
                                 0  0
                                 1  1
                                30  1
                            </tableData>
                        </table>
                        <table> <!-- graph 4.0-13 -->
                            <independentVar lookup="row">velocities/ve-kts</independentVar>
                            <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                            <tableData>
                                        1.0000 10.0000 30.0000
                                0.0000  0.0000  0.0000  0.0000
                               50.0000  0.0007  0.0007  0.0007
                              100.0000  0.0020  0.0024  0.0024
                              250.0000  0.0074  0.0088  0.0088
                            </tableData>
                        </table>
                    </product>
                    <product>
                        <table>
                            <independentVar>fcs/flaps/pos-deg</independentVar>
                            <tableData>
                                 0  1
                                 1  0
                                30  0
                            </tableData>
                        </table>
                        <table> <!-- graph 4.0-14 -->
                            <independentVar lookup="row">velocities/mach</independentVar>
                            <independentVar lookup="column">atmosphere/density-altitude</independentVar>
                            <tableData>
                                         0.0000 10000.0000 40000.0000
                              0.0000     0.0000     0.0000     0.0000
                              0.2000     0.0024     0.0016     0.0004
                              0.4000     0.0068     0.0050     0.0016
                              0.6000     0.0125     0.0100     0.0034
                              0.7000     0.0161     0.0130     0.0049
                              0.8150     0.0223     0.0182     0.0076
                              0.8700     0.0223     0.0218     0.0096
                              0.9000     0.0223     0.0207     0.0087
                              0.9200     0.0223     0.0194     0.0082
                              0.9700     0.0223     0.0288     0.0150
                            </tableData>
                        </table>
                    </product>
                </sum>
                <property>aero/alpha-wing-deg</property>
            </product>
        </function>
        
        <function name="aero/coefficient/dCmrateaoa">
            <description>Change_in_basic_pitching_coefficient_due_to_rate_of_change_angle_of_attack</description>
            <product>
                <table> <!-- graph 4.0-15 -->
                    <independentVar>aero/CoG-mac-pct</independentVar>
                    <tableData>
                        10.00   1.18
                        40.00   0.82
                    </tableData>
                </table>
                <table> <!-- graph 4.0-15 -->
                    <independentVar lookup="row">velocities/mach</independentVar>
                    <independentVar lookup="column">atmosphere/density-altitude</independentVar>
                    <tableData>
                                 0.00 20000.00 40000.00
                        0.00    -3.40    -3.40    -3.40
                        0.50    -3.00    -3.50    -4.00
                        0.70    -3.30    -4.30    -4.90
                        0.75    -3.50    -4.80    -5.60
                        0.80    -4.00    -5.50    -6.60
                        0.85    -4.10    -5.90    -7.40
                        0.90    -4.70    -6.90    -8.80
                        0.92    -3.50    -6.30    -8.20
                        0.95    -3.00    -4.60    -6.00
                        0.97    -3.10    -4.70    -6.10
                    </tableData>
                </table>
                <property>aero/alphadot-rad_sec</property>
                <property>aero/ci2vel</property>
            </product>
        </function>
        
        <function name="aero/coefficient/Cmq">
            <description>Change_in_basic_pitching_coefficient_due_to_pitch_rate</description>
            <product>
                <property>aero/ci2vel</property>
                <property>velocities/q-aero-rad_sec</property>
                <table> <!-- graph 4.0-16 -->
                    <independentVar lookup="row">velocities/mach</independentVar>
                    <independentVar lookup="column">atmosphere/density-altitude</independentVar>
                    <tableData>
                                 0.00 20000.00 40000.00
                        0.00   -22.60   -22.60   -22.60
                        0.10   -22.30   -22.60   -22.60
                        0.30   -20.30   -21.90   -22.60
                        0.60   -17.70   -20.30   -22.60
                        0.70   -16.90   -20.30   -22.90
                        0.80   -16.10   -20.50   -24.00
                        0.85   -15.50   -20.60   -25.00
                        0.90   -14.50   -20.40   -25.20
                        0.97   -12.30   -17.30   -21.40
                    </tableData>
                </table>
            </product>
        </function>
        
        <function name="aero/coefficient/dCmdnz">
            <description>Change_in_basic_pitching_moment_oefficient_due_to_aeroelastic_inertia_relief_caused_by_normal_load_factor</description>
            <product>
                <sum>
                    <product>
                        <table>
                            <independentVar>fcs/flaps/pos-deg</independentVar>
                            <tableData>
                                 0  0
                                 1  1
                                30  1
                            </tableData>
                        </table>
                        <table> <!-- graph 4.0-17 -->
                            <independentVar lookup="row">velocities/ve-kts</independentVar>
                            <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                            <tableData>
                                        1.0000  5.0000 10.0000 20.0000 25.0000 30.0000
                                0.0000 -0.0275 -0.0275 -0.0275 -0.0278 -0.0278 -0.0282
                              100.0000 -0.0266 -0.0266 -0.0266 -0.0269 -0.0269 -0.0272
                              250.0000 -0.0240 -0.0240 -0.0240 -0.0243 -0.0243 -0.0246
                            </tableData>
                        </table>
                    </product>
                    <product>
                        <table>
                            <independentVar>fcs/flaps/pos-deg</independentVar>
                            <tableData>
                                 0  1
                                 1  0
                                30  0
                            </tableData>
                        </table>
                        <table> <!-- graph 4.0-18 -->
                            <independentVar lookup="row">atmosphere/density-altitude</independentVar>
                            <independentVar lookup="column">velocities/mach</independentVar>
                            <tableData>
                                            0.0000  0.3000  0.5000  0.8150  0.8750  0.9000  0.9700
                                    0.0000 -0.0245 -0.0224 -0.0205 -0.0166 -0.0166 -0.0166 -0.0166
                                10000.0000 -0.0245 -0.0230 -0.0218 -0.0194 -0.0185 -0.0177 -0.0150
                                30000.0000 -0.0245 -0.0240 -0.0237 -0.0241 -0.0240 -0.0234 -0.0210
                                40000.0000 -0.0245 -0.0242 -0.0243 -0.0260 -0.0262 -0.0257 -0.0226
                            </tableData>
                        </table>
                    </product>
                </sum>
                <property>accelerations/Nz</property> <!-- or forces/load-factor ?? -->
            </product>
        </function>
        
        <function name="aero/coefficient/Cmde_inboard">
            <description>Pitch_moment_due_to_inboard_elevator</description>
            <product>
                <todegrees><property>fcs/elevator[1]/pos-rad</property></todegrees>
                <property>aero/function/k_stab</property>
                <table> <!-- graph 4.0-21 -->
                    <independentVar lookup="row">atmosphere/density-altitude</independentVar>
                    <independentVar lookup="column">velocities/mach</independentVar>
                    <tableData>
                                    0.0000  0.3000  0.5000  0.7000  0.8000  0.8500  0.9000  0.9700
                            0.0000 -0.0129 -0.0110 -0.0088 -0.0069 -0.0066 -0.0066 -0.0066 -0.0066
                        10000.0000 -0.0129 -0.0119 -0.0109 -0.0096 -0.0093 -0.0092 -0.0082 -0.0060
                        20000.0000 -0.0129 -0.0127 -0.0123 -0.0116 -0.0113 -0.0110 -0.0100 -0.0070
                        30000.0000 -0.0129 -0.0132 -0.0133 -0.0130 -0.0128 -0.0124 -0.0114 -0.0081
                        40000.0000 -0.0129 -0.0135 -0.0140 -0.0140 -0.0136 -0.0133 -0.0123 -0.0089
                    </tableData>
                </table>
            </product>
        </function>
        
        <function name="aero/coefficient/Cmde_outboard">
            <description>Pitch_moment_due_to_outboard_elevator</description>
            <product>
                <todegrees><property>fcs/elevator[0]/pos-rad</property></todegrees>
                <property>aero/function/k_stab</property>
                <table> <!-- graph 4.0-22 -->
                    <independentVar lookup="row">atmosphere/density-altitude</independentVar>
                    <independentVar lookup="column">velocities/mach</independentVar>
                    <tableData>
                                    0.0000  0.5000  0.6500  0.8000  0.9700
                            0.0000 -0.0150 -0.0076 -0.0052 -0.0024 -0.0020
                        10000.0000 -0.0150 -0.0101 -0.0080 -0.0048  0.0009
                        30000.0000 -0.0150 -0.0140 -0.0128 -0.0098 -0.0044
                        40000.0000 -0.0150 -0.0152 -0.0143 -0.0116 -0.0062
                    </tableData>
                </table>
            </product>
        </function>
        
        <function name="aero/coefficient/dCm_stabilizer">
            <description>Change_in_basic_pitching_moment_due_to_change_in_stabilizer_angle</description>
            <product>
                <property>fcs/stabilizer/pos-deg</property>
                <table> <!-- graph 4.0-20 -->
                    <independentVar lookup="row">atmosphere/density-altitude</independentVar>
                    <independentVar lookup="column">velocities/mach</independentVar>
                    <tableData>
                                    0.0000  0.4000  0.6000  0.8150  0.8500  0.9000  0.9700
                            0.0000 -0.0530 -0.0480 -0.0435 -0.0360 -0.0360 -0.0360 -0.0360
                        10000.0000 -0.0530 -0.0485 -0.0460 -0.0430 -0.0425 -0.0410 -0.0345
                        20000.0000 -0.0530 -0.0495 -0.0485 -0.0495 -0.0500 -0.0490 -0.0435
                        30000.0000 -0.0530 -0.0505 -0.0505 -0.0540 -0.0550 -0.0540 -0.0475
                        40000.0000 -0.0530 -0.0520 -0.0520 -0.0560 -0.0570 -0.0560 -0.0505
                    </tableData>
                </table>
                <table> <!-- graph 4.0-19 -->
                    <independentVar lookup="row">aero/alpha-wing-deg</independentVar>
                    <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                    <tableData>
                                 0.000  1.000  5.000 10.000 20.000 25.000 30.000
                          0.000  1.000  1.000  1.000  1.000  1.000  1.000  1.000
                         15.000  1.000  1.000  1.000  1.000  1.000  1.000  1.000
                         17.000  1.000  0.990  1.000  0.975  0.970  0.955  0.965
                         18.000  1.000  0.975  1.000  0.945  0.940  0.865  0.930
                         20.000  0.995  0.930  0.985  0.865  0.860  0.720  0.825
                         22.000  0.975  0.860  0.960  0.795  0.800  0.695  0.720
                         23.000  0.960  0.825  0.930  0.770  0.795  0.695  0.710
                         25.000  0.925  0.780  0.865  0.740  0.795  0.695  0.770
                    </tableData>
                </table>
            </product>
        </function>
        
        <function name="aero/coefficient/dCmgear">
            <description>Pitching_moment_due_to_landing_gear</description>
            <product>
                <property>aero/function/Kgear</property>
                <table> <!-- graph 4.0-33 -->
                    <independentVar lookup="row">aero/alpha-wing-deg</independentVar>
                    <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                    <tableData>
                                 0.000  1.000  5.000 10.000 20.000 25.000 30.000
                         -5.000  0.010  0.010  0.005  0.002 -0.003 -0.016 -0.016
                          0.000  0.009  0.009  0.004 -0.002 -0.006 -0.014 -0.014
                          5.000  0.007  0.007  0.002 -0.003 -0.007 -0.012 -0.012
                         10.000  0.005  0.005 -0.001 -0.007 -0.010 -0.014 -0.014
                         15.000  0.001  0.001 -0.006 -0.011 -0.013 -0.019 -0.019
                         20.000 -0.001 -0.001 -0.005 -0.011 -0.014 -0.041 -0.041
                         22.500  0.008  0.008  0.004 -0.010 -0.014 -0.066 -0.066
                         25.000  0.023  0.023  0.018 -0.008 -0.014 -0.030 -0.030
                    </tableData>
                </table>
                <table> <!-- graph 4.0-34 -->
                    <independentVar>velocities/mach</independentVar>
                    <tableData>
                        0.00 1.00
                        0.35 1.00
                        0.50 1.20
                        0.70 1.80
                        0.82 2.50
                    </tableData>
                </table>
            </product>
        </function>
        
        <function name="aero/coefficient/dCmge">
            <description>Pitching_moment_due_to_ground_effect</description>
            <product>
                <property>aero/function/Kge</property>
                <table> <!-- graph 19.0-9 (revised from 4.0-35) -->
                    <independentVar lookup="row">aero/alpha-wing-deg</independentVar>
                    <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                    <tableData>
                                0.000  1.000  5.000 10.000 20.000 25.000 30.000
                         0.000  0.026  0.026  0.004 -0.008 -0.032 -0.055 -0.066
                         2.000  0.020  0.020 -0.002 -0.014 -0.039 -0.067 -0.083
                         5.000  0.000  0.000 -0.024 -0.033 -0.058 -0.088 -0.100
                         8.000 -0.028 -0.028 -0.050 -0.060 -0.082 -0.109 -0.103
                        10.000 -0.045 -0.045 -0.068 -0.078 -0.100 -0.124 -0.112
                        12.000 -0.068 -0.068 -0.090 -0.104 -0.118 -0.134 -0.122
                        13.000 -0.083 -0.083 -0.105 -0.119 -0.125 -0.135 -0.118
                        14.500 -0.108 -0.108 -0.136 -0.149 -0.134 -0.126 -0.102
                    </tableData>
                </table>
            </product>
        </function>
        
        <function name="aero/coefficient/dCmsideslip">
            <description>Pitching_moment_coefficient_effect_of_sideslip</description>
            <table> <!-- graph 4.0-36 -->
                <independentVar lookup="row">aero/beta-deg</independentVar>
                <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                <tableData>
                            0.000 10.000 20.000 25.000 30.000
                   -15.000 -0.144 -0.144 -0.130 -0.082 -0.050
                   -10.000 -0.068 -0.068 -0.060 -0.044 -0.033
                    -5.000 -0.016 -0.016 -0.014 -0.014 -0.012
                     0.000  0.000  0.000  0.000  0.000  0.000
                     5.000 -0.016 -0.016 -0.014 -0.014 -0.012
                    10.000 -0.068 -0.068 -0.060 -0.044 -0.033
                    15.000 -0.144 -0.144 -0.130 -0.082 -0.050
                </tableData>
            </table>
        </function>
        
        <function name="aero/coefficient/Cm">
            <description>Total_pitching_moment_coefficient</description>
            <sum>
                <property>aero/coefficient/Cmalpha</property>
                <property>aero/coefficient/dCm_aeroelasticity</property>
                <property>aero/coefficient/dCm_alphaae</property>
                <product>
                    <property>aero/coefficient/CL_total</property>
                    <sum>
                        <property>aero/CoG-mac-pct</property>
                        <value>-25</value>
                    </sum>
                    <value>0.01</value>
                </product>
                <property>aero/coefficient/dCmrateaoa</property>
                <property>aero/coefficient/Cmq</property>
                <property>aero/coefficient/dCmdnz</property>
                <property>aero/coefficient/dCm_stabilizer</property>
                <property>aero/coefficient/Cmde_inboard</property>
                <property>aero/coefficient/Cmde_outboard</property>
                <property>aero/coefficient/dCmgear</property>
                <property>aero/coefficient/dCmge</property>
                <property>aero/coefficient/dCmsideslip</property>
            </sum>
        </function>
        
        <axis name="PITCH">
        
            <function name="my_pitch">
                <description>Pitch_moment</description>
                <product>
                    <property>aero/qbar-psf</property>
                    <property>metrics/Sw-sqft</property>
                    <property>metrics/cbarw-ft</property>
                    <property>aero/coefficient/Cm</property>
                </product>
            </function>    
            
        </axis>

        <!-- YAW -->
        
        <function name="aero/coefficient/Cn_beta">
            <description>Yaw_moment_due_to_beta_coefficient</description>
            <product>
                <property>aero/beta-switch</property>
                <property>aero/beta-deg</property>
                <sum>
                    <product>
                        <property>aero/coefficient/Cnb_alpha</property>
                        <property>aero/coefficient/Cnb_aeroelastic</property>
                        <property>aero/coefficient/Cnb_GE</property>
                    </product>
                    <product>
                        <property>aero/coefficient/dCyb</property>
                        <difference>
                            <property>aero/CoG-mac-pct</property>
                            <value>25</value>
                        </difference>
                        <value>0.01</value> <!-- convert from percentage -->
                        <quotient>
                            <property>metrics/cbarw-ft</property>
                            <property>metrics/bw-ft</property>
                        </quotient>
                    </product>
                </sum>
            </product>
        </function>
        
        <function name="aero/coefficient/Cnb_alpha">
            <description>Yaw_moment_due_to_beta_alpha</description>
            <table> <!-- graph 6.0-6 -->
                <independentVar lookup="row">aero/alpha-wing-deg</independentVar>
                <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                <tableData>
                         0.0000  1.0000  5.0000  10.0000  20.0000  25.0000  30.0000
               -5.0000   0.0033  0.0033  0.0034   0.0035   0.0025   0.0026   0.0028
                0.0000   0.0032  0.0032  0.0033   0.0034   0.0026   0.0027   0.0029
                5.0000   0.0030  0.0030  0.0031   0.0032   0.0027   0.0028   0.0030
               10.0000   0.0026  0.0026  0.0028   0.0030   0.0030   0.0032   0.0034
               15.0000   0.0025  0.0025  0.0028   0.0030   0.0032   0.0036   0.0038
               20.0000   0.0025  0.0025  0.0029   0.0032   0.0035   0.0038   0.0042
               25.0000   0.0022  0.0022  0.0033   0.0036   0.0040   0.0042   0.0045
                </tableData>
            </table>
        </function>
        
        <function name="aero/coefficient/Cnb_aeroelastic">
            <description>Yaw_moment_due_to_beta_aeroelastic</description>
            <table> <!-- graph 6.0-6 -->
                <independentVar lookup="row">velocities/mach</independentVar>
                <independentVar lookup="column">atmosphere/density-altitude</independentVar>
                <tableData>
                         0.00 10000.00 20000.00 30000.00 40000.00
                0.00     1.00     1.00     1.00     1.00     1.00
                0.10     0.98     0.98     0.99     1.00     1.00
                0.20     0.95     0.96     0.97     0.98     0.99
                0.30     0.90     0.93     0.95     0.97     0.98
                0.40     0.85     0.90     0.94     0.97     0.99
                0.50     0.82     0.88     0.94     0.98     1.01
                0.60     0.80     0.88     0.95     1.00     1.04
                0.70     0.78     0.88     0.97     1.04     1.10
                0.80     0.77     0.89     1.00     1.10     1.18
                0.85     0.77     0.92     1.05     1.16     1.25
                0.90     0.77     0.89     1.00     1.10     1.20
                0.95     0.77     0.76     0.90     1.02     1.12
                </tableData>
            </table>
        </function>
        
        <function name="aero/coefficient/Cnb_GE">
            <description>Yaw_moment_due_to_beta_ground_effect</description>
            <sum>
                <value>1</value>
                <product>
                    <property>aero/function/Kge</property>
                    <property>aero/coefficient/Fnbeta</property>
                </product>
            </sum>
        </function>
        
        <function name="aero/coefficient/Fnbeta">
            <description>Yaw_moment_due_to_beta_ground_effect_function</description>
            <table> <!-- graph 6.0-7 -->
                <independentVar lookup="row">aero/alpha-wing-deg</independentVar>
                <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                <tableData>
                        0.000  1.000  5.000 10.000 20.000 25.000 30.000
                 0.000  0.220  0.220  0.220  0.160 -0.040 -0.230 -0.310
                 2.000  0.150  0.150  0.150  0.100 -0.100 -0.300 -0.380
                 4.000  0.050  0.050  0.050  0.000 -0.170 -0.360 -0.450
                 6.000 -0.040 -0.040 -0.040 -0.100 -0.270 -0.430 -0.510
                 8.000 -0.100 -0.100 -0.100 -0.165 -0.350 -0.500 -0.600
                10.000 -0.160 -0.160 -0.160 -0.220 -0.400 -0.580 -0.680
                12.000 -0.250 -0.250 -0.250 -0.320 -0.460 -0.580 -0.670
                14.000 -0.370 -0.370 -0.370 -0.440 -0.520 -0.560 -0.600
                </tableData>
            </table>
        </function>
        
        <function name="aero/coefficient/Cnb_rate">
            <description>Yaw_moment_due_to_beta_rate</description>
            <product>
                <product>
                    <table> <!-- graph 6.0-8 -->
                        <independentVar lookup="row">aero/alpha-wing-rad</independentVar>
                        <tableData>
                       -0.0873    -0.031
                        0.0000    -0.028
                        0.0873    -0.025
                        0.1745    -0.0225
                        0.2618    -0.019
                        0.3491    -0.017
                        0.4363    -0.014
                        </tableData>
                    </table>
                    <table> <!-- graph 6.0-8 -->
                        <independentVar lookup="row">velocities/mach</independentVar>
                        <independentVar lookup="column">atmosphere/density-altitude</independentVar>
                        <tableData>
                                  0   10000  20000  30000  40000
                        0.0     1.0     1.0    1.0    1.0    1.0
                        0.1     1.0     1.0    1.0    1.0    1.0
                        0.2     1.0     1.0    1.0    1.0    1.0
                        0.3     1.0     1.0    1.0    1.01   1.01
                        0.4     1.0     1.01   1.05   1.10   1.15
                        0.5     1.02    1.10   1.20   1.24   1.26   
                        0.6     1.24    1.25   1.35   1.40   1.60
                        0.7     1.45    1.60   1.75   1.85   2.00
                        0.8     1.75    2.00   2.20   2.30   2.50
                        0.9     1.75    2.00   2.10   2.30   2.50   
                        0.95    1.75    2.10   2.30   2.45   2.75
                        </tableData>
                    </table>
                </product>
                <property>aero/betadot-rad_sec</property>
                <property>aero/bi2vel</property>
            </product>
        </function>
        
        <function name="aero/coefficient/Cnp">
            <description>Yaw_moment_due_to_roll_rate</description>
            <product>
                <sum>
                    <product>
                        <table>
                            <independentVar lookup="row">velocities/mach</independentVar>
                            <tableData>
                                0.00 1.00
                                0.60 1.00
                                0.80 0.00
                            </tableData>
                        </table>
                        <table> <!-- graph 6.0-9 -->
                            <independentVar lookup="row">aero/alpha-wing-deg</independentVar>
                            <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                            <tableData>
                                    0.000  1.000  5.000 10.000 20.000 25.000 30.000
                            -5.000  0.096  0.090  0.070  0.056  0.030  0.024  0.022
                             0.000  0.029  0.023  0.006 -0.006 -0.027 -0.038 -0.042
                             5.000 -0.032 -0.040 -0.050 -0.063 -0.084 -0.100 -0.118
                             8.000 -0.063 -0.074 -0.085 -0.099 -0.124 -0.150 -0.172
                            10.000 -0.070 -0.094 -0.110 -0.124 -0.158 -0.184 -0.210
                            15.000  0.040 -0.030 -0.176 -0.196 -0.230 -0.250 -0.260
                            20.000  0.040  0.024 -0.162 -0.194 -0.200 -0.180 -0.090
                            25.000  0.040  0.024 -0.090 -0.124 -0.070 -0.044 -0.026
                            </tableData>
                        </table>
                    </product>
                    <product>
                        <table>
                            <independentVar lookup="row">velocities/mach</independentVar>
                            <tableData>
                                0.00 0.00
                                0.60 0.00
                                0.80 1.00
                                0.85 0.00
                            </tableData>
                        </table>
                        <table> <!-- graph 6.0-9 -->
                            <independentVar lookup="row">aero/alpha-wing-deg</independentVar>
                            <tableData>
                            -5.000  0.096
                             0.000  0.029
                             5.000 -0.032
                             8.000 -0.049
                            10.000 -0.034
                            12.000  0.032
                            15.000  0.072
                            15.400  0.076
                            </tableData>
                        </table>
                    </product>
                    <product>
                        <table>
                            <independentVar lookup="row">velocities/mach</independentVar>
                            <tableData>
                                0.00 0.00
                                0.80 0.00
                                0.85 1.00
                            </tableData>
                        </table>
                        <table> <!-- graph 6.0-9 -->
                            <independentVar lookup="row">aero/alpha-wing-deg</independentVar>
                            <tableData>
                            -5.000  0.096
                             0.000  0.029
                             3.000 -0.006
                             5.000 -0.009
                             8.000  0.025
                            10.000  0.049
                            12.400  0.072
                            </tableData>
                        </table>
                    </product>
                </sum>
                <property>velocities/p-aero-rad_sec</property>
                <property>aero/bi2vel</property>
            </product>
        </function>
        
        <function name="aero/coefficient/Cnr">
            <description>Yawing_moment_coefficient_due_to_yaw_rate</description>
            <product>
                <table> <!-- graph 6.0-10 -->
                    <independentVar>aero/CoG-mac-pct</independentVar>
                    <tableData>
                    11   1.06
                    15   1.04
                    20   1.02
                    25   1.00
                    30   0.98
                    33   0.97
                    </tableData>
                </table>
                <table> <!-- graph 6.0-10 -->
                    <independentVar lookup="row">aero/alpha-wing-deg</independentVar>
                    <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                    <tableData>
                           0.000  1.000  5.000 10.000 20.000 25.000 30.000
                   -5.000 -0.225 -0.225 -0.190 -0.210 -0.250 -0.255 -0.275
                    0.000 -0.225 -0.225 -0.195 -0.215 -0.260 -0.275 -0.290
                    5.000 -0.225 -0.225 -0.200 -0.225 -0.290 -0.300 -0.320
                   10.000 -0.230 -0.230 -0.225 -0.250 -0.325 -0.340 -0.360
                   15.000 -0.250 -0.245 -0.250 -0.285 -0.360 -0.375 -0.400
                   20.000 -0.265 -0.265 -0.285 -0.325 -0.400 -0.420 -0.440
                   25.000 -0.300 -0.300 -0.325 -0.370 -0.450 -0.465 -0.490
                    </tableData>
                </table>
                <table> <!-- graph 6.0-10 -->
                    <independentVar lookup="row">velocities/mach</independentVar>
                    <independentVar lookup="column">atmosphere/density-altitude</independentVar>
                    <tableData>
                             0.00 10000.00 20000.00 25000.00 30000.00 40000.00
                    0.00     1.00     1.00     1.00     1.00     1.00     1.00
                    0.10     0.99     1.00     1.00     1.00     1.00     1.00
                    0.20     0.98     0.99     1.00     1.00     1.01     1.01
                    0.30     0.95     0.99     1.00     1.00     1.02     1.03
                    0.40     0.93     0.97     1.00     1.01     1.03     1.05
                    0.50     0.90     0.95     0.99     1.02     1.04     1.09
                    0.60     0.86     0.93     0.99     1.03     1.06     1.13
                    0.70     0.83     0.90     0.99     1.05     1.08     1.19
                    0.80     0.80     0.86     0.95     1.06     1.10     1.23
                    0.90     0.80     0.83     0.87     0.93     1.07     1.25
                    0.95     0.80     0.82     0.84     0.86     0.98     1.18
                    </tableData>
                </table>
                <property>velocities/r-aero-rad_sec</property>
                <property>aero/bi2vel</property>
            </product>
        </function>
        
        <!-- for panels 8 or 12 (individual) - reverse sign for 1 and 5 -->
        <function name="aero/coefficient/dCnsp1">
            <description>Yawing_moment_due_to_spoiler_deflection</description>
            <table> <!-- graph 6.0-12 -->
                <independentVar lookup="row">aero/alpha-wing-deg</independentVar>
                <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                <tableData>
                              0.00000  1.00000  5.00000 10.00000 20.00000 25.00000 30.00000
                    -5.00000  0.00110  0.00110  0.00115  0.00130  0.00150  0.00145  0.00145
                     0.00000  0.00095  0.00095  0.00100  0.00123  0.00145  0.00160  0.00170
                    10.00000  0.00070  0.00070  0.00075  0.00095  0.00120  0.00165  0.00180
                    20.00000  0.00002  0.00002  0.00015  0.00032  0.00055  0.00135  0.00155
                    25.00000 -0.00020 -0.00020 -0.00015 -0.00015 -0.00015  0.00075  0.00085
                </tableData>
            </table>
        </function>
        
        <!-- for panels 9, 10 and 11 - reverse sign for 2, 3 and 4 -->
        <function name="aero/coefficient/dCnsp2">
            <description>Yawing_moment_due_to_spoiler_deflection</description>
            <product>
                <table> <!-- graph 6.0-12 -->
                    <independentVar lookup="row">aero/alpha-wing-deg</independentVar>
                    <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                    <tableData>
                              0.00000  1.00000  5.00000 10.00000 20.00000 25.00000 30.00000
                    -5.00000  0.00205  0.00205  0.00215  0.00235  0.00255  0.00285  0.00285
                     0.00000  0.00225  0.00225  0.00232  0.00252  0.00275  0.00300  0.00300
                     5.00000  0.00180  0.00180  0.00200  0.00225  0.00250  0.00270  0.00270
                    10.00000  0.00080  0.00080  0.00135  0.00165  0.00195  0.00215  0.00215
                    14.00000 -0.00010 -0.00010  0.00070  0.00097  0.00130  0.00160  0.00160
                    20.00000 -0.00065 -0.00065 -0.00020 -0.00013 -0.00005  0.00025  0.00025
                    25.00000 -0.00030 -0.00030 -0.00010 -0.00005  0.00000  0.00040  0.00040
                    </tableData>
                </table>
                <value>0.33</value> <!-- values in table are for the complete group of 3 panels -->
            </product>
        </function>
        
        <function name="aero/coefficient/dCnsp[0]">
            <description>Yawing_moment_coefficient_due_to_spoiler_1_deflection</description>
            <product>
                <value>-1</value>
                <property>aero/coefficient/dCnsp1</property>
                <table> <!-- graph 6.0-11 -->
                    <independentVar lookup="row">fcs/spoiler[0]/pos-deg</independentVar>
                    <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                    <tableData>
                               0.00 30.00
                         0.00  0.00  0.00
                        15.00  0.14  0.20
                        30.00  0.35  0.60
                        40.00  0.65  0.86
                        45.00  1.00  1.00
                    </tableData>
                </table>
                <property>aero/coefficient/CnspM</property>
                <property>aero/coefficient/FCnspGE</property>
            </product>
        </function>
        
        <function name="aero/coefficient/dCnsp[1]">
            <description>Yawing_moment_coefficient_due_to_spoiler_2_deflection</description>
            <product>
                <value>-1</value>
                <property>aero/coefficient/dCnsp2</property>
                <table> <!-- graph 6.0-11 -->
                    <independentVar lookup="row">fcs/spoiler[1]/pos-deg</independentVar>
                    <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                    <tableData>
                               0.00 30.00
                         0.00  0.00  0.00
                        15.00  0.14  0.20
                        30.00  0.35  0.60
                        40.00  0.65  0.86
                        45.00  1.00  1.00
                    </tableData>
                </table>
                <property>aero/coefficient/CnspM</property>
                <property>aero/coefficient/FCnspGE</property>
            </product>
        </function>
        
        <function name="aero/coefficient/dCnsp[2]">
            <description>Yawing_moment_coefficient_due_to_spoiler_3_deflection</description>
            <product>
                <value>-1</value>
                <property>aero/coefficient/dCnsp2</property>
                <table> <!-- graph 6.0-11 -->
                    <independentVar lookup="row">fcs/spoiler[2]/pos-deg</independentVar>
                    <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                    <tableData>
                               0.00 30.00
                         0.00  0.00  0.00
                        15.00  0.14  0.20
                        30.00  0.35  0.60
                        40.00  0.65  0.86
                        45.00  1.00  1.00
                    </tableData>
                </table>
                <property>aero/coefficient/CnspM</property>
                <property>aero/coefficient/FCnspGE</property>
            </product>
        </function>
        
        <function name="aero/coefficient/dCnsp[3]">
            <description>Yawing_moment_coefficient_due_to_spoiler_4_deflection</description>
            <product>
                <value>-1</value>
                <property>aero/coefficient/dCnsp2</property>
                <table> <!-- graph 6.0-11 -->
                    <independentVar lookup="row">fcs/spoiler[3]/pos-deg</independentVar>
                    <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                    <tableData>
                               0.00 30.00
                         0.00  0.00  0.00
                        15.00  0.14  0.20
                        30.00  0.35  0.60
                        40.00  0.65  0.86
                        45.00  1.00  1.00
                    </tableData>
                </table>
                <property>aero/coefficient/CnspM</property>
                <property>aero/coefficient/FCnspGE</property>
            </product>
        </function>
        
        <function name="aero/coefficient/dCnsp[4]">
            <description>Yawing_moment_coefficient_due_to_spoiler_5_deflection</description>
            <product>
                <value>-1</value>
                <property>aero/coefficient/dCnsp1</property>
                <table> <!-- graph 6.0-11 -->
                    <independentVar lookup="row">fcs/spoiler[4]/pos-deg</independentVar>
                    <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                    <tableData>
                               0.00 30.00
                         0.00  0.00  0.00
                        15.00  0.14  0.20
                        30.00  0.35  0.60
                        40.00  0.65  0.86
                        45.00  1.00  1.00
                    </tableData>
                </table>
                <property>aero/coefficient/CnspM</property>
                <property>aero/coefficient/FCnspGE</property>
            </product>
        </function>
        
        <function name="aero/coefficient/dCnsp[7]">
            <description>Yawing_moment_coefficient_due_to_spoiler_8_deflection</description>
            <product>
                <property>aero/coefficient/dCnsp1</property>
                <table> <!-- graph 6.0-11 -->
                    <independentVar lookup="row">fcs/spoiler[7]/pos-deg</independentVar>
                    <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                    <tableData>
                               0.00 30.00
                         0.00  0.00  0.00
                        15.00  0.14  0.20
                        30.00  0.35  0.60
                        40.00  0.65  0.86
                        45.00  1.00  1.00
                    </tableData>
                </table>
                <property>aero/coefficient/CnspM</property>
                <property>aero/coefficient/FCnspGE</property>
            </product>
        </function>
        
        <function name="aero/coefficient/dCnsp[8]">
            <description>Yawing_moment_coefficient_due_to_spoiler_9_deflection</description>
            <product>
                <property>aero/coefficient/dCnsp2</property>
                <table> <!-- graph 6.0-11 -->
                    <independentVar lookup="row">fcs/spoiler[8]/pos-deg</independentVar>
                    <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                    <tableData>
                               0.00 30.00
                         0.00  0.00  0.00
                        15.00  0.14  0.20
                        30.00  0.35  0.60
                        40.00  0.65  0.86
                        45.00  1.00  1.00
                    </tableData>
                </table>
                <property>aero/coefficient/CnspM</property>
                <property>aero/coefficient/FCnspGE</property>
            </product>
        </function>
        
        <function name="aero/coefficient/dCnsp[9]">
            <description>Yawing_moment_coefficient_due_to_spoiler_10_deflection</description>
            <product>
                <property>aero/coefficient/dCnsp2</property>
                <table> <!-- graph 6.0-11 -->
                    <independentVar lookup="row">fcs/spoiler[9]/pos-deg</independentVar>
                    <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                    <tableData>
                               0.00 30.00
                         0.00  0.00  0.00
                        15.00  0.14  0.20
                        30.00  0.35  0.60
                        40.00  0.65  0.86
                        45.00  1.00  1.00
                    </tableData>
                </table>
                <property>aero/coefficient/CnspM</property>
                <property>aero/coefficient/FCnspGE</property>
            </product>
        </function>
        
        <function name="aero/coefficient/dCnsp[10]">
            <description>Yawing_moment_coefficient_due_to_spoiler_11_deflection</description>
            <product>
                <property>aero/coefficient/dCnsp2</property>
                <table> <!-- graph 6.0-11 -->
                    <independentVar lookup="row">fcs/spoiler[10]/pos-deg</independentVar>
                    <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                    <tableData>
                               0.00 30.00
                         0.00  0.00  0.00
                        15.00  0.14  0.20
                        30.00  0.35  0.60
                        40.00  0.65  0.86
                        45.00  1.00  1.00
                    </tableData>
                </table>
                <property>aero/coefficient/CnspM</property>
                <property>aero/coefficient/FCnspGE</property>
            </product>
        </function>
        
        <function name="aero/coefficient/dCnsp[11]">
            <description>Yawing_moment_coefficient_due_to_spoiler_12_deflection</description>
            <product>
                <property>aero/coefficient/dCnsp1</property>
                <table> <!-- graph 6.0-11 -->
                    <independentVar lookup="row">fcs/spoiler[11]/pos-deg</independentVar>
                    <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                    <tableData>
                               0.00 30.00
                         0.00  0.00  0.00
                        15.00  0.14  0.20
                        30.00  0.35  0.60
                        40.00  0.65  0.86
                        45.00  1.00  1.00
                    </tableData>
                </table>
                <property>aero/coefficient/CnspM</property>
                <property>aero/coefficient/FCnspGE</property>
            </product>
        </function>
        
        <function name="aero/coefficient/CnspM">
            <description>Yawing_moment_coefficient_due_to_mach_spoilers</description>
            <table> <!-- graph 6.0-13 -->
                <independentVar lookup="row">velocities/mach</independentVar>
                <independentVar lookup="column">aero/alpha-wing-deg</independentVar>
                <tableData>
                          0     2      4      6     8  
                0.0       1.0   1.0    1.0    1.0   1.0
                0.1       1.0   1.0    1.0    1.0   1.0
                0.2       1.0   1.0    1.0    1.0   1.0
                0.3       1.0   1.0    1.0    1.0   1.0
                0.4       1.0   1.0    1.0    1.0   1.0 
                0.5       1.0   1.0    1.0    1.0   0.98
                0.6       1.0   1.0    1.0    1.0   0.95
                0.7       1.03  1.03   1.02   1.01  0.88
                0.8       1.17  1.24   1.16   1.10  0.70
                0.9       1.40  1.20   1.00   0.45  0.20
                0.95      1.00  0.38   0.40   0.08 -0.12
                </tableData>
            </table>
        </function>
        
        <function name="aero/coefficient/FCnspGE">
            <description>Yawing_moment_due_to_spoilers_groundeffect_function</description>
            <sum>
                <value>1</value>
                <product>
                    <property>aero/coefficient/FCnspoilersGE</property>
                    <property>aero/function/Kge</property>
                </product>
            </sum>
        </function>
        
        <function name="aero/coefficient/FCnspoilersGE">
            <description>Yawing_moment_due_to_spoilers_groundeffect</description>
            <table> <!-- graph 6.0-14 -->
                <independentVar lookup="row">aero/alpha-wing-rad</independentVar>
                <independentVar lookup="column">fcs/flaps/pos-deg</independentVar>
                <tableData>
                         0.0000  1.0000  5.0000  10.0000  20.0000  25.0000  30.0000
                0.0000  -0.090  -0.090   -0.040  -0.040    0.050    0.120    0.150
                0.0350  -0.170  -0.170   -0.140  -0.140   -0.010    0.070    0.100
                0.0698  -0.290  -0.290   -0.250  -0.250   -0.100   -0.020    0.050
                0.1047  -0.420  -0.420   -0.350  -0.350   -0.220   -0.140   -0.070
                0.1396  -0.550  -0.550   -0.500  -0.500   -0.350   -0.250   -0.200
                0.1745  -0.700  -0.700   -0.650  -0.650   -0.500   -0.420   -0.350
                0.2094  -0.850  -0.850   -0.800  -0.800   -0.680   -0.600   -0.550
                0.2443  -0.990  -0.990   -0.940  -0.940   -0.820   -0.750   -0.720
                </tableData>
            </table>
        </function>
        
        <function name="aero/coefficient/Cn_spoilers">
            <description>Yaw_moment_due_to_spoilers_sum</description>
            <sum>
                <property>aero/coefficient/dCnsp[0]</property>
                <property>aero/coefficient/dCnsp[1]</property>
                <property>aero/coefficient/dCnsp[2]</property>
                <property>aero/coefficient/dCnsp[3]</property>
                <property>aero/coefficient/dCnsp[4]</property>
                <property>aero/coefficient/dCnsp[7]</property>
                <property>aero/coefficient/dCnsp[8]</property>
                <property>aero/coefficient/dCnsp[9]</property>
                <property>aero/coefficient/dCnsp[10]</property>
                <property>aero/coefficient/dCnsp[11]</property>
            </sum>
        </function>
        
        <function name="aero/coefficient/Cndr">
            <description>Yaw_moment_due_to_rudder</description>
            <sum>
                <product>
                    <property>aero/function/kRu</property>
                    <property>aero/coefficient/CnRu</property>
                    <property>aero/coefficient/CnRuaeroelastic</property>
                </product>
                <product>
                    <property>aero/function/kRl</property>
                    <property>aero/coefficient/CnRl</property>
                    <property>aero/coefficient/CnRlaeroelastic</property>
                </product>
                <product>
                    <property>aero/coefficient/CYrudder</property>
                    <difference>
                        <property>aero/CoG-mac-pct</property>
                        <value>25</value>
                    </difference>
                    <value>0.01</value> <!-- convert from percentage -->
                    <quotient>
                        <property>metrics/cbarw-ft</property>
                        <property>metrics/bw-ft</property>
                    </quotient>
                </product>
            </sum>
        </function>
        
        <function name="aero/coefficient/CnRu">
            <description>Yaw_moment_due_to_upper_rudder_alpha</description>
            <table> <!-- graph 6.0-19 -->
                <independentVar lookup="row">aero/alpha-wing-rad</independentVar>
                <tableData>
               -0.0873  -0.028
                0.0000  -0.027  
                0.0873  -0.027
                0.1745  -0.026
                0.2618  -0.025
                0.3491  -0.023
                0.4363  -0.016
                </tableData>
            </table>
        </function>
        
        <function name="aero/coefficient/CnRl">
            <description>Yaw_moment_due_to_lower_rudder_alpha</description>
            <table> <!-- graph 6.0-19 -->
                <independentVar lookup="row">aero/alpha-wing-rad</independentVar>
                <tableData>
               -0.0873  -0.022
                0.0000  -0.021  
                0.0873  -0.020
                0.1745  -0.019
                0.2618  -0.017
                0.3491  -0.015
                0.4363  -0.008
                </tableData>
            </table>
        </function>
        
        <function name="aero/coefficient/CnRuaeroelastic">
            <description>Yaw_moment_due_to_rudder_upper_aeroelastic</description>
            <table> <!-- graph 6.0-20 -->
                <independentVar lookup="row">velocities/mach</independentVar>
                <independentVar lookup="column">atmosphere/density-altitude</independentVar>
                <tableData>
                          0   10000  20000  30000  40000
                0.0     1.0     1.0    1.0    1.0    1.0
                0.1     1.0     1.0    1.0    1.0    1.0
                0.2     0.97    0.99   1.0    1.0    1.0
                0.3     0.88    0.94   0.97   0.98   0.99
                0.4     0.77    0.87   0.93   0.95   0.97
                0.5     0.65    0.78   0.85   0.90   0.94
                0.6     0.54    0.70   0.80   0.84   0.94
                0.7     0.44    0.65   0.79   0.90   0.98
                0.8     0.28    0.63   0.80   0.97   1.10
                0.9     0.28    0.30   0.30   0.76   0.90
                0.95    0.28    0.18   0.42   0.55   0.65
                </tableData>
            </table>
        </function>
        
        <function name="aero/coefficient/CnRlaeroelastic">
            <description>Yaw_moment_due_to_rudder_lower_aeroelastic</description>
            <table> <!-- graph 6.0-21 -->
                <independentVar lookup="row">velocities/mach</independentVar>
                <independentVar lookup="column">atmosphere/density-altitude</independentVar>
                <tableData>
                          0   10000  20000  30000  40000
                0.0     1.0     1.0    1.0    1.0    1.0
                0.1     1.0     1.0    1.0    1.0    1.0
                0.2     0.98    0.99   1.0    1.0    1.0
                0.3     0.95    0.97   0.99   0.99   1.0
                0.4     0.90    0.96   0.98   0.99   1.0
                0.5     0.87    0.94   0.97   0.99   1.01
                0.6     0.82    0.90   0.96   0.99   1.03
                0.7     0.74    0.85   0.94   0.98   1.04
                0.8     0.58    0.75   0.87   0.95   1.00
                0.9     0.58    0.25   0.45   0.52   0.53
                0.95    0.58    0.22   0.26   0.27   0.28
                </tableData>
            </table>
        </function>
        
        <function name="aero/coefficient/Cn_total">
            <description>Total_yawing_moment_coefficient</description>
            <sum>
                <property>aero/coefficient/Cn_beta</property>
                <property>aero/coefficient/Cnb_rate</property>
                <property>aero/coefficient/Cnp</property>
                <property>aero/coefficient/Cnr</property>
                <property>aero/coefficient/Cndr</property>
                <property>aero/coefficient/Cn_spoilers</property>
            </sum>
        </function>
            
        <axis name="YAW">
            <function name="my_yaw">
                <description>Yaw_moment</description>
                <product>
                    <property>aero/qbar-psf</property>
                    <property>metrics/Sw-sqft</property>
                    <property>metrics/bw-ft</property>
                    <property>aero/coefficient/Cn_total</property>
                </product>
            </function>
        </axis>
            
        <function name="optimum-cruise-alt-ft">
            <description>Optimum cruise altitude (long range cruise; M 0.86)</description>
            <table>
                <independentVar>inertia/weight-kg</independentVar>
                <tableData>
                    180000  45000
                    184000  45000
                    260000  39000
                    340000  32300
                    420000  28000
                </tableData>
            </table>
        </function>
        
    </aerodynamics>
    
    <external_reactions>

        <force name="tractor" frame="BODY">
            <location unit="IN">
                <x>  300 </x>
                <y>    0 </y>
                <z> -170 </z>
            </location>
            <direction>
                <x>1</x>
                <y>0</y>
                <z>0</z>
            </direction>
        </force>

    </external_reactions>

</fdm_config>
