solution of equation based on initial guess

2 views (last 30 days)
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 Comments
Walter Roberson
Walter Roberson on 4 May 2019
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 on 6 May 2019
Use MATLAB's "fzero" to solve
Q_in - Q_out(SI) = 0

Sign in to comment.

Answers (0)

Categories

Find more on Verification, Validation, and Test in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!