FZERO cannot continue because user-supplied function_handle ==> @(m_w2)(PD​_2(m_w2)-P​D_1(m_w2)) failed with the error below. Index exceeds matrix dimensions.

1 vue (au cours des 30 derniers jours)
m_tot = 8; % in kg/sec [M2,H] = B249VALVEcurve() C_v249= [M2]; [M,H] = B251valveperfcurve() C_v251 = [M];% a vector for opening from 1 - 100% wInP = 400; % in kPa k = 1; PD_pipe2 = 0.96 PD_DIC1 = @(m_w2)(160*(m_w2 ^2) + (2.3*10^3)*m_w2 - 10^4)/1e3; rho_w =refpropm('D','T',345,'P',400,'water'); Q_w2 = @(m_w2)m_w2/rho_w; Q_w2_hr =@(m_w2) 3600*Q_w2(m_w2); % in m3/hr m_w1 = @(m_w2) m_tot - m_w2; PD_pipe1 = 0.96; PD_oc = 5; PD_IC1= @(m_w2) (590*(m_w1(m_w2) ^2) + 0.42*m_w1(m_w2)+ 0.56)/1e3; PD_IC2 =@(m_w2) (590*(m_w1(m_w2) ^2) + 0.4*m_w1(m_w2)+ 0.51)/1e3; PD_AC= @(m_w2)(1400*(m_w1(m_w2)^2) + 0.37*m_w1(m_w2) + 0.44)/1e3; rho_w1 =refpropm('D','T',360,'P',280,'water'); % assuming 280, anyways rho shouldnt vary much Q_w1 = m_tot/rho_w1; Q_w1_hr= 3600*Q_w1; % in m3/hr for i = 1:100 Kv(i) = 0.865*C_v249(i); % gpm into m3/hr DP_B249(i) = @(m_w2)((Q_w2_hr(m_w2)/Kv(i))^2)*(10^2); % Q is in m3/hr, and Press is in kPa DP_B249a = DP_B249(i); for j = 1:100 Kv_251(j) = 0.865*C_v251(j); % Kv_251(i,j) = Kv_251(j); % DP_B249(i,j) = DP_B249(i) ; % PD_DIC1(i,j) = PD_DIC1(i); DP_B251(j) = ((Q_w1_hr/Kv_251(j))^2)*(10^2); % Q is in m3/hr, and Press is in kPa DP_B251a = DP_B251(j);
PD_1 = @(m_w2)PD_pipe1 +PD_oc +PD_IC1(m_w2) +PD_IC2(m_w2) + PD_AC + DP_B251a ;
PD_2 = @(m_w2)PD_pipe2 + PD_DIC1(m_w2) + DP_B249a(m_w2)+ PD_AC+ DP_B251a ;
fun = @(m_w2) (PD_2(m_w2)- PD_1(m_w2));
m_w2 = fzero(fun,2);
m_w2_f(k) = m_w2;
m_w1_f(k) = m_tot - m_w2;
B251valve_pos(k) = j; %valve position of 251 for this flow rate
B249valve_pos(k) = i; % valve position of 249 for this flow rate
k = k+1;
j = j+1;
end
i = i +1;
end
  1 commentaire
Suhan
Suhan le 1 Sep 2017
The issue can not be reproduced from the code snippet you have shared. In the code snippet,B251valveperfcurve()' and a few other functions are not defined.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Engines & Motors dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by