<?xml version="1.0"?>

<!-- McDonnell Douglas DC-10 PW JT9D-59A Engine/Thrust Limits -->
<!-- Copyright (c) 2026 Josh Davidson (Octal450) -->

<system name="DC-10: PW Engine/TCI">
	
	<property value="30">/systems/engines/limit/rated-temp</property>
	<property value="51720">/systems/engines/limit/rated-thrust</property>
	<property value="670">/systems/engines/egt-alert</property>
	<property value="685">/systems/engines/egt-redline</property>
	<property value="105">/systems/engines/n1-redline</property>
	<property value="99">/systems/engines/n2-redline</property>
	
	<channel name="Thrust Limits">
		
		<fcs_function name="/systems/engines/limit/rated-thrust-n1">
			<function>
				<table>
					<independentVar lookup="row">/position/altitude-ft</independentVar>
					<independentVar lookup="column">propulsion/tat-c</independentVar>
					<tableData>
						      -60   -30    0     30     60
						-2000  82.9  87.8  92.4   97.0  101.5
						    0  85.7  90.7  95.4  100.0  104.7
						10000  91.0  94.5  99.1  102.1  106.1
						45000  88.0  91.6  96.7  101.3  105.5
					</tableData>
				</table>
			</function>
		</fcs_function>
		
		<!-- Begin EPR temperature compensation -->
		<fcs_function name="/systems/engines/limit/n1-epr-temp-factor-ref">
			<function>
				<table>
					<independentVar lookup="row">/position/altitude-ft</independentVar>
					<tableData> <!-- Rated N1 @ 30C -->
						-2000   97.0
						    0  100.0
						10000  102.1
						45000  101.3
					</tableData>
				</table>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/n1-epr-temp-factor">
			<function>
				<max>
					<quotient>
						<property>/systems/engines/limit/n1-epr-temp-factor-ref</property>
						<property>/systems/engines/limit/rated-thrust-n1</property>
					</quotient>
					<value>0.000001</value> <!-- Prevent divide by 0 further on - shouldn't happen as this should be around 1 -->
				</max>
			</function>
		</fcs_function>
		<!-- End EPR temperature compensation -->
		
		<fcs_function name="/systems/engines/limit/milthrust-no-density"> <!-- Copy of MilThrust table without density effects -->
			<function>
				<table>
					<independentVar lookup="row">velocities/mach</independentVar>
					<independentVar lookup="column">/position/altitude-ft</independentVar>
					<tableData>
						    -10000   0       10000   20000   30000   45000   52000
						0.0  1.0000  1.0000  0.7400  0.5640  0.3920  0.2840  0.0000
						0.2  1.0000  0.9740  0.6970  0.5360  0.3850  0.2740  0.0000
						0.4  1.0000  0.9570  0.6920  0.5460  0.3870  0.2670  0.0000
						0.6  1.0000  0.9410  0.7210  0.5660  0.3580  0.2310  0.0000
						0.8  1.0000  1.0200  0.7820  0.5570  0.3040  0.2060  0.0000
						0.9  1.0000  1.0200  0.7820  0.5220  0.2710  0.1270  0.0000
						1.0  1.0000  0.9510  0.7210  0.4410  0.1740  0.0580  0.0000
						1.2  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000
					</tableData>
				</table>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/milthrust-density"> <!-- Copy of MilThrust table with density effects -->
			<function>
				<table>
					<independentVar lookup="row">velocities/mach</independentVar>
					<independentVar lookup="column">atmosphere/density-altitude</independentVar>
					<tableData>
						    -10000   0       10000   20000   30000   45000   52000
						0.0  1.2600  1.0000  0.7400  0.5640  0.3920  0.2840  0.0000
						0.2  1.1710  0.9740  0.6970  0.5360  0.3850  0.2740  0.0000
						0.4  1.1500  0.9570  0.6920  0.5460  0.3870  0.2670  0.0000
						0.6  1.1810  0.9410  0.7210  0.5660  0.3580  0.2310  0.0000
						0.8  1.2290  1.0200  0.7820  0.5570  0.3040  0.2060  0.0000
						0.9  1.2580  1.0200  0.7820  0.5220  0.2710  0.1270  0.0000
						1.0  1.1810  0.9510  0.7210  0.4410  0.1740  0.0580  0.0000
						1.2  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000
					</tableData>
				</table>
			</function>
		</fcs_function>
		
		<!-- Following functions fix a FGTurbine inaccuracy... rated thrust N1% should be rated thrust lbs -->
		<!-- These calculations change it so that the rated power at sea level is at the correct N1% value. It still changes with altitude and mach as it should -->
		<fcs_function name="/systems/engines/limit/rated-thrust-target"> <!-- Thrust it should produce at the rated N1 -->
			<function>
				<sum>
					<product>
						<property>propulsion/engine[0]/IdleThrust</property> <!-- It doesn't matter which engine, same for all -->
						<property>/systems/engines/limit/rated-thrust</property>
					</product>
					<product>
						<difference>
							<property>/systems/engines/limit/rated-thrust</property>
							<product>
								<property>propulsion/engine[0]/IdleThrust</property> <!-- It doesn't matter which engine, same for all -->
								<property>/systems/engines/limit/rated-thrust</property>
							</product>
						</difference>
						<property>/systems/engines/limit/milthrust-no-density</property>
					</product>
				</sum>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/rated-thrust-actual"> <!-- Actual thrust that FGTurbine would produce at the rated N1 -->
			<function>
				<sum>
					<product>
						<property>propulsion/engine[0]/IdleThrust</property> <!-- It doesn't matter which engine, same for all -->
						<property>/systems/engines/limit/rated-thrust</property>
					</product>
					<product>
						<product>
							<difference>
								<property>/systems/engines/limit/rated-thrust</property>
								<product>
									<property>propulsion/engine[0]/IdleThrust</property> <!-- It doesn't matter which engine, same for all -->
									<property>/systems/engines/limit/rated-thrust</property>
								</product>
							</difference>
							<property>/systems/engines/limit/milthrust-density</property>
						</product>
						<pow>
							<quotient>
								<difference>
									<property>/systems/engines/limit/rated-thrust-n1</property>
									<value>24.7</value>
								</difference>
								<value>80.3</value>
							</quotient>
							<value>2</value>
						</pow>
					</product>
				</sum>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/rated-thrust-factor">
			<function>
				<ifthen>
					<eq>
						<property>/systems/acconfig/autoconfig-running</property>
						<value>1</value>
					</eq>
					<value>0</value>
					<ifthen>
						<nq> <!-- Prevent divide by 0 -->
							<property>/systems/engines/limit/rated-thrust-actual</property>
							<value>0</value>
						</nq>
						<quotient>
							<property>/systems/engines/limit/rated-thrust-target</property>
							<property>/systems/engines/limit/rated-thrust-actual</property>
						</quotient>
						<value>1</value>
					</ifthen>
				</ifthen>
			</function>
		</fcs_function>
		
		<!-- 
		Thrust limits on the PW are tricky because of the EPR model not being 100% accurate, so instead I computed N1s.
		The GE's just use N1, which is linear so it works well to make the FADEC, but as stated primary param is EPR.
		So we have our basic thrust limits in N1 created from tables and other factors, then we calculate them to EPR.
		After we round the EPR, in order to correctly control/limit thrust, we will convert it BACK to N1... annoying right?
		Well the advantage is the plane is actually targetting EPR, so its more realistic to do this way even if its more steps
		I think that's better than just pretending to use EPR, and actually using N1 - if you look close enough, you can tell!
		-->
		<fcs_function name="/systems/engines/limit/takeoff-table">
			<function>
				<table>
					<independentVar lookup="row">/position/altitude-ft</independentVar>
					<independentVar lookup="column">propulsion/tat-c</independentVar>
					<tableData>
						      -60   -50   -40   -30   -20    -10     0      10     20     30     40    50    60
						-2000  82.9  84.5  86.3  87.8   89.4   91.0   92.4   94.0   95.4   97.0  97.0  95.6  94.5
						-1000  84.3  86.0  87.6  89.2   90.9   92.4   94.0   95.5   97.0   98.5  97.7  96.3  94.9
						    0  85.7  87.4  89.1  90.7   92.3   93.9   95.4   97.0   98.5  100.0  98.4  96.9  95.3
						 1000  86.3  88.0  89.7  91.4   93.0   94.6   96.1   97.6   99.2  100.0  98.5  96.7  95.4
						 2000  86.9  88.6  90.4  92.0   93.6   95.2   96.8   98.2   99.9  100.0  98.4  96.6  95.5
						 3000  87.5  89.3  91.0  92.7   94.3   95.8   97.4   98.9  100.5  100.0  98.2  96.6  95.6
						 4000  88.2  89.9  91.6  93.3   94.9   96.4   98.0   99.5  101.1  100.0  98.1  96.8  95.7
						 5000  88.9  90.6  92.3  94.0   95.5   97.1   98.6  100.1  101.7   99.9  97.9  96.8  95.7
						 6000  89.4  91.1  92.8  94.5   96.1   97.6   99.1  100.6  101.7   99.9  97.9  96.8  95.6
						 7000  90.1  91.9  93.5  95.2   96.9   98.5   99.9  101.5  101.7   99.8  97.9  96.9  96.0
						 8000  90.8  92.6  94.3  96.0   97.6   99.3  100.8  102.3  101.6   99.6  98.0  96.9  96.9
						 9000  91.2  93.0  94.7  96.4   98.1   99.7  101.2  102.8  101.5   99.6  98.1  97.0  97.0
						10000  91.6  93.4  95.2  96.9   98.5  100.1  101.7  103.1  101.3   99.6  98.2  97.1  97.1
						11000  92.2  94.0  95.8  97.5   99.2  100.8  102.3  103.3  101.2   99.5  98.4  98.4  98.4
						12000  92.8  94.6  96.4  98.2   99.9  101.5  103.0  103.2  101.1   99.5  98.6  98.6  98.6
						13000  93.2  95.1  96.9  98.6  100.3  101.9  103.5  103.0  101.1   99.6  98.7  98.7  98.7
						14000  93.6  95.5  97.2  99.0  100.7  102.3  103.9  102.9  101.1   99.7  98.8  98.8  98.8
					</tableData>
				</table>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/takeoff-input">
			<function>
				<pow>
					<product>
						<property>/systems/engines/limit/takeoff-table</property>
						<property>/systems/engines/limit/n1-epr-temp-factor</property>
					</product>
					<value>3.5</value>
				</pow>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/takeoff-ref">
			<function>
				<sum>
					<product>
						<table>
							<independentVar lookup="row">/systems/engines/limit/takeoff-input</independentVar>
							<tableData>
								   74862.6  0.03
								11862126.4  1.00
								17793189.6  1.50
							</tableData>
						</table>
						<property>/systems/engines/epr/c1</property>
					</product>
					<property>/systems/engines/epr/c2</property>
				</sum>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/takeoff">
			<function>
				<quotient>
					<floor>
						<sum>
							<product>
								<property>/systems/engines/limit/takeoff-ref</property>
								<value>1000</value>
							</product>
							<value>0.5</value> <!-- Make it round correctly -->
						</sum>
					</floor>
					<value>1000</value>
				</quotient>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/altn-takeoff-table">
			<function>
				<table>
					<independentVar lookup="row">/position/altitude-ft</independentVar>
					<independentVar lookup="column">propulsion/tat-c</independentVar>
					<tableData>
						      -60   -50   -40   -30   -20   -10    0      10     20    30    40    50    60
						-2000  80.6  82.2  83.8  85.3  86.8  88.3   89.7   91.2  92.6  94.1  94.1  92.8  91.7
						-1000  81.9  83.6  85.1  86.7  88.2  89.7   91.2   92.7  94.1  95.6  94.8  93.4  92.1
						    0  83.2  84.9  86.5  88.1  89.6  91.1   92.6   94.1  95.6  97.0  95.5  94.0  92.5
						 1000  83.8  85.5  87.1  88.7  90.3  91.8   93.3   94.7  96.2  97.0  95.6  93.8  92.6
						 2000  84.5  86.1  87.7  89.3  90.9  92.3   93.9   95.3  96.9  97.0  95.5  93.7  92.7
						 3000  85.0  86.8  88.3  90.0  91.5  93.0   94.5   96.0  97.4  97.0  95.3  93.7  92.8
						 4000  85.7  87.3  89.0  90.5  92.1  93.6   95.1   96.5  98.0  97.0  95.1  93.9  92.8
						 5000  86.3  88.0  89.6  91.2  92.7  94.2   95.6   97.1  98.6  97.0  95.0  93.9  92.8
						 6000  86.8  88.5  90.1  91.7  93.3  94.7   96.1   97.6  98.6  97.0  95.0  93.9  92.8
						 7000  87.5  89.2  90.8  92.4  94.0  95.6   97.0   98.4  98.7  96.8  95.0  94.0  93.2
						 8000  88.2  89.9  91.5  93.2  94.7  96.3   97.8   99.3  98.5  96.6  95.1  94.0  94.0
						 9000  88.6  90.3  91.9  93.6  95.1  96.7   98.2   99.7  98.4  96.6  95.1  94.2  94.2
						10000  88.9  90.6  92.3  94.0  95.6  97.1   98.6  100.0  98.3  96.6  95.3  94.2  94.2
						11000  89.6  91.3  92.9  94.6  96.2  97.8   99.3  100.2  98.2  96.5  95.5  95.5  95.5
						12000  90.1  91.9  93.6  95.2  96.9  98.4   99.9  100.1  98.1  96.5  95.6  95.6  95.6
						13000  90.5  92.3  94.0  95.6  97.3  98.8  100.3   99.9  98.1  96.6  95.7  95.7  95.7
						14000  90.9  92.7  94.3  96.0  97.7  99.3  100.7   99.7  98.1  96.7  95.8  95.8  95.8
					</tableData>
				</table>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/altn-takeoff-input">
			<function>
				<pow>
					<product>
						<property>/systems/engines/limit/altn-takeoff-table</property>
						<property>/systems/engines/limit/n1-epr-temp-factor</property>
					</product>
					<value>3.5</value>
				</pow>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/altn-takeoff-ref">
			<function>
				<sum>
					<product>
						<table>
							<independentVar lookup="row">/systems/engines/limit/altn-takeoff-input</independentVar>
							<tableData>
								   74862.6  0.03
								11862126.4  1.00
								17793189.6  1.50
							</tableData>
						</table>
						<property>/systems/engines/epr/c1</property>
					</product>
					<property>/systems/engines/epr/c2</property>
				</sum>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/altn-takeoff">
			<function>
				<quotient>
					<floor>
						<sum>
							<product>
								<property>/systems/engines/limit/altn-takeoff-ref</property>
								<value>1000</value>
							</product>
							<value>0.5</value> <!-- Make it round correctly -->
						</sum>
					</floor>
					<value>1000</value>
				</quotient>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/go-around-table">
			<function>
				<table>
					<independentVar lookup="row">/position/altitude-ft</independentVar>
					<independentVar lookup="column">propulsion/tat-c</independentVar>
					<tableData>
						      -60   -50   -40   -30   -20    -10     0      10     20     30    40    50    60
						-2000  82.7  84.3  86.0  87.5   89.2   90.7   92.2   93.7   95.2  96.7  96.7  95.3  94.2
						-1000  84.0  85.7  87.4  89.0   90.6   92.2   93.7   95.2   96.7  98.2  97.5  96.0  94.6
						    0  85.4  87.1  88.8  90.4   92.1   93.6   95.2   96.7   98.2  99.8  98.2  96.6  95.1
						 1000  86.0  87.8  89.4  91.1   92.8   94.3   95.8   97.4   98.9  99.8  98.2  96.4  95.2
						 2000  86.6  88.3  90.0  91.6   93.3   94.8   96.4   97.9   99.5  99.7  98.1  96.3  95.2
						 3000  87.2  89.0  90.6  92.3   94.0   95.5   97.0   98.6  100.1  99.7  97.9  96.3  95.2
						 4000  87.9  89.6  91.3  92.9   94.6   96.1   97.6   99.2  100.7  99.7  97.7  96.4  95.3
						 5000  88.6  90.3  92.0  93.6   95.2   96.8   98.2   99.8  101.3  99.6  97.6  96.4  95.3
						 6000  89.2  90.9  92.6  94.2   95.8   97.4   98.8  100.4  101.4  99.7  97.6  96.5  95.3
						 7000  89.8  91.6  93.2  94.9   96.5   98.2   99.6  101.1  101.4  99.4  97.6  96.5  95.7
						 8000  90.4  92.2  94.0  95.7   97.3   98.9  100.5  102.0  101.2  99.3  97.6  96.5  96.5
						 9000  90.9  92.7  94.4  96.1   97.7   99.3  100.9  102.4  101.1  99.3  97.7  96.7  96.7
						10000  91.2  93.0  94.8  96.5   98.2   99.8  101.3  102.8  101.0  99.3  97.9  96.8  96.8
						11000  91.9  93.7  95.4  97.1   98.8  100.5  102.0  102.9  100.9  99.2  98.1  98.1  98.1
						12000  92.5  94.3  96.1  97.8   99.5  101.1  102.7  102.9  100.8  99.2  98.2  98.2  98.2
						13000  92.8  94.7  96.5  98.2   99.9  101.6  103.1  102.7  100.8  99.3  98.3  98.3  98.3
						14000  93.3  95.2  96.9  98.7  100.4  102.0  103.5  102.5  100.8  99.3  98.4  98.4  98.4
					</tableData>
				</table>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/go-around-input">
			<function>
				<pow>
					<product>
						<property>/systems/engines/limit/go-around-table</property>
						<property>/systems/engines/limit/n1-epr-temp-factor</property>
					</product>
					<value>3.5</value>
				</pow>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/go-around-ref">
			<function>
				<sum>
					<product>
						<table>
							<independentVar lookup="row">/systems/engines/limit/go-around-input</independentVar>
							<tableData>
								   74862.6  0.03
								11862126.4  1.00
								17793189.6  1.50
							</tableData>
						</table>
						<property>/systems/engines/epr/c1</property>
					</product>
					<property>/systems/engines/epr/c2</property>
				</sum>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/go-around">
			<function>
				<quotient>
					<floor>
						<sum>
							<product>
								<property>/systems/engines/limit/go-around-ref</property>
								<value>1000</value>
							</product>
							<value>0.5</value> <!-- Make it round correctly -->
						</sum>
					</floor>
					<value>1000</value>
				</quotient>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/mct-table">
			<function>
				<table>
					<independentVar lookup="row">/position/altitude-ft</independentVar>
					<independentVar lookup="column">propulsion/tat-c</independentVar>
					<independentVar lookup="table">velocities/mach</independentVar>
					<tableData breakPoint="0.3">
						      -60   -30    0      30    60
						    0  80.5  85.5   90.1  94.7  91.6
						 5000  83.7  88.7   93.4  95.1  94.0
						10000  88.0  93.0   97.7  96.2  97.1
						15000  90.5  95.5  100.1  95.7  99.6
					</tableData>
					<tableData breakPoint="0.4">
						      -60   -30    0      30    60
						    0  80.0  84.9   89.5  94.0  91.9
						 5000  83.0  88.0   92.6  95.4  93.2
						10000  87.0  92.1   96.7  96.5  96.1
						15000  91.0  95.9   99.6  97.0  99.9
						20000  92.4  97.6  100.5  97.5  99.9
					</tableData>
					<tableData breakPoint="0.5">
						      -60   -30    0     30    60
						    0  79.3  84.1  88.7  93.1   92.4
						 5000  82.1  87.1  91.7  96.1   92.5
						10000  86.2  91.1  95.8  97.0   95.2
						15000  89.0  93.9  98.4  96.5   97.8
						20000  90.0  95.2  98.7  95.3   99.3
						25000  91.6  96.7  97.6  97.3  101.2
					</tableData>
					<tableData breakPoint="0.6">
						      -60   -30    0     30    60
						 5000  81.0  85.9  90.5  94.9  92.7
						10000  84.6  89.6  94.2  97.0  93.5
						15000  87.4  92.2  96.8  96.6  97.0
						20000  89.2  94.4  97.5  96.5  98.2
						25000  89.6  94.6  97.0  95.2  99.1
					</tableData>
					<tableData breakPoint="0.7">
						      -60   -30    0     30    60
						15000  85.1  89.8  94.3  96.2  93.5
						20000  87.2  92.3  96.2  96.4  96.0
						25000  87.3  92.2  96.8  95.8  96.6
						35000  91.0  95.9  94.3  95.4  98.2
						39000  90.9  95.8  93.4  95.3  98.1
						45000  91.9  95.8  92.8  95.0  97.6
					</tableData>
					<tableData breakPoint="0.8">
						      -60   -30    0     30    60
						20000  85.0  90.0  94.6  95.2  93.6
						25000  87.0  90.3  94.0  93.1  93.7
						35000  88.1  93.1  94.0  92.5  96.4
						39000  88.0  92.9  92.9  92.4  96.4
						45000  89.1  94.0  92.5  91.9  95.8
					</tableData>
				</table>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/mct-input">
			<function>
				<pow>
					<product>
						<property>/systems/engines/limit/mct-table</property>
						<property>/systems/engines/limit/n1-epr-temp-factor</property>
					</product>
					<value>3.5</value>
				</pow>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/mct-ref">
			<function>
				<sum>
					<product>
						<table>
							<independentVar lookup="row">/systems/engines/limit/mct-input</independentVar>
							<tableData>
								   74862.6  0.03
								11862126.4  1.00
								17793189.6  1.50
							</tableData>
						</table>
						<property>/systems/engines/epr/c1</property>
					</product>
					<property>/systems/engines/epr/c2</property>
				</sum>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/mct">
			<function>
				<quotient>
					<floor>
						<sum>
							<product>
								<property>/systems/engines/limit/mct-ref</property>
								<value>1000</value>
							</product>
							<value>0.5</value> <!-- Make it round correctly -->
						</sum>
					</floor>
					<value>1000</value>
				</quotient>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/climb-table">
			<function>
				<table>
					<independentVar lookup="row">/position/altitude-ft</independentVar>
					<independentVar lookup="column">propulsion/tat-c</independentVar>
					<independentVar lookup="table">velocities/mach</independentVar>
					<tableData breakPoint="0.4">
						      -60   -30    0     30    60
						 5000  79.7  84.6  89.2  92.2  90.1
						 8000  82.0  86.9  91.6  92.8  92.2
						10000  84.0  88.9  93.5  94.0  93.4
						14000  86.9  91.8  96.5  94.7  95.2
					</tableData>
					<tableData breakPoint="0.6">
						      -60   -30    0     30    60
						 5000  77.8  82.6  87.1  91.4  89.6
						10000  81.1  85.9  90.4  93.6  91.2
						14000  83.1  88.0  92.7  93.6  93.0
						20000  87.2  92.2  96.8  94.5  95.8
						25000  89.6  94.6  97.0  95.2  97.4
					</tableData>
					<tableData breakPoint="0.8">
						      -60   -30    0     30    60
						20000  82.8  87.7  92.2  93.4  92.3
						25000  84.5  89.4  94.0  92.2  93.7
						35000  88.1  93.1  94.0  92.5  94.7
						39000  88.0  92.9  92.9  92.4  94.6
						45000  89.1  94.0  92.1  91.9  94.4
					</tableData>
					<tableData breakPoint="0.85">
						      -60   -30    0     30    60
						25000  83.6  88.5  93.0  92.2  92.8
						35000  86.6  92.3  93.8  90.9  92.6
						39000  86.4  92.2  92.8  90.8  92.5
						45000  87.7  92.6  92.5  90.4  92.3
					</tableData>
					<tableData breakPoint="0.87">
						      -60   -30    0     30    60
						25000  83.3  88.1  92.7  92.2  92.4
						35000  86.0  92.0  93.7  90.2  91.7
						39000  85.7  92.0  92.7  90.1  91.6
						45000  87.2  92.1  92.2  89.8  91.5
					</tableData>
				</table>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/climb-input">
			<function>
				<pow>
					<product>
						<property>/systems/engines/limit/climb-table</property>
						<property>/systems/engines/limit/n1-epr-temp-factor</property>
					</product>
					<value>3.5</value>
				</pow>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/climb-ref">
			<function>
				<sum>
					<product>
						<table>
							<independentVar lookup="row">/systems/engines/limit/climb-input</independentVar>
							<tableData>
								   74862.6  0.03
								11862126.4  1.00
								17793189.6  1.50
							</tableData>
						</table>
						<property>/systems/engines/epr/c1</property>
					</product>
					<property>/systems/engines/epr/c2</property>
				</sum>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/climb">
			<function>
				<quotient>
					<floor>
						<sum>
							<product>
								<property>/systems/engines/limit/climb-ref</property>
								<value>1000</value>
							</product>
							<value>0.5</value> <!-- Make it round correctly -->
						</sum>
					</floor>
					<value>1000</value>
				</quotient>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/altn-climb-table">
			<function>
				<table>
					<independentVar lookup="row">/position/altitude-ft</independentVar>
					<independentVar lookup="column">propulsion/tat-c</independentVar>
					<independentVar lookup="table">velocities/mach</independentVar>
					<tableData breakPoint="0.4">
						      -60   -30    0     30    60
						 5000  77.6  82.2  86.7  89.6  87.5
						 8000  79.7  84.5  88.9  90.1  89.6
						10000  81.7  86.3  90.8  91.2  90.7
						14000  84.4  89.1  93.7  91.9  92.4
					</tableData>
					<tableData breakPoint="0.6">
						      -60   -30    0     30    60
						 5000  75.7  80.3  84.6  88.7  87.0
						10000  78.9  83.5  87.7  90.9  88.6
						14000  80.8  85.5  90.0  90.9  90.3
						20000  84.7  89.5  93.9  91.7  93.0
						25000  87.0  91.9  94.2  92.4  94.5
					</tableData>
					<tableData breakPoint="0.8">
						      -60   -30    0     30    60
						20000  80.5  85.2  89.6  90.7  89.6
						25000  82.1  86.8  91.2  89.6  91.0
						35000  85.6  90.4  91.2  89.8  91.9
						39000  85.5  90.2  90.2  89.7  91.9
						45000  86.5  91.2  89.4  89.2  91.6
					</tableData>
					<tableData breakPoint="0.85">
						      -60   -30    0     30    60
						25000  81.3  85.9  90.3  89.6  90.0
						35000  84.1  89.6  91.0  88.2  89.9
						39000  84.0  89.6  90.0  88.2  89.8
						45000  85.2  89.9  89.8  87.7  89.6
					</tableData>
					<tableData breakPoint="0.87">
						      -60   -30    0     30    60
						25000  80.9  85.6  90.0  89.6  89.7
						35000  83.6  89.3  91.0  87.6  89.1
						39000  83.3  89.3  90.0  87.5  89.0
						45000  84.7  89.4  89.6  87.2  88.8
					</tableData>
				</table>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/altn-climb-input">
			<function>
				<pow>
					<product>
						<property>/systems/engines/limit/altn-climb-table</property>
						<property>/systems/engines/limit/n1-epr-temp-factor</property>
					</product>
					<value>3.5</value>
				</pow>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/altn-climb-ref">
			<function>
				<sum>
					<product>
						<table>
							<independentVar lookup="row">/systems/engines/limit/altn-climb-input</independentVar>
							<tableData>
								   74862.6  0.03
								11862126.4  1.00
								17793189.6  1.50
							</tableData>
						</table>
						<property>/systems/engines/epr/c1</property>
					</product>
					<property>/systems/engines/epr/c2</property>
				</sum>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/altn-climb">
			<function>
				<quotient>
					<floor>
						<sum>
							<product>
								<property>/systems/engines/limit/altn-climb-ref</property>
								<value>1000</value>
							</product>
							<value>0.5</value> <!-- Make it round correctly -->
						</sum>
					</floor>
					<value>1000</value>
				</quotient>
			</function>
		</fcs_function>
		
		<switch name="/systems/engines/limit/active">
			<default value="2"/>
			<test value="/systems/engines/limit/active">
				/systems/engines/limit/active-mode-int eq -1
			</test>
			<test value="/systems/engines/limit/active">
				<test logic="OR">
					/systems/engines/limit/active-mode-int eq 0
					/systems/engines/limit/active-mode-int eq 1
				</test>
				/instrumentation/airspeed-indicator/indicated-speed-kt ge 30
			</test>
			<test value="/systems/engines/limit/takeoff">
				/systems/engines/limit/active-mode-int eq 0
			</test>
			<test value="/systems/engines/limit/altn-takeoff">
				/systems/engines/limit/active-mode-int eq 1
			</test>
			<test value="/systems/engines/limit/go-around">
				/systems/engines/limit/active-mode-int eq 2
			</test>
			<test value="/systems/engines/limit/mct">
				/systems/engines/limit/active-mode-int eq 3
			</test>
			<test value="/systems/engines/limit/climb">
				/systems/engines/limit/active-mode-int eq 4
			</test>
			<test value="/systems/engines/limit/altn-climb">
				/systems/engines/limit/active-mode-int eq 5
			</test>
		</switch>
		
		<fcs_function name="/systems/engines/limit/active-norm-ref"> <!-- Opposite of EPR Calc -->
			<function>
				<quotient>
					<difference>
						<property>/systems/engines/limit/active</property>
						<property>/systems/engines/epr/c2</property>
					</difference>
					<max> <!-- Prevent divide by 0 -->
						<property>/systems/engines/epr/c1</property>
						<value>0.001</value>
					</max>
				</quotient>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/active-norm-input"> <!-- Opposite of EPR Calc -->
			<function>
				<quotient>
					<pow>
						<table>
							<independentVar lookup="row">/systems/engines/limit/active-norm-ref</independentVar>
							<tableData>
								0.03     74862.6
								1.00  11862126.4
								1.50  17793189.6
							</tableData>
						</table>
						<quotient>
							<value>1</value>
							<value>3.5</value>
						</quotient>
					</pow>
					<property>/systems/engines/limit/n1-epr-temp-factor</property>
				</quotient>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/active-norm">
			<function>
				<table>
					<independentVar lookup="row">/systems/engines/limit/active-norm-input</independentVar>
					<tableData>
						 24.7  0
						105.0  1
					</tableData>
				</table>
			</function>
			<output>/it-autoflight/settings/autothrottle-max</output>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/highest">
			<function>
				<max>
					<property>/systems/engines/limit/climb</property>
					<property>/systems/engines/limit/go-around</property>
					<property>/systems/engines/limit/mct</property>
					<property>/systems/engines/limit/takeoff</property>
				</max>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/highest-norm-ref"> <!-- Opposite of EPR Calc -->
			<function>
				<quotient>
					<difference>
						<property>/systems/engines/limit/highest</property>
						<property>/systems/engines/epr/c2</property>
					</difference>
					<max> <!-- Prevent divide by 0 -->
						<property>/systems/engines/epr/c1</property>
						<value>0.001</value>
					</max>
				</quotient>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/highest-norm-input"> <!-- Opposite of EPR Calc -->
			<function>
				<quotient>
					<pow>
						<table>
							<independentVar lookup="row">/systems/engines/limit/highest-norm-ref</independentVar>
							<tableData>
								0.03     74862.6
								1.00  11862126.4
								1.50  17793189.6
							</tableData>
						</table>
						<quotient>
							<value>1</value>
							<value>3.5</value>
						</quotient>
					</pow>
					<property>/systems/engines/limit/n1-epr-temp-factor</property>
				</quotient>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/highest-norm">
			<function>
				<table>
					<independentVar lookup="row">/systems/engines/limit/highest-norm-input</independentVar>
					<tableData>
						 24.7  0
						105.0  1
					</tableData>
				</table>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/idle"> <!-- No rounding, this is analog -->
			<function>
				<ifthen>
					<eq>
						<property>gear/unit[0]/WOW</property>
						<value>0</value>
					</eq>
					<table>
						<independentVar lookup="row">velocities/mach</independentVar>
						<independentVar lookup="column">/systems/fcs/flaps/input</independentVar> <!-- Take advantage of table interpolation, values same -->
						<independentVar lookup="table">/position/altitude-ft</independentVar>
						<tableData breakPoint="0">
							      0     1
							0.21  30.3  30.3
							0.70  38.1  38.1
						</tableData>
						<tableData breakPoint="45000">
							      0     1
							0.55  47.3  47.3
							0.90  53.0  53.0
						</tableData>
					</table>
					<value>0</value>
				</ifthen>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/idle-norm">
			<function>
				<table>
					<independentVar lookup="row">/systems/engines/limit/idle</independentVar>
					<tableData>
						 24.7  0
						105.0  1
					</tableData>
				</table>
			</function>
			<output>/it-autoflight/settings/autothrottle-min</output>
		</fcs_function>
	
	</channel>
	
	<channel name="Reversers">
		
		<!-- Engine 1 -->
		<switch name="/systems/engines/reverse-1/position-cmd">
			<default value="0"/>
			<test value="1">
				/systems/engines/reverse-1/engage eq 1
			</test>
			<test logic="AND" value="1"> <!-- Don't stow until thrust is reduced enough -->
				/engines/engine[0]/n1-actual ge 40
				/systems/engines/reverse-1/position-cmd eq 1
			</test>
			<output>/systems/engines/reverse-1/position-cmd-out</output>
		</switch>
		
		<switch name="/systems/engines/reverse-1/position-rate">
			<default value="0"/>
			<test logic="OR" value="1">
				/systems/hydraulics/sys-1-psi ge 2200
				/systems/acconfig/autoconfig-running eq 1
			</test>
		</switch>
		
		<actuator name="/systems/engines/reverse-1/position-norm">
			<input>/systems/engines/reverse-1/position-cmd</input>
			<rate_limit>/systems/engines/reverse-1/position-rate</rate_limit>
			<output>/engines/engine[0]/reverser-pos-norm</output>
		</actuator>
		
		<pure_gain name="propulsion/engine[0]/reverser-angle-rad">
			<input>/systems/engines/reverse-1/position-norm</input>
			<gain>3.14</gain>
		</pure_gain>
		
		<switch name="/systems/engines/reverse-1/interlock"> <!-- Locked until 60% open, unlocked until 20% closed -->
			<default value="/systems/engines/reverse-1/interlock"/>
			<test value="0">
				/engines/engine[0]/reverser-pos-norm ge 0.6
			</test>
			<test value="1">
				/engines/engine[0]/reverser-pos-norm le 0.2
			</test>
		</switch>
		
		<fcs_function name="/systems/engines/reverse-1/throttle-rev-cmd">
			<function>
				<ifthen>
					<eq>
						<property>/systems/engines/reverse-1/position-norm</property>
						<value>1</value>
					</eq>
					<table>
						<independentVar lookup="row">/controls/engines/engine[0]/throttle</independentVar>
						<tableData>
							0.05  0.00
							1.00  0.82
						</tableData>
					</table>
					<value>0</value>
				</ifthen>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/reverse-1/throttle-lever">
			<function>
				<product>
					<property>/systems/engines/reverse-1/engage</property>
					<table>
						<independentVar lookup="row">/systems/engines/reverse-1/throttle-rev-cmd</independentVar>
						<tableData>
							0.05  0.25
							0.82  1.00
						</tableData>
					</table>
				</product>
			</function>
		</fcs_function>
		
		<switch name="/systems/engines/reverse-1/throttle-rev">
			<default value="0"/>
			<test value="0">
				/systems/engines/reverse-1/interlock eq 1
			</test>
			<test value="/systems/engines/reverse-1/throttle-rev-cmd">
				/systems/engines/reverse-1/engage eq 1
			</test>
		</switch>
		
		<switch name="/systems/engines/reverse-1/active">
			<default value="0"/>
			<test logic="OR" value="1">
				/systems/engines/reverse-1/position-cmd eq 1
				/systems/engines/reverse-1/position-norm ne 0
			</test>
		</switch>
		
		<!-- Engine 2 -->
		<switch name="/systems/engines/reverse-2/position-cmd">
			<default value="0"/>
			<test value="1">
				/systems/engines/reverse-2/engage eq 1
			</test>
			<test logic="AND" value="1"> <!-- Don't stow until thrust is reduced enough -->
				/engines/engine[1]/n1-actual ge 40
				/systems/engines/reverse-2/position-cmd eq 1
			</test>
			<output>/systems/engines/reverse-2/position-cmd-out</output>
		</switch>
		
		<switch name="/systems/engines/reverse-2/position-cmd-wow">
			<default value="/systems/engines/reverse-2/position-cmd"/>
			<test logic="AND" value="0">
				/gear/gear[0]/wow ne 1
				/systems/engines/reverse-2/position-cmd-wow eq 0
			</test>
		</switch>
		
		<switch name="/systems/engines/reverse-2/position-rate">
			<default value="0"/>
			<test logic="OR" value="1">
				/systems/hydraulics/sys-2-psi ge 2200
				/systems/acconfig/autoconfig-running eq 1
			</test>
		</switch>
		
		<actuator name="/systems/engines/reverse-2/position-norm">
			<input>/systems/engines/reverse-2/position-cmd-wow</input>
			<rate_limit>/systems/engines/reverse-2/position-rate</rate_limit>
			<output>/engines/engine[1]/reverser-pos-norm</output>
		</actuator>
		
		<pure_gain name="propulsion/engine[1]/reverser-angle-rad">
			<input>/systems/engines/reverse-2/position-norm</input>
			<gain>3.14</gain>
		</pure_gain>
		
		<switch name="/systems/engines/reverse-2/interlock"> <!-- Locked until 60% open, unlocked until 20% closed -->
			<default value="/systems/engines/reverse-2/interlock"/>
			<test value="0">
				/engines/engine[1]/reverser-pos-norm ge 0.6
			</test>
			<test value="1">
				/engines/engine[1]/reverser-pos-norm le 0.2
			</test>
		</switch>
		
		<fcs_function name="/systems/engines/reverse-2/throttle-rev-cmd">
			<function>
				<ifthen>
					<eq>
						<property>/systems/engines/reverse-2/position-norm</property>
						<value>1</value>
					</eq>
					<table>
						<independentVar lookup="row">/controls/engines/engine[1]/throttle</independentVar>
						<tableData>
							0.05  0.00
							1.00  0.82
						</tableData>
					</table>
					<value>0</value>
				</ifthen>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/reverse-2/throttle-lever">
			<function>
				<product>
					<property>/systems/engines/reverse-2/engage</property>
					<table>
						<independentVar lookup="row">/systems/engines/reverse-2/throttle-rev-cmd</independentVar>
						<tableData>
							0.05  0.25
							0.82  1.00
						</tableData>
					</table>
				</product>
			</function>
		</fcs_function>
		
		<switch name="/systems/engines/reverse-2/throttle-rev">
			<default value="0"/>
			<test value="0">
				/systems/engines/reverse-2/interlock eq 1
			</test>
			<test value="/systems/engines/reverse-2/throttle-rev-cmd">
				/systems/engines/reverse-2/engage eq 1
			</test>
		</switch>
		
		<switch name="/systems/engines/reverse-2/active">
			<default value="0"/>
			<test logic="OR" value="1">
				/systems/engines/reverse-2/position-cmd eq 1
				/systems/engines/reverse-2/position-norm ne 0
			</test>
		</switch>
		
		<!-- Engine 3 -->
		<switch name="/systems/engines/reverse-3/position-cmd">
			<default value="0"/>
			<test value="1">
				/systems/engines/reverse-3/engage eq 1
			</test>
			<test logic="AND" value="1"> <!-- Don't stow until thrust is reduced enough -->
				/engines/engine[2]/n1-actual ge 40
				/systems/engines/reverse-3/position-cmd eq 1
			</test>
			<output>/systems/engines/reverse-3/position-cmd-out</output>
		</switch>
		
		<switch name="/systems/engines/reverse-3/position-rate">
			<default value="0"/>
			<test logic="OR" value="1">
				/systems/hydraulics/sys-3-psi ge 2200
				/systems/acconfig/autoconfig-running eq 1
			</test>
		</switch>
		
		<actuator name="/systems/engines/reverse-3/position-norm">
			<input>/systems/engines/reverse-3/position-cmd</input>
			<rate_limit>/systems/engines/reverse-3/position-rate</rate_limit>
			<output>/engines/engine[2]/reverser-pos-norm</output>
		</actuator>
		
		<pure_gain name="propulsion/engine[2]/reverser-angle-rad">
			<input>/systems/engines/reverse-3/position-norm</input>
			<gain>3.14</gain>
		</pure_gain>
		
		<switch name="/systems/engines/reverse-3/interlock"> <!-- Locked until 60% open, unlocked until 20% closed -->
			<default value="/systems/engines/reverse-3/interlock"/>
			<test value="0">
				/engines/engine[2]/reverser-pos-norm ge 0.6
			</test>
			<test value="1">
				/engines/engine[2]/reverser-pos-norm le 0.2
			</test>
		</switch>
		
		<fcs_function name="/systems/engines/reverse-3/throttle-rev-cmd">
			<function>
				<ifthen>
					<eq>
						<property>/systems/engines/reverse-3/position-norm</property>
						<value>1</value>
					</eq>
					<table>
						<independentVar lookup="row">/controls/engines/engine[2]/throttle</independentVar>
						<tableData>
							0.05  0.00
							1.00  0.82
						</tableData>
					</table>
					<value>0</value>
				</ifthen>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/reverse-3/throttle-lever">
			<function>
				<product>
					<property>/systems/engines/reverse-3/engage</property>
					<table>
						<independentVar lookup="row">/systems/engines/reverse-3/throttle-rev-cmd</independentVar>
						<tableData>
							0.05  0.25
							0.82  1.00
						</tableData>
					</table>
				</product>
			</function>
		</fcs_function>
		
		<switch name="/systems/engines/reverse-3/throttle-rev">
			<default value="0"/>
			<test value="0">
				/systems/engines/reverse-3/interlock eq 1
			</test>
			<test value="/systems/engines/reverse-3/throttle-rev-cmd">
				/systems/engines/reverse-3/engage eq 1
			</test>
		</switch>
		
		<switch name="/systems/engines/reverse-3/active">
			<default value="0"/>
			<test logic="OR" value="1">
				/systems/engines/reverse-3/position-cmd eq 1
				/systems/engines/reverse-3/position-norm ne 0
			</test>
		</switch>
	
	</channel>
	
	<channel name="Engine Control">
		
		<!-- Engine 1 -->
		<fcs_function name="/systems/engines/limit/man-1-norm-ref"> <!-- Opposite of EPR Calc -->
			<function>
				<quotient>
					<difference>
						<property>/controls/engines/engine[0]/man-epr</property>
						<property>/systems/engines/epr/c2</property>
					</difference>
					<max> <!-- Prevent divide by 0 -->
						<property>/systems/engines/epr/c1</property>
						<value>0.001</value>
					</max>
				</quotient>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/man-1-norm-input"> <!-- Opposite of EPR Calc -->
			<function>
				<quotient>
					<pow>
						<table>
							<independentVar lookup="row">/systems/engines/limit/man-1-norm-ref</independentVar>
							<tableData>
								0.03     74862.6
								1.00  11862126.4
								1.50  17793189.6
							</tableData>
						</table>
						<quotient>
							<value>1</value>
							<value>3.5</value>
						</quotient>
					</pow>
					<property>/systems/engines/limit/n1-epr-temp-factor</property>
				</quotient>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/man-1-norm">
			<function>
				<table>
					<independentVar lookup="row">/systems/engines/limit/man-1-norm-input</independentVar>
					<tableData>
						 24.7  0
						105.0  1
					</tableData>
				</table>
			</function>
		</fcs_function>
		
		<switch name="/systems/engines/control-1/ats-max">
			<default value="/systems/engines/limit/active-norm"/>
			<test logic="AND" value="/systems/engines/limit/man-1-norm">
				/instrumentation/epr[0]/power-avail eq 1
				/controls/engines/engine[0]/man-epr-set eq 1
				/systems/engines/limit/man-1-norm le /systems/engines/limit/active-norm
			</test>
			<clipto>
				<min>/systems/engines/limit/idle-norm</min>
				<max>1.0</max>
			</clipto>
		</switch>
		
		<switch name="/systems/engines/control-1/throttle-pos">
			<default value="/controls/engines/engine[0]/throttle"/>
			<test value="0">
				/systems/engines/reverse-1/active eq 1
			</test>
			<test logic="AND" value="/systems/engines/ats-cmd-1">
				/it-autoflight/output/athr eq 1
				/it-autoflight/output/thr-mode ne 3
			</test>
		</switch>
		
		<lag_filter name="/systems/engines/control-1/throttle-pos-lag">
			<input>/systems/engines/control-1/throttle-pos</input>
			<c1>20</c1>
		</lag_filter>
		
		<switch name="/systems/engines/control-1/throttle-output">
			<default value="/systems/engines/control-1/throttle-pos"/>
			<test value="/systems/engines/reverse-1/throttle-rev">
				/systems/engines/reverse-1/active eq 1
			</test>
			<clipto>
				<min>/systems/engines/limit/idle-norm</min>
				<max>1.0</max>
			</clipto>
		</switch>
		
		<lag_filter name="/systems/engines/control-1/throttle-fdm">
			<input>/systems/engines/control-1/throttle-output</input>
			<c1>1.0</c1>
			<output>fcs/throttle-pos-norm[0]</output>
		</lag_filter>
		
		<!-- Engine 2 -->
		<fcs_function name="/systems/engines/limit/man-2-norm-ref"> <!-- Opposite of EPR Calc -->
			<function>
				<quotient>
					<difference>
						<property>/controls/engines/engine[1]/man-epr</property>
						<property>/systems/engines/epr/c2</property>
					</difference>
					<max> <!-- Prevent divide by 0 -->
						<property>/systems/engines/epr/c1</property>
						<value>0.001</value>
					</max>
				</quotient>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/man-2-norm-input"> <!-- Opposite of EPR Calc -->
			<function>
				<quotient>
					<pow>
						<table>
							<independentVar lookup="row">/systems/engines/limit/man-2-norm-ref</independentVar>
							<tableData>
								0.03     74862.6
								1.00  11862126.4
								1.50  17793189.6
							</tableData>
						</table>
						<quotient>
							<value>1</value>
							<value>3.5</value>
						</quotient>
					</pow>
					<property>/systems/engines/limit/n1-epr-temp-factor</property>
				</quotient>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/man-2-norm">
			<function>
				<table>
					<independentVar lookup="row">/systems/engines/limit/man-2-norm-input</independentVar>
					<tableData>
						 24.7  0
						105.0  1
					</tableData>
				</table>
			</function>
		</fcs_function>
		
		<switch name="/systems/engines/control-2/ats-max">
			<default value="/systems/engines/limit/active-norm"/>
			<test logic="AND" value="/systems/engines/limit/man-2-norm">
				/instrumentation/epr[1]/power-avail eq 1
				/controls/engines/engine[1]/man-epr-set eq 1
				/systems/engines/limit/man-2-norm le /systems/engines/limit/active-norm
			</test>
			<clipto>
				<min>/systems/engines/limit/idle-norm</min>
				<max>1.0</max>
			</clipto>
		</switch>
		
		<switch name="/systems/engines/control-2/throttle-pos">
			<default value="/controls/engines/engine[1]/throttle"/>
			<test value="0">
				/systems/engines/reverse-2/active eq 1
			</test>
			<test logic="AND" value="/systems/engines/ats-cmd-2">
				/it-autoflight/output/athr eq 1
				/it-autoflight/output/thr-mode ne 3
			</test>
		</switch>
		
		<lag_filter name="/systems/engines/control-2/throttle-pos-lag">
			<input>/systems/engines/control-2/throttle-pos</input>
			<c1>20</c1>
		</lag_filter>
		
		<switch name="/systems/engines/control-2/throttle-output">
			<default value="/systems/engines/control-2/throttle-pos"/>
			<test value="/systems/engines/reverse-2/throttle-rev">
				/systems/engines/reverse-2/active eq 1
			</test>
			<clipto>
				<min>/systems/engines/limit/idle-norm</min>
				<max>1.0</max>
			</clipto>
		</switch>
		
		<lag_filter name="/systems/engines/control-2/throttle-fdm">
			<input>/systems/engines/control-2/throttle-output</input>
			<c1>1.0</c1>
			<output>fcs/throttle-pos-norm[1]</output>
		</lag_filter>
		
		<!-- Engine 3 -->
		<fcs_function name="/systems/engines/limit/man-3-norm-ref"> <!-- Opposite of EPR Calc -->
			<function>
				<quotient>
					<difference>
						<property>/controls/engines/engine[2]/man-epr</property>
						<property>/systems/engines/epr/c2</property>
					</difference>
					<max> <!-- Prevent divide by 0 -->
						<property>/systems/engines/epr/c1</property>
						<value>0.001</value>
					</max>
				</quotient>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/man-3-norm-input"> <!-- Opposite of EPR Calc -->
			<function>
				<quotient>
					<pow>
						<table>
							<independentVar lookup="row">/systems/engines/limit/man-3-norm-ref</independentVar>
							<tableData>
								0.03     74862.6
								1.00  11862126.4
								1.50  17793189.6
							</tableData>
						</table>
						<quotient>
							<value>1</value>
							<value>3.5</value>
						</quotient>
					</pow>
					<property>/systems/engines/limit/n1-epr-temp-factor</property>
				</quotient>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/limit/man-3-norm">
			<function>
				<table>
					<independentVar lookup="row">/systems/engines/limit/man-3-norm-input</independentVar>
					<tableData>
						 24.7  0
						105.0  1
					</tableData>
				</table>
			</function>
		</fcs_function>
		
		<switch name="/systems/engines/control-3/ats-max">
			<default value="/systems/engines/limit/active-norm"/>
			<test logic="AND" value="/systems/engines/limit/man-3-norm">
				/instrumentation/epr[2]/power-avail eq 1
				/controls/engines/engine[2]/man-epr-set eq 1
				/systems/engines/limit/man-3-norm le /systems/engines/limit/active-norm
			</test>
			<clipto>
				<min>/systems/engines/limit/idle-norm</min>
				<max>1.0</max>
			</clipto>
		</switch>
		
		<switch name="/systems/engines/control-3/throttle-pos">
			<default value="/controls/engines/engine[2]/throttle"/>
			<test value="0">
				/systems/engines/reverse-3/active eq 1
			</test>
			<test logic="AND" value="/systems/engines/ats-cmd-3">
				/it-autoflight/output/athr eq 1
				/it-autoflight/output/thr-mode ne 3
			</test>
		</switch>
		
		<lag_filter name="/systems/engines/control-3/throttle-pos-lag">
			<input>/systems/engines/control-3/throttle-pos</input>
			<c1>20</c1>
		</lag_filter>
		
		<switch name="/systems/engines/control-3/throttle-output">
			<default value="/systems/engines/control-3/throttle-pos"/>
			<test value="/systems/engines/reverse-3/throttle-rev">
				/systems/engines/reverse-3/active eq 1
			</test>
			<clipto>
				<min>/systems/engines/limit/idle-norm</min>
				<max>1.0</max>
			</clipto>
		</switch>
		
		<lag_filter name="/systems/engines/control-3/throttle-fdm">
			<input>/systems/engines/control-3/throttle-output</input>
			<c1>1.0</c1>
			<output>fcs/throttle-pos-norm[2]</output>
		</lag_filter>
		
		<!-- Comparator -->
		<fcs_function name="/systems/engines/throttle-compare-max">
			<function>
				<max> <!-- Don't use clipped -->
					<property>/systems/engines/control-1/throttle-pos-lag</property>
					<property>/systems/engines/control-2/throttle-pos-lag</property>
					<property>/systems/engines/control-3/throttle-pos-lag</property>
				</max>
			</function>
		</fcs_function>
	
	</channel>
	
	<channel name="Engine Parameters" execrate="2">
		
		<lag_filter name="/systems/engines/n1-actual-1">
			<input>/engines/engine[0]/n1</input>
			<c1>2.25</c1>
			<output>/engines/engine[0]/n1-actual</output>
			<output>/engines/engine[4]/n1</output>
		</lag_filter>
		
		<lag_filter name="/systems/engines/n1-actual-2">
			<input>/engines/engine[1]/n1</input>
			<c1>2.25</c1>
			<output>/engines/engine[1]/n1-actual</output>
			<output>/engines/engine[5]/n1</output>
		</lag_filter>
		
		<lag_filter name="/systems/engines/n1-actual-3">
			<input>/engines/engine[2]/n1</input>
			<c1>2.25</c1>
			<output>/engines/engine[2]/n1-actual</output>
			<output>/engines/engine[6]/n1</output>
		</lag_filter>
		
		<fcs_function name="/systems/engines/epr-actual-1-ref">
			<function>
				<pow>
					<product>
						<property>/systems/engines/n1-actual-1</property>
						<property>/systems/engines/limit/n1-epr-temp-factor</property>
					</product>
					<value>3.5</value>
				</pow>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/epr-actual-1-calc">
			<function>
				<sum>
					<product>
						<table>
							<independentVar lookup="row">/systems/engines/epr-actual-1-ref</independentVar>
							<tableData>
								   74862.6  0.03
								11862126.4  1.00
								17793189.6  1.50
							</tableData>
						</table>
						<property>/systems/engines/epr/c1</property>
					</product>
					<property>/systems/engines/epr/c2</property>
				</sum>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/epr-actual-1">
			<function>
				<interpolate1d>
					<property>/systems/engines/n1-actual-1</property>
					<value>5</value><interpolate1d> <!-- Eng off EPR -->
						<property>velocities/mach</property>
						<value>0.09</value><value>1</value>
						<value>0.15</value><property>/systems/engines/epr/c2</property>
					</interpolate1d>
					<value>24.7</value><property>/systems/engines/epr-actual-1-calc</property>
				</interpolate1d>
			</function>
			<output>/engines/engine[0]/epr-actual</output>
		</fcs_function>
		
		<fcs_function name="/systems/engines/epr-actual-2-ref">
			<function>
				<pow>
					<product>
						<property>/systems/engines/n1-actual-2</property>
						<property>/systems/engines/limit/n1-epr-temp-factor</property>
					</product>
					<value>3.5</value>
				</pow>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/epr-actual-2-calc">
			<function>
				<sum>
					<product>
						<table>
							<independentVar lookup="row">/systems/engines/epr-actual-2-ref</independentVar>
							<tableData>
								   74862.6  0.03
								11862126.4  1.00
								17793189.6  1.50
							</tableData>
						</table>
						<property>/systems/engines/epr/c1</property>
					</product>
					<property>/systems/engines/epr/c2</property>
				</sum>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/epr-actual-2">
			<function>
				<interpolate1d>
					<property>/systems/engines/n1-actual-2</property>
					<value>5</value><interpolate1d> <!-- Eng off EPR -->
						<property>velocities/mach</property>
						<value>0.09</value><value>1</value>
						<value>0.15</value><property>/systems/engines/epr/c2</property>
					</interpolate1d>
					<value>24.7</value><property>/systems/engines/epr-actual-2-calc</property>
				</interpolate1d>
			</function>
			<output>/engines/engine[1]/epr-actual</output>
		</fcs_function>
		
		<fcs_function name="/systems/engines/epr-actual-3-ref">
			<function>
				<pow>
					<product>
						<property>/systems/engines/n1-actual-3</property>
						<property>/systems/engines/limit/n1-epr-temp-factor</property>
					</product>
					<value>3.5</value>
				</pow>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/epr-actual-3-calc">
			<function>
				<sum>
					<product>
						<table>
							<independentVar lookup="row">/systems/engines/epr-actual-3-ref</independentVar>
							<tableData>
								   74862.6  0.03
								11862126.4  1.00
								17793189.6  1.50
							</tableData>
						</table>
						<property>/systems/engines/epr/c1</property>
					</product>
					<property>/systems/engines/epr/c2</property>
				</sum>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/engines/epr-actual-3">
			<function>
				<interpolate1d>
					<property>/systems/engines/n1-actual-3</property>
					<value>5</value><interpolate1d> <!-- Eng off EPR -->
						<property>velocities/mach</property>
						<value>0.09</value><value>1</value>
						<value>0.15</value><property>/systems/engines/epr/c2</property>
					</interpolate1d>
					<value>24.7</value><property>/systems/engines/epr-actual-3-calc</property>
				</interpolate1d>
			</function>
			<output>/engines/engine[2]/epr-actual</output>
		</fcs_function>
		
		<switch name="/systems/engines/egt-c1">
			<default value="0.35"/>
			<test value="1000">
				/systems/acconfig/autoconfig-running eq 1
			</test>
		</switch>
		
		<fcs_function name="/systems/engines/egt-cmd-1">
			<function>
				<sum>
					<property>propulsion/tat-c</property>
					<table>
						<independentVar lookup="row">/engines/engine[0]/n2</independentVar>
						<independentVar lookup="column">atmosphere/density-altitude</independentVar>
						<independentVar lookup="table">/controls/engines/engine[0]/cutoff</independentVar>
						<tableData breakPoint="0">
							        0    50000
							10.0    0    0
							35.0  520  390
							50.0  515  385
							58.9  405  270
							99.0  610  520
						</tableData>
						<tableData breakPoint="1">
							      0    50000
							30.0  0    0
							58.9  405  270
							99.0  610  520
						</tableData>
					</table>
				</sum>
			</function>
		</fcs_function>
		
		<lag_filter name="/systems/engines/egt-actual-1">
			<input>/systems/engines/egt-cmd-1</input>
			<c1>/systems/engines/egt-c1</c1>
			<output>/engines/engine[0]/egt-actual</output>
		</lag_filter>
		
		<fcs_function name="/systems/engines/egt-cmd-2">
			<function>
				<sum>
					<property>propulsion/tat-c</property>
					<table>
						<independentVar lookup="row">/engines/engine[1]/n2</independentVar>
						<independentVar lookup="column">atmosphere/density-altitude</independentVar>
						<independentVar lookup="table">/controls/engines/engine[1]/cutoff</independentVar>
						<tableData breakPoint="0">
							        0    50000
							10.0    0    0
							35.0  520  390
							50.0  515  385
							58.9  405  270
							99.0  610  520
						</tableData>
						<tableData breakPoint="1">
							      0    50000
							30.0  0    0
							58.9  405  270
							99.0  610  520
						</tableData>
					</table>
				</sum>
			</function>
		</fcs_function>
		
		<lag_filter name="/systems/engines/egt-actual-2">
			<input>/systems/engines/egt-cmd-2</input>
			<c1>/systems/engines/egt-c1</c1>
			<output>/engines/engine[1]/egt-actual</output>
		</lag_filter>
		
		<fcs_function name="/systems/engines/egt-cmd-3">
			<function>
				<sum>
					<property>propulsion/tat-c</property>
					<table>
						<independentVar lookup="row">/engines/engine[2]/n2</independentVar>
						<independentVar lookup="column">atmosphere/density-altitude</independentVar>
						<independentVar lookup="table">/controls/engines/engine[2]/cutoff</independentVar>
						<tableData breakPoint="0">
							        0    50000
							10.0    0    0
							35.0  520  390
							50.0  515  385
							58.9  405  270
							99.0  610  520
						</tableData>
						<tableData breakPoint="1">
							      0    50000
							30.0  0    0
							58.9  405  270
							99.0  610  520
						</tableData>
					</table>
				</sum>
			</function>
		</fcs_function>
		
		<lag_filter name="/systems/engines/egt-actual-3">
			<input>/systems/engines/egt-cmd-3</input>
			<c1>/systems/engines/egt-c1</c1>
			<output>/engines/engine[2]/egt-actual</output>
		</lag_filter>
		
		<lag_filter name="/systems/engines/n2-actual-1">
			<input>/engines/engine[0]/n2</input>
			<c1>2.25</c1>
			<output>/engines/engine[0]/n2-actual</output>
			<output>/engines/engine[4]/n2</output>
		</lag_filter>
		
		<lag_filter name="/systems/engines/n2-actual-2">
			<input>/engines/engine[1]/n2</input>
			<c1>2.25</c1>
			<output>/engines/engine[1]/n2-actual</output>
			<output>/engines/engine[5]/n2</output>
		</lag_filter>
		
		<lag_filter name="/systems/engines/n2-actual-3">
			<input>/engines/engine[2]/n2</input>
			<c1>2.25</c1>
			<output>/engines/engine[2]/n2-actual</output>
			<output>/engines/engine[6]/n2</output>
		</lag_filter>
		
		<lag_filter name="/systems/engines/ff-actual-1">
			<input>/engines/engine[0]/fuel-flow_pph</input>
			<c1>3.0</c1>
			<output>/engines/engine[0]/ff-actual</output>
		</lag_filter>
		
		<lag_filter name="/systems/engines/ff-actual-2">
			<input>/engines/engine[1]/fuel-flow_pph</input>
			<c1>3.0</c1>
			<output>/engines/engine[1]/ff-actual</output>
		</lag_filter>
		
		<lag_filter name="/systems/engines/ff-actual-3">
			<input>/engines/engine[2]/fuel-flow_pph</input>
			<c1>3.0</c1>
			<output>/engines/engine[2]/ff-actual</output>
		</lag_filter>
		
		<!-- Overspeed Alert -->
		<fcs_function name="/systems/engines/limit/overspeed-epr-input">
			<function>
				<sum>
					<max>
						<property>/systems/engines/epr-actual-1</property>
						<property>/systems/engines/epr-actual-2</property>
						<property>/systems/engines/epr-actual-3</property>
					</max>
					<value>-0.03</value>
				</sum>
			</function>
		</fcs_function>
		
		<switch name="/systems/engines/limit/overspeed">
			<default value="0"/>
			<test value="1">
				/systems/engines/limit/overspeed-epr-input gt /systems/engines/limit/highest
			</test>
		</switch>
	
	</channel>
	
	<channel name="Reverser Status" execrate="8">
		
		<switch name="/systems/engines/eng-1-rev-state">
			<default value="0"/>
			<test value="3"> <!-- REV -->
				/systems/engines/reverse-1/position-norm eq 1
			</test>
			<test logic="OR" value="2"> <!-- U/L -->
				/systems/engines/reverse-1/engage eq 1
				/systems/engines/reverse-1/position-norm gt 0.2
			</test>
			<test logic="OR" value="1"> <!-- PRES -->
				/systems/engines/reverse-1/engage eq 1
				/systems/engines/reverse-1/position-norm gt 0
			</test>
		</switch>
		
		<switch name="/systems/engines/eng-2-rev-state">
			<default value="0"/>
			<test value="3"> <!-- REV -->
				/systems/engines/reverse-2/position-norm eq 1
			</test>
			<test logic="OR" value="2"> <!-- U/L -->
				/systems/engines/reverse-2/engage eq 1
				/systems/engines/reverse-2/position-norm gt 0.2
			</test>
			<test logic="OR" value="1"> <!-- PRES -->
				/systems/engines/reverse-2/engage eq 1
				/systems/engines/reverse-2/position-norm gt 0
			</test>
		</switch>
		
		<switch name="/systems/engines/eng-3-rev-state">
			<default value="0"/>
			<test value="3"> <!-- REV -->
				/systems/engines/reverse-3/position-norm eq 1
			</test>
			<test logic="OR" value="2"> <!-- U/L -->
				/systems/engines/reverse-3/engage eq 1
				/systems/engines/reverse-3/position-norm gt 0.2
			</test>
			<test logic="OR" value="1"> <!-- PRES -->
				/systems/engines/reverse-3/engage eq 1
				/systems/engines/reverse-3/position-norm gt 0
			</test>
		</switch>
	
	</channel>

</system>
