How to use Solver?
3 次查看(过去 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 中查找有关 Assumptions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!