<?xml version="1.0"?>
<aerodynamics>
	<!--includes stall/spin adjustments ported and adjusted from the c172p, thanks!-->
	<!--(ported from C172p:) ground effect-->
	<function name="aero/function/Cl_groundeffect">
		<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>
	<function name="aero/function/Cd_groundeffect">
		<description>Change in drag due to ground effect</description>
		<table>
			<independentVar>aero/h_b-mac-ft</independentVar>
			<tableData>
				0.0000	0.4800
				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>
	<axis name="LIFT">
		<function name="aero/force/Lift_alpha">
			<description>Lift due to alpha</description>
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sw-sqft</property>
				<property>aero/function/Cl_groundeffect</property>
				<table>
					<independentVar lookup="row">aero/alpha-deg</independentVar>
					<tableData>
						<!---25.000  -0.7431-->
							<!--Cl calculated by XFLR5 for wing profile-->
						<!--	-10        -0.2114232  
							-9.5        -0.1485309  
							-9       -0.08491845  
							-8.5       -0.02107381  
							-8      -0.003404671  
							-7.5        0.03792067  
							-7        0.02700769  
							-6.5        0.02558893  
							-6        0.05652333  
							-5.5        0.01829636  
							-5        0.04875606  
							-4.5        0.08175955  
							-4         0.1517395  
							-3.5         0.2374816  
							-3         0.2810282  
							-2.5         0.3290237  
							-2         0.3927343  
							-1.5         0.4516566  
							-1         0.4919005  
							-0.5         0.5220501  
							0         0.5556988  
							0.5         0.5869986  
							1         0.6147663  
							1.5         0.6462493  
							2         0.6851637  
							2.5         0.7348387  
							3         0.6919991  
							3.5         0.7105335  
							4         0.7096294  
							4.5         0.6901483  
							5          0.714597  
							6         0.8761503  
							6.5          0.684805  
							7.5         0.6952618  
							8         0.6797687  
							8.5          0.686982  
							9         0.7136271  
							9.5         0.7577944  
							10         0.8128155  
							10.5         0.7910465  
							11         0.7895326  
							11.5         0.7790306  
							12         0.7757692  
							12.5         0.7779689  
							13         0.7839645  
							13.5         0.7830556  
							14         0.7799184  
							14.5         0.7858259  
							15         0.8152433  
							15.5         0.8815265  
							16         0.9063967  
							17         0.9125933  
							17.5         0.9600516  
							18         0.9463982  
							18.5         0.9242763  
							19         0.9120852  
							19.5         0.9103771  
							20         0.9103584  
						25.000   0.9021-->
						<!--temporarily replaced by ASK21 curve, as the K13 one had serious flaws-->
						-25.000  -0.7431
						-24.500  -0.7300
						-24.000  -0.7165
						-23.500  -0.7026
						-23.000  -0.6884
						-22.500  -0.6739
						-22.000  -0.6593
						-21.500  -0.6472
						-21.000  -0.6380
						-20.500  -0.6299
						-20.000  -0.6021
						-19.500  -0.5840
						-19.000  -0.5674
						-18.500  -0.5514
						-18.000  -0.5393
						-17.500  -0.5443
						-17.000  -0.5056
						-16.500  -0.4895
						-16.000  -0.4773
						-15.500  -0.4822
						-15.000  -0.4810
						-14.500  -0.4397
						-14.000  -0.4211
						-13.500  -0.4087
						-13.000  -0.4206
						-12.500  -0.4187
						-12.000  -0.3804
						-11.500  -0.3666
						-11.000  -0.3876
						-10.500  -0.3827
						-10.000  -0.3557
						-9.500  -0.3453
						-9.000  -0.3472
						-8.500  -0.4855
						-8.000  -0.5303
						-7.500  -0.5438
						-7.000  -0.5172
						-6.500  -0.4703
						-6.000  -0.4190
						-5.500  -0.3653
						-5.000  -0.3020
						-4.500  -0.2157
						-4.000  -0.1336 
						-3.500  -0.0522
						-3.000   0.0207
						-2.500   0.0947
						-2.000   0.1655
						-1.500   0.2401
						-1.000   0.3136
						-0.500   0.3890
						0.000   0.4491
						0.500   0.5074
						1.000   0.5640 
						1.500   0.6190  
						2.000   0.6750  
						2.500   0.7281 
						3.000   0.7768 
						3.500   0.8308 
						4.000   0.8996
						4.500   0.9591
						5.000   1.0145
						5.500   1.0668
						6.000   1.1165
						6.500   1.1646
						7.000   1.2102 
						7.500   1.2504
						8.000   1.2855
						8.500   1.3164
						9.000   1.3441
						9.500   1.3720 
						10.000   1.4008
						10.500   1.4303
						11.000   1.4590
						11.500   1.4773
						12.000   1.5069
						12.500   1.5064
						13.000   1.4970
						13.500   1.4761
						14.000   1.4408 
						14.500   1.3750
						15.000   1.0996
						17.000   1.0258
						17.500   1.0427 
						18.500   1.0552
						19.000   1.0908
						19.500   1.0739
						20.000   1.0950
						20.500   1.1072 
						21.000   1.0960
						21.500   1.1110
						22.000   1.1231
						22.500   1.1193
						23.000   1.1116
						23.500   1.1087
						24.000   1.1001
						24.500   0.9191
						25.000   0.9021
						</tableData>
				</table>
				<value>1.1</value>
			</product>
		</function>
		<function name="aero/force/Lift_speedbrake">
			<description>Delta Lift due to speedbrake</description>
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sw-sqft</property>
				<property>fcs/speedbrake-pos-norm</property>
				<value>-0.02</value>
			</product>
		</function>
		<function name="aero/force/Lift_elevator">
			<description>Lift due to Elevator Deflection</description>
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sw-sqft</property>
				<property>fcs/elevator-pos-rad</property>
				<value>0.02</value>
			</product>
		</function>
	</axis>
	<axis name="DRAG">
		<function name="aero/force/Drag_basic">
			<description>Drag at zero lift</description>
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sw-sqft</property>
				<property>aero/function/Cd_groundeffect</property>
				<table>
					<independentVar lookup="row">aero/alpha-rad</independentVar>
					<tableData>
                                                        -1.57    0.2
                                                        -0.26    0.021
                                                        0.00    0.004
                                                        0.26    0.022
                                                        1.57    0.1
					</tableData>
				</table>
				<value>0.9</value>
			</product>
		</function>
		<function name="aero/force/Drag_induced">
			<description>Induced drag</description>
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sw-sqft</property>
				<property>aero/cl-squared</property>
				<property>aero/function/Cd_groundeffect</property>
				<value>0.03</value>
			</product>
		</function>
		<function name="aero/force/Drag_mach">
			<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.7      0.000
						1.10      0.023
						1.80      0.015
					</tableData>
				</table>
			</product>
		</function>
		<function name="aero/force/Drag_speedbrake">
			<description>Drag due to speedbrakes</description>
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sw-sqft</property>
				<property>fcs/speedbrake-pos-norm</property>
				<value>0.22</value>
			</product>
		</function>
		<function name="aero/force/Drag_beta">
			<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    1.230
                                                        -0.26    0.050
                                                        0.00    0.000
                                                        0.26    0.050
                                                        1.57    1.230
                                                </tableData>
				</table>
				<value>3</value>
			</product>
		</function>
		<function name="aero/force/Drag_elevator">
			<description>Drag due to Elevator Deflection</description>
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sw-sqft</property>
				<abs>
					<property>fcs/elevator-pos-norm</property>
				</abs>
				<value>0.01</value>
			</product>
		</function>
	</axis>
	<axis name="SIDE">
		<function name="aero/force/Side_beta">
			<description>Side force due to beta</description>
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sw-sqft</property>
				<property>aero/beta-rad</property>
				<value>-1</value>
			</product>
		</function>
	</axis>
	<axis name="ROLL">
		<function name="aero/moment/Roll_beta">
			<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.1</value>
				<!--
                          stall and spin (1):
                          via diedra effect.
                          Makes the higher (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.279     1
                            0.297     3.5
                        </tableData>
				</table>
			</product>
		</function>
		<function name="aero/moment/Roll_damp">
			<description>Roll moment due to roll rate</description>
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sw-sqft</property>
				<property>metrics/bw-ft</property>
				<property>aero/bi2vel</property>
				<property>velocities/p-aero-rad_sec</property>
				<value>-0.55</value>
			</product>
		</function>
		<function name="aero/moment/Roll_yaw">
			<description>Roll moment due to yaw rate</description>
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sw-sqft</property>
				<property>metrics/bw-ft</property>
				<property>aero/bi2vel</property>
				<property>velocities/r-aero-rad_sec</property>
				<value>0.15</value>
				<!--
                    <table>-->
				<!--
                            stall and spin (3):
                            yaw effect
                        -->
				<!--
                        <independentVar lookup="row">aero/alpha-wing-rad</independentVar>
                        <independentVar lookup="column">velocities/r-aero-rad_sec</independentVar>
                        <tableData>
                                    -0.15  -0.1   0    0.1   0.15
                            0.279    1      1     1    1     1
                            0.297    15     10    1    10    15
                            0.5      5      5     1    5     5
                        </tableData>
                    </table>-->
			</product>
		</function>
		<function name="aero/moment/Roll_aileron">
			<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.17</value>
				<!-- (ported from c172p:) the ailerons are less efficient and even create an opposite roll moment close to stall because deflection down makes the wing portion stall-->
				<table>
					<independentVar lookup="row">aero/alpha-deg</independentVar>
					<tableData>
                            15    1
                            16    0.3
                            18   -0.1
                        </tableData>
				</table>
			</product>
		</function>
		<function name="aero/moment/Roll_rudder">
			<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/moment/Pitch_alpha">
			<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-deg</independentVar>
					<tableData><!--hstab incidence: -2°-->
						-55.3	1	
						2       0
						59.3	-1
					</tableData>
				</table>
				<!--
					stall and spin (5):
					horizontal tail stall (for flat spin)
				-->
				<table>
					<independentVar lookup="row">aero/alpha-deg</independentVar>
					<tableData>
					20    1
					25    0.6
					35    0.4
					45    0.5
					55    0.4
					65    0.2
					90    0.1
					</tableData>
				</table>
				<value>0.6</value>
			</product>
		</function>
		<function name="aero/moment/Pitch_elevator">
			<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.7</value>
				<table>
					<independentVar lookup="row">velocities/mach</independentVar>
					<tableData>
					0.0     -0.900
					2.0     -0.600
					</tableData>
				</table>
				<!--(ported from C172p): the elevator looses efficiency when stalled-->
				<table>
					<independentVar lookup="row">fcs/elevator-pos-rad</independentVar>
					<independentVar lookup="column">aero/alpha-deg</independentVar>
					<tableData>
							20  25   35     45     55      65      90
						-0.49   1   0.7  0.3    0.1    0.1     0.1     0.1
						0       1   0.6  0.3    0.15   0.1     0.1     0.1
						0.40    1   0.9  0.8    0.7    0.6     0.5     0.4
					</tableData>
				</table>
			</product>
		</function>
		<function name="aero/moment/Pitch_damp">
			<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>-6</value>
			</product>
		</function>
		<function name="aero/moment/Pitch_alphadot">
			<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>-12</value>
			</product>
		</function>
	</axis>
	<axis name="YAW">
		<function name="aero/moment/Yaw_beta">
			<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.13</value>
			</product>
		</function>
		<function name="aero/moment/Yaw_damp">
			<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.08</value>
			</product>
		</function>
		<function name="aero/moment/Yaw_rudder">
			<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.05</value>
			</product>
		</function>
		<function name="aero/moment/Yaw_aileron">
			<description>Adverse yaw</description>
			<product>
				<property>aero/qbar-psf</property>
				<property>metrics/Sw-sqft</property>
				<property>metrics/bw-ft</property>
				<property>fcs/left-aileron-pos-rad</property>
				<!--
           <value>-0.025</value>-->
				<table>
					<independentVar lookup="row">aero/alpha-wing-rad</independentVar>
					<independentVar lookup="column">aero/beta-rad</independentVar>
					<tableData>
                                    -0.35        0           0.35
                            0       -0.0216      -0.0216     -0.0216
                            0.070   -0.039       -0.0786     -0.039
                            0.094   -0.025       -0.0504     -0.025
                        </tableData>
				</table>
			</product>
		</function>
		<function name="aero/moment/Yaw_flatspin">
			<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 (like a dead leaf).
                    r-aero-rad_sec with non-zero coefficients mainly sets the max yawing rate, if attained.
                    The coefficients set the yaw moment, thus the speed too, and the flatness of the spin.
                    Too great coefficients give an divergent effect and a non-recoverable 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
                            -3   0     -0.25
                            -1   0     0
                            0    0     0
                            1    0     0
                            3    0     0.25
                            5    0     0
                            15   0     0
                        </tableData>
				</table>
			</product>
		</function>
	</axis>
</aerodynamics>
