How to use Solver?
9 ビュー (過去 30 日間)
古いコメントを表示
clear dlc
%feed composition
z1=.5;
z2=.1;
z3=.15;
z4=.25;
%other given data
F=150;
PD=250;
T=10;
F=150;
%k-values from chart yi/xi
k1=56;
k2=0.65;
k3=0.175;
k4=0.055;
%total balances
syms x
eqn=solve(k1*((F*z1)/(k1*x+150-x))+k2*((F*z2)/(k2*x+150-x))+k3*((F*z3)/(k3*x+150-x))+k4*((F*z4)/(k4*x+150-x))==1)
I'm trying to solve for x in the eqn but all i get is this:
eqn =
150
root(z^3 - (151985*z^2)/231 + (2120672000*z)/17787 - 36140000000/5929, z, 1)
root(z^3 - (151985*z^2)/231 + (2120672000*z)/17787 - 36140000000/5929, z, 2)
root(z^3 - (151985*z^2)/231 + (2120672000*z)/17787 - 36140000000/5929, z, 3)
Very confused since I had defined my z constants and I am only looking for the x variable
0 件のコメント
採用された回答
madhan ravi
2021 年 4 月 13 日
Use vpasolve()
6 件のコメント
madhan ravi
2021 年 4 月 14 日
編集済み: madhan ravi
2021 年 4 月 14 日
Wow , you just completely ignored what I told you and simply asked the same question.
%feed composition
z1=.5;
z2=.1;
z3=.15;
z4=.25;
%other given data
F=150;
PD=250;
T=10;
F=150;
%k-values from chart yi/xi
k1=56;
k2=0.65;
k3=0.175;
k4=0.055;
%total balances
syms x
Eqn = k1*((F*z1)/(k1*x+150-x))+k2*((F*z2)/(k2*x+150-x))+k3*((F*z3)/(k3*x+150-x))+k4*((F*z4)/(k4*x+150-x))==1;
X = vpasolve(Eqn) % you can see 4 answers so if you're looking for the root in a certain range say 50 - 100 you can use the below line
X_in_the_range = vpasolve(Eqn, [50 100])
subs(Eqn, X_in_the_range) % to check if it satisfies, ofcourse it's not an exact solution but a close match to what you're looking for
Come on , was that hard for you ? The reason I suggested vpasolve() is that you can input the domain for the solver to look for. Please stop asking the same question multiple times just because you didn't understand. It's not encouraged in this forum. Volunteers spend some time in helping and instead of giving them a proper response OP's tend to ask another question simultaneously.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Symbolic Math Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!