<?xml version="1.0" encoding="UTF-8"?>

<aerodynamics>
	<!-- These angles for alpha. Mind the offset with alpha-wing-rad (wing incidence) -->
	<hysteresis_limits unit="RAD">
		<min>0.15</min>
		<max>0.244</max>
	</hysteresis_limits>
	<function name="aero/function/kCDge">
		<description>Change_in_drag_due_to_ground_effect</description>
		<table>
			<independentVar>aero/h_b-mac-ft</independentVar>
			<tableData>
				0.0000   0.0480
				0.1000   0.5150
				0.1500   0.6290
				0.2000   0.7090
				0.3000   0.8150
				0.4000   0.8820
				0.5000   0.9280
				0.6000   0.9620
				0.7000   0.9880
				0.8000   1.0000
				0.9000   1.0000
				1.0000   1.0000
				1.1000   1.0000
			</tableData>
		</table>
	</function>
	<function name="aero/function/kCLge">
		<description>Change_in_lift_due_to_ground_effect</description>
		<table>
			<independentVar>aero/h_b-mac-ft</independentVar>
			<tableData>
				0.0000   1.2030
				0.1000   1.1270
				0.1500   1.0900
				0.2000   1.0730
				0.3000   1.0460
				0.4000   1.0550
				0.5000   1.0190
				0.6000   1.0130
				0.7000   1.0080
				0.8000   1.0060
				0.9000   1.0030
				1.0000   1.0020
				1.1000   1.0000
			</tableData>
		</table>
	</function>
	<axis name="LIFT">
		<function name="aero/coefficient/CLalpha">
			<description>Lift_due_to_alpha</description>
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sw-sqft</property>
				<property>aero/function/kCLge</property>
				<table>
					<independentVar lookup="row">aero/alpha-wing-rad</independentVar>
					<independentVar lookup="column">aero/stall-hyst-norm</independentVar>
					<tableData>
						0        1
						-0.349   -0.538   -0.538
						-0.314   -0.566   -0.566
						-0.288   -0.627   -0.627
						-0.279   -1.129   -1.129
						-0.271   -1.156   -1.156
						-0.244   -1.084   -1.084
						-0.209   -1.004   -1.004
						0.000    0.09     0.09
						0.070    0.484    0.484
						0.175    1.075    0.75
						0.244    1.406    0.9
						0.262    1.459    0.95
						0.279    1.498    0.98
						0.305    1.522    1.03
						0.314    1.485    1.05
						0.332    1.28     1.1
						0.401    0.60     0.60
						0.524    1.47     1.47
						0.698    1.65     1.65
						0.873    1.47     1.47
						1.047    1.17     1.17
						1.571    0.01     0.01
					</tableData>
				</table>
			</product>
		</function>
		<function name="aero/coefficient/CLDf">
			<description>Delta_lift_due_to_flap_deflection</description>
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sw-sqft</property>
				<property>aero/function/kCLge</property>
				<table>
					<independentVar lookup="row">aero/alpha-wing-rad</independentVar>
					<independentVar lookup="column">fcs/flap-pos-deg</independentVar>
					<tableData>
						0   15      60
						-0.349   0   0.00    0.00
						-0.314   0   0.06   -0.15
						-0.288   0   0.06   -0.14
						-0.279   0   0.14    0.36
						-0.271   0   0.16    0.39
						-0.244   0   0.18    0.46
						-0.209   0   0.23    0.57
						0.000   0   0.31    0.68
						0.070   0   0.32    0.72
						0.175   0   0.31    0.80
						0.244   0   0.26    0.64
						0.262   0   0.24    0.59
						0.279   0   0.22    0.48
						0.305   0   0.22    0.08
						0.314   0   0.21   -0.14
						0.332   0   0.12   -0.08
						0.360   0   0.00    0.00
					</tableData>
				</table>
			</product>
		</function>
		<function name="aero/coefficient/CLde">
			<description>Lift_due_to_Elevator_Deflection</description>
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sh-sqft</property>
				<property>fcs/elevator-pos-rad</property>
				<value>0.2</value>
			</product>
		</function>
	</axis>
	<axis name="DRAG">
		<function name="aero/coefficient/CD0">
			<description>Drag_due_to_alpha</description>
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sw-sqft</property>
				<property>aero/function/kCDge</property>
				<table>
					<independentVar lookup="row">aero/alpha-wing-rad</independentVar>
					<tableData>
						-1.571    1.6000
						-0.349    0.4800
						-0.209    0.0400
						-0.105    0.0355
						-0.052    0.0344
						-0.009    0.0343
						0.018    0.0345
						0.057    0.0350
						0.080    0.0354
						0.096    0.0360
						0.115    0.0367
						0.150    0.0385
						0.209    0.0430
						0.279    0.0540
						0.349    0.4800
						1.571    1.6000
					</tableData>
				</table>
			</product>
		</function>
		<function name="aero/coefficient/CDi">
			<description>Induced_drag</description>
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sw-sqft</property>
				<property>aero/cl-squared</property>
				<value>0.066</value>
			</product>
		</function>
		<function name="aero/coefficient/CDmach">
			<description>Drag_due_to_mach</description>
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sw-sqft</property>
				<table>
					<independentVar lookup="row">velocities/mach</independentVar>
					<tableData>
						0.00      0.000
						0.65      0.000
						1.10      0.023
						1.80      0.015
					</tableData>
				</table>
			</product>
		</function>
		<function name="aero/coefficient/CDflap">
			<description>Drag_due_to_flaps</description>
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sw-sqft</property>
				<property>fcs/flap-pos-deg</property>
				<property>aero/function/kCDge</property>
				<value> 0.00060 </value>
			</product>
		</function>
		<function name="aero/coefficient/CDbeta">
			<description>Drag_due_to_sideslip</description>
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sw-sqft</property>
				<table>
					<independentVar lookup="row">aero/beta-rad</independentVar>
					<tableData>
						-1.57     0.8
						-0.26     0.040
						0.00     0.000
						0.26     0.040
						1.57     0.8
					</tableData>
				</table>
				<value>0.3</value>
			</product>
		</function>
		<function name="aero/coefficient/CDde">
			<description>Drag_due_to_Elevator_Deflection</description>
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sh-sqft</property>
				<abs>
					<property>fcs/elevator-pos-norm</property>
				</abs>
				<value>0.04</value>
			</product>
		</function>
	</axis>
	<axis name="SIDE">
		<function name="aero/coefficient/CYb">
			<description>Side_force_due_to_beta</description>
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sw-sqft</property>
				<property>aero/beta-rad</property>
				<value>-0.6</value>
			</product>
		</function>
	</axis>
	<axis name="ROLL">
		<function name="aero/coefficient/Clb">
			<description>Roll_moment_due_to_beta</description>
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sw-sqft</property>
				<property>metrics/bw-ft</property>
				<property>aero/beta-rad</property>
				<value>-0.025</value>
				<!--
				stall and spin (1): 
				via diedra effect.
				Makes the highest (downwind) wing drop at forward slip
				and worsens the spin in a skidding turn.
				But if too great, prevents the spin departure in a slipping turn
				-->
				<table>
					<independentVar lookup="row">aero/alpha-wing-rad</independentVar>
					<tableData>
						0.244     1
						0.262     3.5
					</tableData>
				</table>
			</product>
		</function>
		<function name="aero/coefficient/Clp">
			<description>Roll_moment_due_to_roll_rate (roll damping)</description>
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sw-sqft</property>
				<property>metrics/bw-ft</property>
				<property>aero/bi2vel</property>
				<table>
					<independentVar lookup="row">velocities/p-aero-rad_sec</independentVar>
					<tableData>
						-20     20
						-10     9.68
						-5      2.42
						0      0
						5     -2.42
						10    -9.68
						20    -20
					</tableData>
				</table>
				<!-- 
				stall and spin (2): 
				less roll damping
				-->
				<table>
					<independentVar lookup="row">aero/alpha-wing-rad</independentVar>
					<tableData>
						0.279    1
						0.297    0.4
					</tableData>
				</table>
			</product>
		</function>
		<function name="aero/coefficient/Clr">
			<description>Roll_moment_due_to_yaw_rate</description>
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sw-sqft</property>
				<property>metrics/bw-ft</property>
				<property>aero/bi2vel</property>
				<property>velocities/r-aero-rad_sec</property>
				<value>0.08</value>
				<!--
				stall and spin (3):
				yaw effect
				-->
				<table>
					<independentVar lookup="row">aero/alpha-wing-rad</independentVar>
					<independentVar lookup="column">velocities/r-aero-rad_sec</independentVar>
					<independentVar lookup="table">aero/stall-hyst-norm</independentVar>
					<tableData breakPoint="0">
						-0.15  -0.1   0    0.1   0.15
						0.262    1      1     1    1     1    
						0.279    4      2     1    2     4
					</tableData>
					<tableData breakPoint="1">
						-0.15  -0.1   0    0.1   0.15
						0.279    20     10    1    10   20
						0.5      2      2     1    2     2
					</tableData>
				</table>
			</product>
		</function>
		<function name="aero/coefficient/Clda">
			<description>Roll_moment_due_to_aileron</description>
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sw-sqft</property>
				<property>metrics/bw-ft</property>
				<property>fcs/left-aileron-pos-rad</property>
				<value>0.1</value>
				<!--
				stall and spin (4):
				less efficient ailerons
				-->
				<table>
					<independentVar lookup="row">aero/alpha-wing-rad</independentVar>
					<independentVar lookup="column">aero/stall-hyst-norm</independentVar>
					<tableData>
						0     1                                        
						0.279    1     0.3
						0.297    0.3   0.3
						0.611   -0.1  -0.1
					</tableData>
				</table>
			</product>
		</function>
		<function name="aero/coefficient/Cldr">
			<description>Roll_moment_due_to_rudder</description>
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sw-sqft</property>
				<property>metrics/bw-ft</property>
				<property>fcs/rudder-pos-rad</property>
				<value>-0.01</value>
			</product>
		</function>
	</axis>
	<axis name="PITCH">
		<function name="aero/coefficient/Cmo">
			<description>Pitching_moment_at_zero_alpha</description>
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sw-sqft</property>
				<property>metrics/cbarw-ft</property>
				<value>0.18</value>
			</product>
		</function>
		<function name="aero/coefficient/Cmalpha">
			<description>Pitch_moment_due_to_alpha</description>
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sw-sqft</property>
				<property>metrics/cbarw-ft</property>
				<table>
					<independentVar lookup="row">aero/alpha-wing-rad</independentVar>
					<tableData>
						-0.400   0.55
						-0.305   0.58
						-0.285   0.58
						0.285  -0.58
						0.305  -0.58
						0.400  -0.55
					</tableData>
				</table>
				<value>0.7</value>
				<!-- 
				stall and spin (5):
				horizontal tail stall (for flat spin)
				-->
				<table>
					<independentVar lookup="row">aero/alpha-deg</independentVar>
					<tableData>
						20    1  
						25    0.8
						35    0.7
					</tableData>
				</table>
			</product>
		</function>
		<function name="aero/coefficient/Cmde">
			<description>Pitch_moment_due_to_elevator</description>
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sw-sqft</property>
				<property>metrics/cbarw-ft</property>
				<property>fcs/elevator-pos-rad</property>
				<value>-1.8</value>
				<!--
				stall and spin (6):
				elevator loss of efficiency when stalled
				-->
				<table>
					<independentVar lookup="row">aero/alpha-deg</independentVar>
					<tableData>
						18    1   
						25    0.5
						35    0.2
						45    0.1
						55    0.1
						65    0.1
						90    0.1
					</tableData>
				</table>
			</product>
		</function>
		<function name="aero/coefficient/Cmflap">
			<description>Pitch_moment_due_to_flaps</description>
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sw-sqft</property>
				<property>metrics/cbarw-ft</property>
				<table>
					<independentVar lookup="row">fcs/flap-pos-deg</independentVar>
					<tableData>
						0    0
						15  -0.060
						60  -0.120
					</tableData>
				</table>
			</product>
		</function>
		<function name="aero/coefficient/Cmq">
			<description>Pitch_moment_due_to_pitch_rate</description>
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sw-sqft</property>
				<property>metrics/cbarw-ft</property>
				<property>aero/ci2vel</property>
				<property>velocities/q-aero-rad_sec</property>
				<value>-12</value>
			</product>
		</function>
		<function name="aero/coefficient/Cmadot">
			<description>Pitch_moment_due_to_alpha_rate</description>
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sw-sqft</property>
				<property>metrics/cbarw-ft</property>
				<property>aero/ci2vel</property>
				<property>aero/alphadot-rad_sec</property>
				<value>-7</value>
			</product>
		</function>
	</axis>
	<axis name="YAW">
		<function name="aero/coefficient/Cnb">
			<description>Yaw_moment_due_to_beta</description>
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sw-sqft</property>
				<property>metrics/bw-ft</property>
				<property>aero/beta-rad</property>
				<value>0.04</value>
			</product>
		</function>
		<!-- <function name="aero/coefficient/Cnpw">
		<description>Yaw_moment_due_to_spiraling_propwash</description>
		<product>
		<property>propulsion/engine/thrust-lbs</property>
		<value>-0.2</value>
		</product>
		</function> -->
		<function name="aero/coefficient/Cnr">
			<description>Yaw_moment_due_to_yaw_rate</description>
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sw-sqft</property>
				<property>metrics/bw-ft</property>
				<property>aero/bi2vel</property>
				<property>velocities/r-aero-rad_sec</property>
				<value>-0.1</value>
			</product>
		</function>
		<function name="aero/coefficient/Cnrf">
			<description>Yaw_moment_due_to_flat_spin</description>
			<!-- 
			stall and spin (7):
			Feedback loop on yaw rate for flat spin.
			Accelerates the yaw rate when stalled, up to a self-maintained flat spin.
			r-aero-rad_sec with non-zero coefficients mainly sets the max yaw rate, if attained.
			The coefficients set the yaw moment, thus the yaw rate too, and the flatness of the spin.
			Too high coefficients give a non-recoverable flat spin.
			(tricky)
			-->
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sw-sqft</property>
				<property>metrics/bw-ft</property>
				<property>aero/bi2vel</property>
				<table>
					<independentVar lookup="row">velocities/r-aero-rad_sec</independentVar>
					<independentVar lookup="column">aero/alpha-wing-rad</independentVar>
					<tableData>
						0.279  0.4
						-15   0      0         
						-5    0      0         
						-4    0     -0.43
						-1    0      0         
						0    0      0         
						1    0      0         
						4    0      0.43
						5    0      0        
						15   0      0       
					</tableData>
				</table>
			</product>
		</function>
		<function name="aero/coefficient/Cndr">
			<description>Yaw_moment_due_to_rudder</description>
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sw-sqft</property>
				<property>metrics/bw-ft</property>
				<property>fcs/rudder-pos-rad</property>
				<value>-0.04</value>
			</product>
		</function>
		<function name="aero/coefficient/Cnda">
			<description>Adverse_yaw</description>
			<!--
			stall and spin (8):
			adverse yaw: can induce a adverse turn and spin when stalled
			-->
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sw-sqft</property>
				<property>metrics/bw-ft</property>
				<!-- 
				stall and spin, flat spin
				-->
				<table>
					<independentVar lookup="row">fcs/left-aileron-pos-rad</independentVar>
					<independentVar lookup="column">aero/stall-hyst-norm</independentVar>
					<tableData>
						0      1                                        
						-1    0.02   0.04
						0    0      0
						1   -0.02  -0.04
					</tableData>
				</table>
			</product>
		</function>
	</axis>
</aerodynamics>
