Minimization with multiple inputs
Mostra commenti meno recenti
You
% Atmosphere
Ta = 219 %k
Pa = 4000 %Pa
Ca = 296.4 %m/s
Rhoa = .06372 %kg/m^3
As = 585 %m^2
M = 3
Cd = .013
Cl = .094
alpha = 4.5 * (pi/180) %rad
Va = M * Ca %m/s
L = Cl * .5 * Rhoa * (Va.^2) * As
D = Cd * .5 * Rhoa * (Va.^2) * As
FtTotal = D / cos(alpha) %Total
Thrust Ft = FtTotal / 3 %Thrust per Engine (3)
AirFrame = 1.128e6 %N
FuelWeight = 272000 %N
FuelMass = 27700 %kg
Engine Design and Optimization Validation with Nominal Configuration
% Diffuser
ka=1.4
Poa = Pa*((1 + ((ka-1)/2)*(M^2))^(ka/(ka-1))) %Pa
Toa = Ta*((1 + ((ka-1)/2)*(M^2))) %K
T1 = Toa %K
rd = .80886
P1 = rd * Poa %Pa
% Fan
rf = 1.99
P2 = rf * P1
npf = .89
T2a = T1 * (rf)^((ka-1)/(ka*npf))
% Compressor
rc = 15
P3 = rc * P2
npc = .89
T3a = T2a * (rc)^((ka-1)/(ka*npf))
% Combustor
Cpa = 1005 %J/kgK
Cpg = 1157 %J/kgK
hc = 43.1e6 %J/kg Assume Jet Fuel
T4 = 2000 %K
Tref = 298 %K
= (Cpg*(T4-Tref) - Cpa*(T3a-Tref))/(hc - Cpg*(T4-Tref))
Plc = .97
P4 = Plc * P3
% Turbine
BPR = 1
nm = .99
T5a = T4 - (((1+BPR)*Cpa*(T2a-T1) + Cpa*(T3a-T2a))/(nm*(1+f)*Cpg))
npt = .93
kg = 1.33
P5 = P4*((T5a/T4)^(kg/((kg-1)*npt)))
% Nozzle Exit
% Guess Unchoked
Pln = 1
Poce = Pln * P5
Pce = Pa
Mce = sqrt(2*(((Poce/Pce)^((kg-1)/kg))-1)/(kg-1))
Toce = T5a
Tce = Toce/(1 + ((kg-1)/2)*(Mce^2))
R = 287 %J/kgK
Vce = Mce * sqrt(kg*R*Tce)
rhoce = Pce/(R*Tce) Ace = 7.8407 %m^2
mdotce = rhoce * Vce * Ace %kg/s
mdotca = mdotce / (1+f)
% Bypass Duct Nozzle
% Assume Choked
Pld = 1
Pofe = Pld * P2
Mfe = 3.32
Pfe = Pofe/((1+ ((ka-1)/2)*(Mfe^2))^(ka/(ka-1)))
Tofe = T2a
Tfe = Tofe/(1 + ((ka-1)/2)*Mfe^2)
Cfe = sqrt(ka*R*Tfe)
Vfe = Mfe * Cfe
mdotfe = BPR * mdotca
mdota = mdotca + mdotfe
rhofe = Pfe/(R*Tfe)
mdotf = mdotce - mdotca
Afe = 4.4065
Ft = mdotfe*Vfe + mdotce*Vce - mdota*Va + (Pfe-Pa)*Afe
Code above works entirely. Need to minimize 'mdotf' while holding 'Ft' to 64000. Plc and Pld cannot exceed 1. BPR cannot exceed 2. Rc and Rf must be 1.0 or greater. Would like to display mdotf, BPR, rc, rf, Afe, Ace, Pld, Plc.
2 Commenti
Image Analyst
il 14 Dic 2023
Please format your code as code with the code button.
Explain what these two lines mean:
Tref = 298 %K
= (Cpg*(T4-Tref) - Cpa*(T3a-Tref))/(hc - Cpg*(T4-Tref))
R
il 24 Dic 2023
The "fmincon" function in MATLAB's Optimization Toolbox might help you solve this optimization problem. Refer to the following documentation:
Risposte (0)
Categorie
Scopri di più su PLC Code Generation Basics in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!