solution of equation based on initial guess

2 ビュー (過去 30 日間)
Ricardo Azuero
Ricardo Azuero 2019 年 5 月 4 日
コメント済み: Torsten 2019 年 5 月 6 日
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 Center および File ExchangeVerification, Validation, and Test についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by