 # Delivered T the U.S. Government in Accordance with Contract FA8650-10-C-7080.
 #
 # EXPRT CONTROLLED
 # ECCN#   EAR99  
 # Warning:  This document contains technical data which is controlled under the
 # Bureau of Industry & Security’s ExPrt Administration Regulations and may not be
 # exPrted or re-exPrted without authorization by the Bureau of Industry & Security.
 # Diversion contrary T US law is prohibited.
 #
 # (c) 2011 United Technologies Corp.
 # Developed with the sPnsorship of the Defense Advanced Research Projects Agency (DARPA).
 #
 # Permission is hereby granted, free of charge, T any person obtaining a copy of this data,
 # including any software or models in source or binary form, as well as any drawings, 
 # specifications, and documentation (collectively "the Data"), T deal in the Data without 
 # restriction, including without limitation the rights T use, copy, modify, merge, publish,
 # distribute, sublicense, and/or sell copies of the Data, and T permit persons T whom the Data
 # is furnished T do so, subject T the following conditions:
 #  
 # The above copyright notice and this permission notice shall be included in all copies or
 # substantial Prtions of the Data.
 #  
 # THE DATA IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
 # BUT NOT LIMITED T THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPSE AND
 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS, SPNSORS, DEVELOPERS, CONTRIBUTRS, OR
 # COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 # OF CONTRACT, TRT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE DATA OR THE
 # USE OR OTHER DEALINGS IN THE DATA.

######## Propeller_Front$_g:	# Propeller Front  			
param Np$_g;					# Isentropic Efficiency
param ht$_g;					# Hub to Tip Ratio 
param r2max$_g;					# Maximum Radius (meters)
param M_tip_max$_g;				# Maximum Tip Mach Number

var M_pff$_g>=0;				# Axial Mach number at the propeller
var M_tip$_g>=0;				# Propeller Tip Mach Number 
var Mac>=0;						# Axial Flight Mach Number
var M$_g>=0;					# Exit Mach Number
var rp$_g>=1.05, <=1.3;			# Pressure Ratio Accross Propeller
var m$_g >= 0.01; 				# Mass Flow (kg/s)			
var T$_g>=1;					# Total Temperature Out(Kelvin)
var P$_g>=1;					# Total Pressure Out(Pascal)
var r2$_g>=0.01;				# Outer Diameter (meters)
var cp$_g>=900,<=1400;			# Specific Heat at Constant Pressure (J/kg/Kelvin)
var gam$_g>=1.2,<=1.5;			# Ratio of Specific Heats
var V_prop$_g>=0.01;			# Propeller Exit Velocity (m/s) 
var A_prop$_g>=0.01;			# Cross-Sectional Area (m^2)
var omega$_m>=0.01;				# Angular Velocity (rad/s)
var W$_m<=-0.01;				# Power Output (Watts)
	
subject to conP$_g:P$_g = Pac;																							# Assume Static Pressure Out is equal to Atmospheric 
subject to conT$_g:T$_g = Tac;																							# Assume Static Temperature Out is equal to Atmospheric
subject to conV$_g: V_prop$_g = sqrt(2*Pac*(1+(gam99-1)/2*Mac^2)^(gam99/(gam99-1))*(rp$_g-1)/(Pac/(R*Tac))+Vac^2);	# Calculate Propeller Exit Velocity (Propeller Equations NASA.gov)
subject to conM$_g: M$_g = V_prop$_g/(sqrt(gam99*R*Tac);																# Calculate Propeller Exit Mach Number (Anderson,Fundementals of Aerodynamics)
subject to conm$_g: m$_g = A_prop$_g*Pac/(R*Tac)*0.5*(Vac+V_prop$_g);													# Mass flow (Propeller Equations NASA.gov)
subject to concp$_g:cp$_g = cp99;																						# Assume Specific Heat at Constant Pressure does not change significantly
subject to congam$_g: gam$_g = gam99;																					# Assume Ratio of Specific Heats does not change significantly


subject to comM_pff$_g: M_pff$_g = 0.5*(Vac+V_prop$_g)/(sqrt(gam99*R*Tac));												# Axial Mach Number at Propeller (Anderson,Fundementals of Aerodynamics) 
subject to conM_tip$_g: M_tip$_g = sqrt(M_prff$_g^2+(r2$_g*omega$_m/sqrt(gam99*R*T99))^2;								# Simple Geometry and relationships from (Anderson,Fundementals of Aerodynamics)
subject to conr2$_g: r2$_g = sqrt(A_prop/pi*(1-ht$_g^2));																# Calculation of Propeller Radius from Simple Geometry  
subject to conW$_g: W$_m=0.5*m$_g*(V_prop^2-Vac^2)/Np$_g;																# Power Calculation from Imparted Kinetic Energy on Gas			 
subject to conthrust$_g: thrust[$_g] = m$_g*(V_prop-Vac);																		# Thrust from Momentum Conservation 

subject to conr2max$_g: r2$_g<=r2max$_g;																				# Maximum Radius Constraint										
subject to conM_tip_max$_g: M_tip$_g<= M_tip_max$_g;																	# Maximum Blade Tip Mach Number  
subject to conchangeV_prop$_g: V_prop$_g-Vac>=10;																		# Propeller Must Increase the Velocity of the Flow

# Output Design Data:
var D_$_g_1>=25;
var D_$_g_2>=0.01;
var D_$_g_3>=1.01;
var D_$_g_4>=0.1;
var D_$_g_5>=0.7;
var D_$_g_6>=200;
var D_$_g_7>=15000;

subject to conD_$_g_1:	D_$_g_1 = omega$_m;
subject to conD_$_g_2:	D_$_g_2=m$_g;
subject to conD_$_g_3:  D_$_g_3=rp$_g;
subject to conD_$_g_4:  D_$_g_4=0.5;
subject to conD_$_g_5:  D_$_g_5=Np$_g;
subject to conD_$_g_6:  D_$_g_6=T99;
subject to conD_$_g_7:  D_$_g_7=P99;			