I have the following code for matlab and I am trying to estimate the final weight w0 iteratively starting with 14500 as a value for w0. How can I write that as a function or loop to execute only 8 iterations max?

1 次查看(过去 30 天)
v = 969.02667; % speed of sound at 35000ft
v_cruise = 0.78*v; %speed of cruise given is 0.78 Mach
Mmax = 0.9;
rho = 0.000738; % air density at 35000 ft
q = 0.5*rho*(v_cruise^2); %dynamic pressure at 35000ft
cdo = 0.022;
t_w = 0.5; % t/w at take off
w_s = 60; %take off wing loading
AR = 7.5; % aspect ratio
e = 0.7; %efficiency
w_s_cruise = 0.87*w_s; %cruise wing loading
L_D_cruise = 1 / ((q*cdo)/(w_s_cruise) + (w_s_cruise)/ (q*AR*e*pi)); %L/D cruise & divert
L_D_loiter = 0.5*sqrt((AR*e*pi)/(cdo)); %L/D loiter
w1_w0 = 0.97
w2_w1 = 0.98
fc_cruise = 0.7;% fuel consumption cruise
fc_loiter = 0.6; % fuel consumption loiter
R_d= 984252; %range for divert in meters
R_c = 9842520 ; %range for cruise in meters
E_loiter = 45*60; % loiter endurance in seconds
w3_w2 = exp( (-fc_cruise*R_c)/ (v_cruise*3600*L_D_cruise)) %3600 for unit conversion
w4_w3 = exp( (-fc_loiter*E_loiter)/ (3600*L_D_loiter))
w5_w4 = exp( (-fc_cruise*R_d)/ (v_cruise*3600*L_D_cruise))
w6_w5 = 0.99
w7_w6 = 0.997
wx_w0=w7_w6*w6_w5*w5_w4*w4_w3*w3_w2*w2_w1*w1_w0
wf_w0= 1.06*(1-(wx_w0))
a = 0.32;
b = 0.66;
c1=-0.13;
c2=0.3;
c3 = 0.06;
c4 = -0.05;
c5= 0.05; %table values
ke_1= a;
ke_2 = b*(AR^c2)*(t_w^c3)*(w_s^c4)*(Mmax^c5);
w_humans = 2*175 ;
w_payload = 136000;
A1 = w_humans + w_payload; %in pounds
A2 = 1 - (wf_w0) - ke_1;
A3 = -ke_2;
W0= (A1)/ (A2+A3*(w0^c1))

回答(0 个)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by