solution of equation based on initial guess

2 次查看(过去 30 天)
Hi everyone, I am trying to find the right value of SI, which gives me the equatilty betwenn Q_in and Q_out. I am using this approach:
%Input data
P=2.9;
Q_in=2.11;
P5=1.08;
lambda=0.2;
Fc=0;
SI=1.44; %initial guess
M=(P5-0.2*SI)*SI/(P5+0.8*SI);
if M<0
M=0;
end
S=SI-M;
if S<0
S=0;
end
Ia=lambda*S;
Q_out=(P-Ia-Fc).*(P-Ia-Fc+M)/(P-Ia-Fc+M+S);
Q_in-round(Q_out,5);
if (Q_in-round(Q_out,5))<1e-2
a=round(Q_out,5)
end
Everything is depending on the tol, but when I increase it, I do not get the answer. Can someone help me?
  2 个评论
Walter Roberson
Walter Roberson 2019-5-4
You have
Q_in-round(Q_out,5);
That line computes a result, and then throws it away because of the semi-colon at the end of the line that says not to display output. You are not assigning the result to a variable, and you are not displaying the result.
Torsten
Torsten 2019-5-6
Use MATLAB's "fzero" to solve
Q_in - Q_out(SI) = 0

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Verification, Validation, and Test 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by