<?xml version="1.0"?>

<!--
**************************************************************************

Copyright (c) 2016 Simon 'bomber' Morley
simonbomber64 at googlemail.com

This work is licensed under the 
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. 
To view a copy of this license, 
visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or 
send a letter to Creative Commons, PO Box 1866, Mountain View, Cd 94042, USA.

Attribution,  You must give appropriate credit, provide a link to the license, 
and indiCdte if changes were made. You may do so in any reasonable manner, 
but not in any way that suggests the licensor endorses you or your use.

NonCommercial,  You may not use the material for commercial purposes.

ShareAlike,  If you remix, transform, or build upon the material, 
you must distribute your contributions under the same license as the original. 

**************************************************************************
-->

<system name="force-lift_Calcs">

	
	<channel name="dynamic-pressures">
	
	<!-- ####   left   #### -->
		
	<fcs_function name="T4T/aero/wing_left/_1_qbar-psf">
		<function>
			<product>
				<value> 0.5 </value>
				<property>atmosphere/rho-slugs_ft3</property> 
				<property>T4T/velocities/wing_left/_1_true-fps</property>
				<property>T4T/velocities/wing_left/_1_true-fps</property>
			</product>
		</function>
	</fcs_function>
	
	<fcs_function name="T4T/aero/wing_left/_2_qbar-psf">
		<function>
			<product>
				<value> 0.5 </value>
				<property>atmosphere/rho-slugs_ft3</property> 
				<property>T4T/velocities/wing_left/_2_true-fps</property>
				<property>T4T/velocities/wing_left/_2_true-fps</property>
			</product>
		</function>
	</fcs_function>

	<fcs_function name="T4T/aero/wing_left/_3_qbar-psf">
		<function>
			<product>
				<value> 0.5 </value>
				<property>atmosphere/rho-slugs_ft3</property> 
				<property>T4T/velocities/wing_left/_3_true-fps</property>
				<property>T4T/velocities/wing_left/_3_true-fps</property>
			</product>
		</function>
	</fcs_function>

	<fcs_function name="T4T/aero/wing_left/_4_qbar-psf">
		<function>
			<product>
				<value> 0.5 </value>
				<property>atmosphere/rho-slugs_ft3</property> 
				<property>T4T/velocities/wing_left/_4_true-fps</property>
				<property>T4T/velocities/wing_left/_4_true-fps</property>
			</product>
		</function>
	</fcs_function>

	<fcs_function name="T4T/aero/wing_left/_5_qbar-psf">
		<function>
			<product>
				<value> 0.5 </value>
				<property>atmosphere/rho-slugs_ft3</property> 
				<property>T4T/velocities/wing_left/_5_true-fps</property>
				<property>T4T/velocities/wing_left/_5_true-fps</property>
			</product>
		</function>
	</fcs_function>

	<fcs_function name="T4T/aero/wing_left/_6_qbar-psf">
		<function>
			<product>
				<value> 0.5 </value>
				<property>atmosphere/rho-slugs_ft3</property> 
				<property>T4T/velocities/wing_left/_6_true-fps</property>
				<property>T4T/velocities/wing_left/_6_true-fps</property>
			</product>
		</function>
	</fcs_function>

	<fcs_function name="T4T/aero/wing_left/_7_qbar-psf">
		<function>
			<product>
				<value> 0.5 </value>
				<property>atmosphere/rho-slugs_ft3</property> 
				<property>T4T/velocities/wing_left/_7_true-fps</property>
				<property>T4T/velocities/wing_left/_7_true-fps</property>
			</product>
		</function>
	</fcs_function>

	<fcs_function name="T4T/aero/wing_left/_8_qbar-psf">
		<function>
			<product>
				<value> 0.5 </value>
				<property>atmosphere/rho-slugs_ft3</property> 
				<property>T4T/velocities/wing_left/_8_true-fps</property>
				<property>T4T/velocities/wing_left/_8_true-fps</property>
			</product>
		</function>
	</fcs_function>	
	
	<fcs_function name="T4T/aero/wing_left/qbar-psf">
		<function>
			<avg>				
				<property>T4T/aero/wing_left/_1_qbar-psf</property> 
				<property>T4T/aero/wing_left/_2_qbar-psf</property>
				<property>T4T/aero/wing_left/_3_qbar-psf</property>
				<property>T4T/aero/wing_left/_4_qbar-psf</property>
				<property>T4T/aero/wing_left/_5_qbar-psf</property>
				<property>T4T/aero/wing_left/_6_qbar-psf</property>
				<property>T4T/aero/wing_left/_7_qbar-psf</property>
				<property>T4T/aero/wing_left/_8_qbar-psf</property>
			</avg>
		</function>	
	</fcs_function>

	<!-- ####   right   #### -->
	
	<fcs_function name="T4T/aero/wing_right/_1_qbar-psf">
		<function>
			<product>
				<value> 0.5 </value>
				<property>atmosphere/rho-slugs_ft3</property> 
				<property>T4T/velocities/wing_right/_1_true-fps</property>
				<property>T4T/velocities/wing_right/_1_true-fps</property>
			</product>
		</function>
	</fcs_function>
	
	<fcs_function name="T4T/aero/wing_right/_2_qbar-psf">
		<function>
			<product>
				<value> 0.5 </value>
				<property>atmosphere/rho-slugs_ft3</property> 
				<property>T4T/velocities/wing_right/_2_true-fps</property>
				<property>T4T/velocities/wing_right/_2_true-fps</property>
			</product>
		</function>
	</fcs_function>

	<fcs_function name="T4T/aero/wing_right/_3_qbar-psf">
		<function>
			<product>
				<value> 0.5 </value>
				<property>atmosphere/rho-slugs_ft3</property> 
				<property>T4T/velocities/wing_right/_3_true-fps</property>
				<property>T4T/velocities/wing_right/_3_true-fps</property>
			</product>
		</function>
	</fcs_function>

	<fcs_function name="T4T/aero/wing_right/_4_qbar-psf">
		<function>
			<product>
				<value> 0.5 </value>
				<property>atmosphere/rho-slugs_ft3</property> 
				<property>T4T/velocities/wing_right/_4_true-fps</property>
				<property>T4T/velocities/wing_right/_4_true-fps</property>
			</product>
		</function>
	</fcs_function>

	<fcs_function name="T4T/aero/wing_right/_5_qbar-psf">
		<function>
			<product>
				<value> 0.5 </value>
				<property>atmosphere/rho-slugs_ft3</property> 
				<property>T4T/velocities/wing_right/_5_true-fps</property>
				<property>T4T/velocities/wing_right/_5_true-fps</property>
			</product>
		</function>
	</fcs_function>

	<fcs_function name="T4T/aero/wing_right/_6_qbar-psf">
		<function>
			<product>
				<value> 0.5 </value>
				<property>atmosphere/rho-slugs_ft3</property> 
				<property>T4T/velocities/wing_right/_6_true-fps</property>
				<property>T4T/velocities/wing_right/_6_true-fps</property>
			</product>
		</function>
	</fcs_function>

	<fcs_function name="T4T/aero/wing_right/_7_qbar-psf">
		<function>
			<product>
				<value> 0.5 </value>
				<property>atmosphere/rho-slugs_ft3</property> 
				<property>T4T/velocities/wing_right/_7_true-fps</property>
				<property>T4T/velocities/wing_right/_7_true-fps</property>
			</product>
		</function>
	</fcs_function>

	<fcs_function name="T4T/aero/wing_right/_8_qbar-psf">
		<function>
			<product>
				<value> 0.5 </value>
				<property>atmosphere/rho-slugs_ft3</property> 
				<property>T4T/velocities/wing_right/_8_true-fps</property>
				<property>T4T/velocities/wing_right/_8_true-fps</property>
			</product>
		</function>
	</fcs_function>		

	<fcs_function name="T4T/aero/wing_right/qbar-psf">
		<function>
			<avg>				
				<property>T4T/aero/wing_right/_1_qbar-psf</property> 
				<property>T4T/aero/wing_right/_2_qbar-psf</property>
				<property>T4T/aero/wing_right/_3_qbar-psf</property>
				<property>T4T/aero/wing_right/_4_qbar-psf</property>
				<property>T4T/aero/wing_right/_5_qbar-psf</property>
				<property>T4T/aero/wing_right/_6_qbar-psf</property>
				<property>T4T/aero/wing_right/_7_qbar-psf</property>
				<property>T4T/aero/wing_right/_8_qbar-psf</property>
			</avg>
		</function>	
	</fcs_function>

	<!-- ####   tail   #### -->
	
	<fcs_function name="T4T/aero/v-stab/qbar-psf">
		<function>
			<product>
				<value> 0.5 </value>
				<property>atmosphere/rho-slugs_ft3</property> 
				<property>T4T/velocities/v-stab/true-fps</property>
				<property>T4T/velocities/v-stab/true-fps</property>
			</product>
		</function>
	</fcs_function>	
	

	<fcs_function name="T4T/aero/h-stab_left/qbar-psf">
		<function>
			<product>
				<value> 0.5 </value>
				<property>atmosphere/rho-slugs_ft3</property> 
				<property>T4T/velocities/h-stab_left/true-fps</property>
				<property>T4T/velocities/h-stab_left/true-fps</property>
			</product>
		</function>
	</fcs_function>
	
	<fcs_function name="T4T/aero/h-stab_right/qbar-psf">
		<function>
			<product>
				<value> 0.5 </value>
				<property>atmosphere/rho-slugs_ft3</property> 
				<property>T4T/velocities/h-stab_right/true-fps</property>
				<property>T4T/velocities/h-stab_right/true-fps</property>
			</product>
		</function>
	</fcs_function>
	
	</channel>

	<channel name="lift-vector">

	<!-- #### lift vector #### -->
	<!-- ####   left   #### -->

	<fcs_function name="T4T/forces/wing_left/_1_lift-lbs">
		<function>	
			<product>		
				<property>T4T/structure/wing/_1_dihedral-cos</property>		
				<product name="T4T/forces/wing_left/_1_force-lbs">	
					<property>T4T/coefficients/wing_left/_1_Cl-sqft</property>
					<property>T4T/aero/wing_left/_1_qbar-psf</property>				
				</product>
			</product>
		</function>
	</fcs_function>	
	
	<fcs_function name="T4T/forces/wing_left/_2_lift-lbs">
		<function>	
			<product>		
				<property>T4T/structure/wing/_2_dihedral-cos</property>		
				<product name="T4T/forces/wing_left/_2_force-lbs">
					<property>T4T/coefficients/wing_left/_2_Cl-sqft</property>
					<property>T4T/aero/wing_left/_2_qbar-psf</property>				
				</product>
			</product>
		</function>
	</fcs_function>
	
	<fcs_function name="T4T/forces/wing_left/_3_lift-lbs">
		<function>	
			<product>		
				<property>T4T/structure/wing/_3_dihedral-cos</property>		
				<product name="T4T/forces/wing_left/_3_force-lbs">	
					<property>T4T/coefficients/wing_left/_3_Cl-sqft</property>
					<property>T4T/aero/wing_left/_3_qbar-psf</property>				
				</product>
			</product>
		</function>
	</fcs_function>
	
	<fcs_function name="T4T/forces/wing_left/_4_lift-lbs">
		<function>	
			<product>		
				<property>T4T/structure/wing/_4_dihedral-cos</property>		
				<product name="T4T/forces/wing_left/_4_force-lbs">	
					<property>T4T/coefficients/wing_left/_4_Cl-sqft</property>
					<property>T4T/aero/wing_left/_4_qbar-psf</property>				
				</product>
			</product>
		</function>
	</fcs_function>
	
	<fcs_function name="T4T/forces/wing_left/_5_lift-lbs">
		<function>	
			<product>		
				<property>T4T/structure/wing/_5_dihedral-cos</property>		
				<product name="T4T/forces/wing_left/_5_force-lbs">	
					<property>T4T/coefficients/wing_left/_5_Cl-sqft</property>
					<property>T4T/aero/wing_left/_5_qbar-psf</property>				
				</product>
			</product>
		</function>
	</fcs_function>

	<fcs_function name="T4T/forces/wing_left/_6_lift-lbs">
		<function>	
			<product>		
				<property>T4T/structure/wing/_6_dihedral-cos</property>		
				<product name="T4T/forces/wing_left/_6_force-lbs">	
					<property>T4T/coefficients/wing_left/_6_Cl-sqft</property>
					<property>T4T/aero/wing_left/_6_qbar-psf</property>				
				</product>
			</product>
		</function>
	</fcs_function>	

	<fcs_function name="T4T/forces/wing_left/_7_lift-lbs">
		<function>	
			<product>		
				<property>T4T/structure/wing/_7_dihedral-cos</property>		
				<product name="T4T/forces/wing_left/_7_force-lbs">	
					<property>T4T/coefficients/wing_left/_7_Cl-sqft</property>
					<property>T4T/aero/wing_left/_7_qbar-psf</property>				
				</product>
			</product>
		</function>
	</fcs_function>	

	<fcs_function name="T4T/forces/wing_left/_8_lift-lbs">
		<function>	
			<product>
				<property>T4T/structure/wing/_8_dihedral-cos</property>		
				<product name="T4T/forces/wing_left/_8_force-lbs">	
					<property>T4T/coefficients/wing_left/_8_Cl-sqft</property>
					<property>T4T/aero/wing_left/_8_qbar-psf</property>				
				</product>
			</product>
		</function>
	</fcs_function>	
			
	
	<!-- ####   right   #### -->

 	<fcs_function name="T4T/forces/wing_right/_1_lift-lbs">
		<function>	
			<product>	
				<property>T4T/structure/wing/_1_dihedral-cos</property>		
				<product name="T4T/forces/wing_right/_1_force-lbs">	
					<property>T4T/coefficients/wing_right/_1_Cl-sqft</property>
					<property>T4T/aero/wing_right/_1_qbar-psf</property>				
				</product>
			</product>
		</function>
	</fcs_function>	
	
	<fcs_function name="T4T/forces/wing_right/_2_lift-lbs">
		<function>	
			<product>	
				<property>T4T/structure/wing/_2_dihedral-cos</property>		
				<product name="T4T/forces/wing_right/_2_force-lbs">	
					<property>T4T/coefficients/wing_right/_2_Cl-sqft</property>
					<property>T4T/aero/wing_right/_2_qbar-psf</property>				
				</product>
			</product>
		</function>
	</fcs_function>
	
	<fcs_function name="T4T/forces/wing_right/_3_lift-lbs">
		<function>	
			<product>	
				<property>T4T/structure/wing/_3_dihedral-cos</property>		
				<product name="T4T/forces/wing_right/_3_force-lbs">	
					<property>T4T/coefficients/wing_right/_3_Cl-sqft</property>
					<property>T4T/aero/wing_right/_3_qbar-psf</property>				
				</product>
			</product>
		</function>
	</fcs_function>
	
	<fcs_function name="T4T/forces/wing_right/_4_lift-lbs">
		<function>	
			<product>	
				<property>T4T/structure/wing/_4_dihedral-cos</property>		
				<product name="T4T/forces/wing_right/_4_force-lbs">
					<property>T4T/coefficients/wing_right/_4_Cl-sqft</property>
					<property>T4T/aero/wing_right/_4_qbar-psf</property>				
				</product>
			</product>
		</function>
	</fcs_function>
	
	<fcs_function name="T4T/forces/wing_right/_5_lift-lbs">
		<function>	
			<product>	
				<property>T4T/structure/wing/_5_dihedral-cos</property>		
				<product name="T4T/forces/wing_right/_5_force-lbs">	
					<property>T4T/coefficients/wing_right/_5_Cl-sqft</property>
					<property>T4T/aero/wing_right/_5_qbar-psf</property>				
				</product>
			</product>
		</function>
	</fcs_function>

	<fcs_function name="T4T/forces/wing_right/_6_lift-lbs">
		<function>	
			<product>	
				<property>T4T/structure/wing/_6_dihedral-cos</property>		
				<product name="T4T/forces/wing_right/_6_force-lbs">
					<property>T4T/coefficients/wing_right/_6_Cl-sqft</property>
					<property>T4T/aero/wing_right/_6_qbar-psf</property>				
				</product>
			</product>
		</function>
	</fcs_function>	

	<fcs_function name="T4T/forces/wing_right/_7_lift-lbs">
		<function>	
			<product>	
				<property>T4T/structure/wing/_7_dihedral-cos</property>		
				<product name="T4T/forces/wing_right/_7_force-lbs">	
					<property>T4T/coefficients/wing_right/_7_Cl-sqft</property>
					<property>T4T/aero/wing_right/_7_qbar-psf</property>				
				</product>
			</product>
		</function>
	</fcs_function>	

	<fcs_function name="T4T/forces/wing_right/_8_lift-lbs">
		<function>	
			<product>	
				<property>T4T/structure/wing/_8_dihedral-cos</property>		
				<product name="T4T/forces/wing_right/_8_force-lbs">
					<property>T4T/coefficients/wing_right/_8_Cl-sqft</property>
					<property>T4T/aero/wing_right/_8_qbar-psf</property>				
				</product>
			</product>
		</function>
	</fcs_function>	


	<!-- ####   tail   #### -->

    <pure_gain name="T4T/forces/v-stab/lift-lbs">
		<input>-T4T/coefficients/v-stab/Cl-sqft</input>		
		<gain>T4T/aero/v-stab/qbar-psf</gain>
    </pure_gain>
	
	<fcs_function name="T4T/forces/h-stab_left/lift-lbs">
		<function>
			<product>
				<property>T4T/structure/h-stab/dihedral-cos</property>
				<product name="T4T/forces/h-stab_left/force-lbs">
					<property>T4T/coefficients/h-stab_left/Cl-sqft</property>
					<property>T4T/aero/h-stab_left/qbar-psf</property>
				</product>
			</product>
		</function>
	</fcs_function>
	
	<fcs_function name="T4T/forces/h-stab_right/lift-lbs">
		<function>
			<product>
				<property>T4T/structure/h-stab/dihedral-cos</property>
				<product name="T4T/forces/h-stab_right/force-lbs">
					<property>T4T/coefficients/h-stab_right/Cl-sqft</property>
					<property>T4T/aero/h-stab_right/qbar-psf</property>
				</product>
			</product>
		</function>
	</fcs_function>


	<!-- ####   totals   #### -->

	<summer name="T4T/forces/wing_left/lift-lbs">
		<input>T4T/forces/wing_left/_1_lift-lbs</input>
		<input>T4T/forces/wing_left/_2_lift-lbs</input>
		<input>T4T/forces/wing_left/_3_lift-lbs</input>
		<input>T4T/forces/wing_left/_4_lift-lbs</input>
		<input>T4T/forces/wing_left/_5_lift-lbs</input>
		<input>T4T/forces/wing_left/_6_lift-lbs</input>
		<input>T4T/forces/wing_left/_7_lift-lbs</input>
		<input>T4T/forces/wing_left/_8_lift-lbs</input>	
	</summer>

	<summer name="T4T/forces/wing_right/lift-lbs">
		<input>T4T/forces/wing_right/_1_lift-lbs</input>
		<input>T4T/forces/wing_right/_2_lift-lbs</input>
		<input>T4T/forces/wing_right/_3_lift-lbs</input>
		<input>T4T/forces/wing_right/_4_lift-lbs</input>
		<input>T4T/forces/wing_right/_5_lift-lbs</input>
		<input>T4T/forces/wing_right/_6_lift-lbs</input>
		<input>T4T/forces/wing_right/_7_lift-lbs</input>
		<input>T4T/forces/wing_right/_8_lift-lbs</input>
	</summer>
	
	<summer name="T4T/forces/wing/lift-lbs">
		<input>T4T/forces/wing_left/lift-lbs</input>
		<input>T4T/forces/wing_right/lift-lbs</input>
	</summer>
	
	<summer name="T4T/forces/h-stab/lift-lbs">
		<input>T4T/forces/h-stab_left/lift-lbs</input>
		<input>T4T/forces/h-stab_right/lift-lbs</input>
	</summer>
	
	<summer name="T4T/forces/LIFT-lbs">
		<input>T4T/forces/wing/lift-lbs</input>	
		<input>T4T/forces/h-stab/lift-lbs</input>	
	</summer>	

	</channel>
		
	<channel name="side-vector">

	<!-- #### side vector #### -->		
	<!-- ####   left   #### -->	
	
    <pure_gain name="T4T/forces/wing_left/_1_side-lbs">
		<input>T4T/forces/wing_left/_1_force-lbs</input>
		<gain>T4T/structure/wing/_1_dihedral-sin</gain>
    </pure_gain>
	
    <pure_gain name="T4T/forces/wing_left/_2_side-lbs">
		<input>T4T/forces/wing_left/_2_force-lbs</input>
		<gain>T4T/structure/wing/_2_dihedral-sin</gain>
    </pure_gain>
	
    <pure_gain name="T4T/forces/wing_left/_3_side-lbs">
		<input>T4T/forces/wing_left/_3_force-lbs</input>
		<gain>T4T/structure/wing/_3_dihedral-sin</gain>
    </pure_gain>
	
    <pure_gain name="T4T/forces/wing_left/_4_side-lbs">
		<input>T4T/forces/wing_left/_4_force-lbs</input>
		<gain>T4T/structure/wing/_4_dihedral-sin</gain>
    </pure_gain>
	
    <pure_gain name="T4T/forces/wing_left/_5_side-lbs">
		<input>T4T/forces/wing_left/_5_force-lbs</input>
		<gain>T4T/structure/wing/_5_dihedral-sin</gain>
    </pure_gain>
	
    <pure_gain name="T4T/forces/wing_left/_6_side-lbs">
		<input>T4T/forces/wing_left/_6_force-lbs</input>
		<gain>T4T/structure/wing/_6_dihedral-sin</gain>
    </pure_gain>
	
    <pure_gain name="T4T/forces/wing_left/_7_side-lbs">
		<input>T4T/forces/wing_left/_7_force-lbs</input>
		<gain>T4T/structure/wing/_7_dihedral-sin</gain>
    </pure_gain>
	
    <pure_gain name="T4T/forces/wing_left/_8_side-lbs">
		<input>T4T/forces/wing_left/_8_force-lbs</input>
		<gain>T4T/structure/wing/_8_dihedral-sin</gain>
    </pure_gain>
	
    <pure_gain name="T4T/forces/h-stab_left/side-lbs">
		<input>T4T/forces/h-stab_left/force-lbs</input>
		<gain>T4T/structure/h-stab/dihedral-sin</gain>
    </pure_gain>
	
	
	<!-- ####   right   #### -->	
	
    <pure_gain name="T4T/forces/wing_right/_1_side-lbs">
		<input>T4T/forces/wing_right/_1_force-lbs</input>
		<gain>-T4T/structure/wing/_1_dihedral-sin</gain>
    </pure_gain>
	
    <pure_gain name="T4T/forces/wing_right/_2_side-lbs">
		<input>T4T/forces/wing_right/_2_force-lbs</input>
		<gain>-T4T/structure/wing/_2_dihedral-sin</gain>
    </pure_gain>
	
    <pure_gain name="T4T/forces/wing_right/_3_side-lbs">
		<input>T4T/forces/wing_right/_3_force-lbs</input>
		<gain>-T4T/structure/wing/_3_dihedral-sin</gain>
    </pure_gain>
	
    <pure_gain name="T4T/forces/wing_right/_4_side-lbs">
		<input>T4T/forces/wing_right/_4_force-lbs</input>
		<gain>-T4T/structure/wing/_4_dihedral-sin</gain>
    </pure_gain>
	
    <pure_gain name="T4T/forces/wing_right/_5_side-lbs">
		<input>T4T/forces/wing_right/_5_force-lbs</input>
		<gain>-T4T/structure/wing/_5_dihedral-sin</gain>
    </pure_gain>
	
    <pure_gain name="T4T/forces/wing_right/_6_side-lbs">
		<input>T4T/forces/wing_right/_6_force-lbs</input>
		<gain>-T4T/structure/wing/_6_dihedral-sin</gain>
    </pure_gain>
	
    <pure_gain name="T4T/forces/wing_right/_7_side-lbs">
		<input>T4T/forces/wing_right/_7_force-lbs</input>
		<gain>-T4T/structure/wing/_7_dihedral-sin</gain>
    </pure_gain>
	
    <pure_gain name="T4T/forces/wing_right/_8_side-lbs">
		<input>T4T/forces/wing_right/_8_force-lbs</input>
		<gain>-T4T/structure/wing/_8_dihedral-sin</gain>
    </pure_gain>

    <pure_gain name="T4T/forces/h-stab_right/side-lbs">
		<input>T4T/forces/h-stab_right/force-lbs</input>
		<gain>-T4T/structure/h-stab/dihedral-sin</gain>
    </pure_gain>	
	

	<!-- ####   totals   #### -->	
	
	<summer name="T4T/forces/wing_left/side-lbs">
		<input>T4T/forces/wing_left/_1_side-lbs</input>
		<input>T4T/forces/wing_left/_2_side-lbs</input>
		<input>T4T/forces/wing_left/_3_side-lbs</input>
		<input>T4T/forces/wing_left/_4_side-lbs</input>
		<input>T4T/forces/wing_left/_5_side-lbs</input>
		<input>T4T/forces/wing_left/_6_side-lbs</input>
		<input>T4T/forces/wing_left/_7_side-lbs</input>
		<input>T4T/forces/wing_left/_8_side-lbs</input>
	</summer>
	
	
	<summer name="T4T/forces/wing_right/side-lbs">
		<input>T4T/forces/wing_right/_1_side-lbs</input>
		<input>T4T/forces/wing_right/_2_side-lbs</input>
		<input>T4T/forces/wing_right/_3_side-lbs</input>
		<input>T4T/forces/wing_right/_4_side-lbs</input>
		<input>T4T/forces/wing_right/_5_side-lbs</input>
		<input>T4T/forces/wing_right/_6_side-lbs</input>
		<input>T4T/forces/wing_right/_7_side-lbs</input>
		<input>T4T/forces/wing_right/_8_side-lbs</input>
	</summer>
	
	<summer name="T4T/forces/wing/side-lbs">
		<input>T4T/forces/wing_left/side-lbs</input>
		<input>T4T/forces/wing_right/side-lbs</input>
	</summer>
	
	<summer name="T4T/forces/h-stab/side-lbs">
		<input>T4T/forces/h-stab_left/side-lbs</input>
		<input>T4T/forces/h-stab_right/side-lbs</input>
	</summer>	
	
	<summer name="T4T/forces/SIDE-lbs">
		<input>T4T/forces/wing/side-lbs</input>	
		<input>T4T/forces/h-stab/side-lbs</input>
		<input>T4T/forces/v-stab/lift-lbs</input>		
	</summer>	
	
	</channel>

	<channel name="drag-vector">
	
	
	<fcs_function name="T4T/aero/alpha-sin">
		<function>
			<sin><property>aero/alpha-rad</property></sin>
		</function>
	</fcs_function>

	<!-- #### drag vector #### -->	
	<!-- ####   left   #### -->
	
    <pure_gain name="T4T/forces/wing_left/_1_drag-lbs">
		<input>T4T/aero/wing_left/_1_qbar-psf</input>
		<gain>T4T/coefficients/wing_left/_1_Cd-sqft</gain>
    </pure_gain>
	
    <pure_gain name="T4T/forces/wing_left/_2_drag-lbs">
		<input>T4T/aero/wing_left/_2_qbar-psf</input>
		<gain>T4T/coefficients/wing_left/_2_Cd-sqft</gain>
    </pure_gain>

    <pure_gain name="T4T/forces/wing_left/_3_drag-lbs">
		<input>T4T/aero/wing_left/_3_qbar-psf</input>
		<gain>T4T/coefficients/wing_left/_3_Cd-sqft</gain>
    </pure_gain>
	
    <pure_gain name="T4T/forces/wing_left/_4_drag-lbs">
		<input>T4T/aero/wing_left/_4_qbar-psf</input>
		<gain>T4T/coefficients/wing_left/_4_Cd-sqft</gain>
    </pure_gain>
	
    <pure_gain name="T4T/forces/wing_left/_5_drag-lbs">
		<input>T4T/aero/wing_left/_5_qbar-psf</input>
		<gain>T4T/coefficients/wing_left/_5_Cd-sqft</gain>
    </pure_gain>	

    <pure_gain name="T4T/forces/wing_left/_6_drag-lbs">
		<input>T4T/aero/wing_left/_6_qbar-psf</input>
		<gain>T4T/coefficients/wing_left/_6_Cd-sqft</gain>
    </pure_gain>

    <pure_gain name="T4T/forces/wing_left/_7_drag-lbs">
		<input>T4T/aero/wing_left/_7_qbar-psf</input>
		<gain>T4T/coefficients/wing_left/_7_Cd-sqft</gain>
    </pure_gain>

    <pure_gain name="T4T/forces/wing_left/_8_drag-lbs">
		<input>T4T/aero/wing_left/_8_qbar-psf</input>
		<gain>T4T/coefficients/wing_left/_8_Cd-sqft</gain>
    </pure_gain>

	<!-- ####   right   #### -->

    <pure_gain name="T4T/forces/wing_right/_1_drag-lbs">
		<input>T4T/aero/wing_right/_1_qbar-psf</input>
		<gain>T4T/coefficients/wing_right/_1_Cd-sqft</gain>
    </pure_gain>

    <pure_gain name="T4T/forces/wing_right/_2_drag-lbs">
		<input>T4T/aero/wing_right/_2_qbar-psf</input>
		<gain>T4T/coefficients/wing_right/_2_Cd-sqft</gain>
    </pure_gain>

    <pure_gain name="T4T/forces/wing_right/_3_drag-lbs">
		<input>T4T/aero/wing_right/_3_qbar-psf</input>
		<gain>T4T/coefficients/wing_right/_3_Cd-sqft</gain>
    </pure_gain>
	
    <pure_gain name="T4T/forces/wing_right/_4_drag-lbs">
		<input>T4T/aero/wing_right/_4_qbar-psf</input>
		<gain>T4T/coefficients/wing_right/_4_Cd-sqft</gain>
    </pure_gain>
	
    <pure_gain name="T4T/forces/wing_right/_5_drag-lbs">
		<input>T4T/aero/wing_right/_5_qbar-psf</input>
		<gain>T4T/coefficients/wing_right/_5_Cd-sqft</gain>
    </pure_gain>	

    <pure_gain name="T4T/forces/wing_right/_6_drag-lbs">
		<input>T4T/aero/wing_right/_6_qbar-psf</input>
		<gain>T4T/coefficients/wing_right/_6_Cd-sqft</gain>
    </pure_gain>

    <pure_gain name="T4T/forces/wing_right/_7_drag-lbs">
		<input>T4T/aero/wing_right/_7_qbar-psf</input>
		<gain>T4T/coefficients/wing_right/_7_Cd-sqft</gain>
    </pure_gain>

    <pure_gain name="T4T/forces/wing_right/_8_drag-lbs">
		<input>T4T/aero/wing_right/_8_qbar-psf</input>
		<gain>T4T/coefficients/wing_right/_8_Cd-sqft</gain>
    </pure_gain>

	<!-- ####   tail   #### -->

    <pure_gain name="T4T/forces/v-stab/drag-lbs">
		<input>T4T/aero/v-stab/qbar-psf</input>
		<gain>T4T/coefficients/v-stab/Cd-sqft</gain>
    </pure_gain>
	
    <pure_gain name="T4T/forces/h-stab_left/drag-lbs">
		<input>T4T/aero/h-stab_left/qbar-psf</input>
		<gain>T4T/coefficients/h-stab_left/Cd-sqft</gain>
    </pure_gain>
	
    <pure_gain name="T4T/forces/h-stab_right/drag-lbs">
		<input>T4T/aero/h-stab_right/qbar-psf</input>
		<gain>T4T/coefficients/h-stab_right/Cd-sqft</gain>
    </pure_gain>
	
	<fcs_function name="T4T/coefficients/kCdge">
		<function>
			<description>ground effect on induced drag</description>
			<table>
				<independentVar>aero/h_b-mac-ft</independentVar>
				<tableData>
				0		0.0
				0.1		0.5
				0.2		0.7
				0.3		0.8
				0.4		0.87
				0.5		0.92
				0.6		0.94
				0.7		0.96
				0.8		0.97
				0.9		0.98
				1.0		0.99
				1.1		1.0
				</tableData>
			</table>
		</function>
	</fcs_function>		
		
	<!--
	<fcs_function name="T4T/coefficients/kCdge">
        <function>
			<description>ground effect on induced drag</description>
			<v> 1 </v>
        </function>
	</fcs_function>
	-->
	
	<!-- ####   left   #### -->
	
	<fcs_function name="T4T/coefficients/wing_left/Cdi">
		<function>
		<description>Cl of the left wing</description>
			<product>
				<property>T4T/aero/wing_efficiency</property><!-- 1 over efficiency value * pi * apect ratio -->			
				<pow>
					<quotient name="T4T/coefficients/wing_left/Cl">
						<sum>				
							<property>T4T/coefficients/wing_left/_1_Cl-sqft</property>
							<property>T4T/coefficients/wing_left/_2_Cl-sqft</property>
							<property>T4T/coefficients/wing_left/_3_Cl-sqft</property>
							<property>T4T/coefficients/wing_left/_4_Cl-sqft</property>
							<property>T4T/coefficients/wing_left/_5_Cl-sqft</property>
							<property>T4T/coefficients/wing_left/_6_Cl-sqft</property>
							<property>T4T/coefficients/wing_left/_7_Cl-sqft</property>
							<property>T4T/coefficients/wing_left/_8_Cl-sqft</property>
						</sum>
						<property>T4T/metrics/wing-sqft</property>						
					</quotient>
					<value> 2 </value>
				</pow>
			</product>
		</function>	
	</fcs_function>	
	
	<fcs_function name="T4T/forces/wing_left/drag_vortex-lbs">
		<function>
		<description>Induced drag from the left wing</description>
			<product><!-- http://www.grc.nasa.gov/WWW/K-12/airplane/induced_html -->				
				<property>T4T/coefficients/kCdge</property> <!-- ground effect -->						
				<property>T4T/coefficients/wing_left/Cdi</property>				
				<property>T4T/aero/wing_left/qbar-psf</property> <!-- average dynamic pressure on the wing -->
				<property>T4T/metrics/wing-sqft</property> <!-- Area of left wing -->
			</product>
		</function>	
	</fcs_function>
	
	
	<!-- ####   right   #### -->
	
	<fcs_function name="T4T/coefficients/wing_right/Cdi">
		<function>
		<description>Cl of the right wing</description>
			<product>
				<property>T4T/aero/wing_efficiency</property><!-- 1 over efficiency value * pi * apect ratio -->			
				<pow>
					<quotient name="T4T/coefficients/wing_right/Cl">
						<sum>				
							<property>T4T/coefficients/wing_right/_1_Cl-sqft</property>
							<property>T4T/coefficients/wing_right/_2_Cl-sqft</property>
							<property>T4T/coefficients/wing_right/_3_Cl-sqft</property>
							<property>T4T/coefficients/wing_right/_4_Cl-sqft</property>
							<property>T4T/coefficients/wing_right/_5_Cl-sqft</property>
							<property>T4T/coefficients/wing_right/_6_Cl-sqft</property>
							<property>T4T/coefficients/wing_right/_7_Cl-sqft</property>
							<property>T4T/coefficients/wing_right/_8_Cl-sqft</property>
						</sum>
						<property>T4T/metrics/wing-sqft</property>						
					</quotient>
					<value> 2 </value>
				</pow>
			</product>
		</function>	
	</fcs_function>	
	
	<fcs_function name="T4T/forces/wing_right/drag_vortex-lbs">
		<function>
		<description>Induced drag from the right wing</description>
			<product><!-- http://www.grc.nasa.gov/WWW/K-12/airplane/induced_html -->				
				<property>T4T/coefficients/kCdge</property> <!-- ground effect -->						
				<property>T4T/coefficients/wing_right/Cdi</property>
				<property>T4T/aero/wing_right/qbar-psf</property> <!-- average dynamic pressure on the wing -->
				<property>T4T/metrics/wing-sqft</property> <!-- Area of right wing -->
			</product>
		</function>	
	</fcs_function>
	
	<!-- ####   fuselage   #### -->
	
	<fcs_function name="T4T/aero/alpha-cos">
		<function>
			<cos><property>aero/alpha-rad</property></cos>
		</function>
	</fcs_function>
	
	<fcs_function name="T4T/aero/beta-cos">
		<function>
			<cos><property>aero/beta-rad</property></cos>
		</function>
	</fcs_function>
	
	<fcs_function name="T4T/aero/beta-sin">
		<function>
			<sin><property>aero/beta-rad</property></sin>
		</function>
	</fcs_function>
	
	<fcs_function name="T4T/forces/fuselage/drag_parasitic-lbs">
		<function>
			<sum>
				<product name="T4T/forces/fuselage/front_drag-lbs">
					<property>T4T/metrics/drag_efficiency</property>
					<abs><property>T4T/aero/alpha-cos</property></abs>					
					<abs><property>T4T/aero/beta-cos</property></abs>			
					<value> 0.21 </value>
					<property>T4T/metrics/front-sqft</property>				
					<property>aero/qbar-psf</property> <!-- dynamic pressure -->
				</product>	
				<product name="T4T/forces/fuselage/side_drag-lbs">
					<property>T4T/metrics/drag_efficiency</property>
					<abs><property>T4T/aero/beta-sin</property></abs>				
					<value> 0.59 </value>
					<property>T4T/metrics/side-sqft</property>				
					<property>aero/qbar-psf</property> <!-- dynamic pressure -->
				</product>
				<product name="T4T/forces/fuselage/plan_drag-lbs">
					<property>T4T/metrics/drag_efficiency</property>				
					<abs><property>T4T/aero/alpha-sin</property></abs>			
					<value> 0.59 </value>
					<property>T4T/metrics/plan-sqft</property>				
					<property>aero/qbar-psf</property> <!-- dynamic pressure -->
				</product>				
			</sum>				
		</function>
	</fcs_function>
		
	<!-- ####   totals   #### -->	
	
	<summer name="T4T/forces/wing_left/drag-lbs">
		<input>T4T/forces/wing_left/_1_drag-lbs</input>
		<input>T4T/forces/wing_left/_2_drag-lbs</input>
		<input>T4T/forces/wing_left/_3_drag-lbs</input>
		<input>T4T/forces/wing_left/_4_drag-lbs</input>
		<input>T4T/forces/wing_left/_5_drag-lbs</input>
		<input>T4T/forces/wing_left/_6_drag-lbs</input>
		<input>T4T/forces/wing_left/_7_drag-lbs</input>
		<input>T4T/forces/wing_left/_8_drag-lbs</input>
		<input>T4T/forces/wing_left/drag_vortex-lbs</input>		
	</summer>

	<summer name="T4T/forces/wing_right/drag-lbs">
		<input>T4T/forces/wing_right/_1_drag-lbs</input>
		<input>T4T/forces/wing_right/_2_drag-lbs</input>
		<input>T4T/forces/wing_right/_3_drag-lbs</input>
		<input>T4T/forces/wing_right/_4_drag-lbs</input>
		<input>T4T/forces/wing_right/_5_drag-lbs</input>
		<input>T4T/forces/wing_right/_6_drag-lbs</input>
		<input>T4T/forces/wing_right/_7_drag-lbs</input>
		<input>T4T/forces/wing_right/_8_drag-lbs</input>
		<input>T4T/forces/wing_left/drag_vortex-lbs</input>			
	</summer>

	<summer name="T4T/forces/wing/drag-lbs">
		<input>T4T/forces/wing_left/drag-lbs</input>
		<input>T4T/forces/wing_right/drag-lbs</input>
	</summer>	
	
	<summer name="T4T/forces/h-stab/drag-lbs">
		<input>T4T/forces/h-stab_left/drag-lbs</input>
		<input>T4T/forces/h-stab_right/drag-lbs</input>
	</summer>

	<summer name="T4T/forces/DRAG-lbs">
		<input>T4T/forces/wing/drag-lbs</input>
		<input>T4T/forces/v-stab/drag-lbs</input>		
		<input>T4T/forces/h-stab/drag-lbs</input>
		<input>T4T/forces/fuselage/drag_parasitic-lbs</input>		
	</summer>

	</channel>

	<channel name="resultant" execute="T4T/execute">
		
	<fcs_function name="T4T/forces/LIFT2DRAG">
		<function>
			<abs>
				<quotient>			
					<property>T4T/forces/LIFT-lbs</property>					
					<property>T4T/forces/DRAG-lbs</property>
				</quotient>
			</abs>
		</function>	
	</fcs_function>
	
	<!-- ####   wing   #### -->

	<pure_gain>
		<gain>1</gain>
		<input>-T4T/forces/wing/lift-lbs</input>
		<output>external_reactions/wing/z</output>					
	</pure_gain>

	<pure_gain>
		<gain>1</gain>
		<input>-T4T/forces/wing/side-lbs</input>
		<output>external_reactions/wing/y</output>					
	</pure_gain>	
	
	<pure_gain>
		<gain>1</gain>
		<input>-T4T/forces/wing/drag-lbs</input>
		<output>external_reactions/wing/x</output>					
	</pure_gain>
	
	
	<!-- ####   v-stab   #### -->
		
	<pure_gain>
		<gain>1</gain>
		<input>T4T/forces/v-stab/lift-lbs</input>
		<output>external_reactions/v-stab/y</output>				
	</pure_gain>
	
	<pure_gain>
		<gain>1</gain>
		<input>-T4T/forces/v-stab/drag-lbs</input>
		<output>external_reactions/v-stab/x</output>					
	</pure_gain>
		
	<!-- ####   h-stab   #### -->
	
	<pure_gain>
		<gain>1</gain>
		<input>-T4T/forces/h-stab/lift-lbs</input>
		<output>external_reactions/h-stab/z</output>					
	</pure_gain>

	<pure_gain>
		<gain>1</gain>
		<input>-T4T/forces/h-stab/side-lbs</input>
		<output>external_reactions/h-stab/y</output>					
	</pure_gain>	
	
	<pure_gain>
		<gain>1</gain>
		<input>-T4T/forces/h-stab/drag-lbs</input>
		<output>external_reactions/h-stab/x</output>					
	</pure_gain>
	
	
	<!-- ####   drag   #### -->
	
	<pure_gain>
		<gain>1</gain>
		<input>-T4T/forces/fuselage/drag_parasitic-lbs</input>
		<output>external_reactions/drag/x</output>					
	</pure_gain>	
		
	</channel>

	
</system>