How to use Solver?
14 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Rebecca Reyes
am 13 Apr. 2021
Bearbeitet: madhan ravi
am 14 Apr. 2021
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 Kommentare
Akzeptierte Antwort
madhan ravi
am 13 Apr. 2021
Use vpasolve()
6 Kommentare
madhan ravi
am 14 Apr. 2021
Bearbeitet: madhan ravi
am 14 Apr. 2021
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.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Assumptions finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!