 # Delivered to the U.S. Government in Accordance with Contract FA8650-10-C-7080.
 #
 # EXPORT CONTROLLED
 # ECCN#   EAR99  
 # Warning:  This document contains technical data which is controlled under the
 # Bureau of Industry & Security’s Export Administration Regulations and may not be
 # exported or re-exported without authorization by the Bureau of Industry & Security.
 # Diversion contrary to US law is prohibited.
 #
 # (c) 2011 United Technologies Corp.
 # Developed with the sponsorship of the Defense Advanced Research Projects Agency (DARPA).
 #
 # Permission is hereby granted, free of charge, to 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"), to deal in the Data without 
 # restriction, including without limitation the rights to use, copy, modify, merge, publish,
 # distribute, sublicense, and/or sell copies of the Data, and to permit persons to whom the Data
 # is furnished to do so, subject to the following conditions:
 #  
 # The above copyright notice and this permission notice shall be included in all copies or
 # substantial portions of the Data.
 #  
 # THE DATA IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
 # BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS, SPONSORS, DEVELOPERS, CONTRIBUTORS, OR
 # COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE DATA OR THE
 # USE OR OTHER DEALINGS IN THE DATA.

###### Core$:
var ma_core>=0.01;

###### Compressor:

param Nc;
var rc$ >= 2, <=30;   
var To_out_compressor$>= 1;		 
var Po_out_compressor>=1;
var W_compressor$ >= 1; 
var cp_compressor$>=900,<=1400;
var gam_compressor$>=1.2,<=1.5;
var cost$>=0;
var cost_compressor$>=0;

subject to conPo_out_compressor: Po_out_compressor = rc$*Po%; 
subject to conTo_out_compressor$: To_out_compressor$ = To%+(To%*rc$^((gam%-1)/gam%)-To%)/Nc;
subject to conW_compressor$: W_compressor$ = cp%*(To_out_compressor$-To%)*ma_core;

subject to concp_compressor$:cp_compressor$ = (2.506*10^(-11)*To_out_compressor$^2+1.454*10^(-7)*To_out_compressor$^1.5
-4.246*10^(-7)*To_out_compressor$+3.162*10^(-5)*To_out_compressor$^(0.5)+1.3303-1.512*10^4*To_out_compressor$^(-1.5)
+3.063*10^5*To_out_compressor$^(-2)-2.212*10^7*To_out_compressor$^(-3))*10^3;
subject to congam_compressor$: gam_compressor$ = cp_compressor$/(cp_compressor$-R);

subject to conchangeTo_out_compressor$: To_out_compressor$>=To%;


subject to concos_compressor$: cost_compressor$ = rc$/30;

######## Combustor:

var Po_out_combustor$>=1;
var To_out_combustor>=1600, <=1700;
var Q>=1;
var mfuel>=0;
var cp_combustor$>=900,<=1400;
var gam_combustor$>=1.2,<=1.5;
var cost_combustor$>=0;


subject to conPo_out_combustor$: Po_out_combustor$ = Po_out_compressor; 
subject to conQ: Q = cp_combustor$*(To_out_combustor-To_out_compressor$);
subject to conmfuel: mfuel = ma_core*Q/(4.3*10^7);

subject to concp_combustor$:cp_combustor$ = (2.506*10^(-11)*To_out_combustor^2+1.454*10^(-7)*To_out_combustor^1.5
-4.246*10^(-7)*To_out_combustor+3.162*10^(-5)*To_out_combustor^(0.5)+1.3303-1.512*10^4*To_out_combustor^(-1.5)
+3.063*10^5*To_out_combustor^(-2)-2.212*10^7*To_out_combustor^(-3))*10^3;
subject to congam_combustor$: gam_combustor$ = cp_combustor$/(cp_combustor$-R);


subject to conchangeTo_out_combustor: To_out_combustor>=To_out_compressor$;

subject to concost_combustor$: cost_combustor$ = To_out_combustor/1700;

######## Turbine:
param Nt;
var rt$>=2,<=40;
var Po$>=1;
var To$>=1; 
var cp$>=900,<=1400;
var gam$>=1.2,<=1.5;
var W2>=0;
var cost_turbine$>=0;


subject to conPo$: Po$ = Po_out_combustor$/rt$;
subject to conTo$: To$ = To_out_combustor-(To_out_combustor-To_out_combustor*(Po$/Po_out_combustor$)^((gam_combustor$-1)/2));
subject to conW2: W2 = ma_core*cp_combustor$*(To_out_combustor-To$)-W_compressor$;

subject to concp$:cp$ = (2.506*10^(-11)*To$^2+1.454*10^(-7)*To$^1.5
-4.246*10^(-7)*To$+3.162*10^(-5)*To$^(0.5)+1.3303-1.512*10^4*To$^(-1.5)
+3.063*10^5*To$^(-2)-2.212*10^7*To$^(-3))*10^3;
subject to congam$: gam$ = cp$/(cp$-R);



subject to conchangeTo$: To%<=To$;
subject to conaPo$: Po$/Pac>=1.01;

subject to concost_turbine$: cost_turbine$ = To$*rt$/(30*1700);

subject to concost$: cost$ = (cost_turbine$+cost_compressor$+cost_combustor$)*ma_core*10000; 
