STILL confused on Solver (tried a different approach) NOT SPAM
4 次查看(过去 30 天)
显示 更早的评论
please look over my new attempt
the answer for x is suppposed to be 88. I can't seem to get the answer
I am not trying to spam I just tried a new approach. Please Please help.
This is my approach.
clear dlc
%feed composition
z1=.5;
z2=.1;
z3=.15;
z4=.25;
%other given data
F=150;
PD=250;
T=10;
L=150-x;
F=150;
%k-values from chart yi/xi
k1=56;
k2=0.65;
k3=0.175;
k4=0.055;
%total balances
x1=(F*z1)/(k1*x+L);
x2=(F*z2)/(k2*x+L);
x3=(F*z3)/(k3*x+L);
x4=(F*z4)/(k4*x+L);
eqn=k1*x1+k2*x2+k3*x3+k4*x4==1;
sol=solve(eqn);
The only answer I get in command window this time is
>> Project (which is the name of the file)
4 个评论
Cris LaPierre
2021-4-13
You haven't declared what x is, so your code is returning an error. Did you mean to make it symbolic?
采纳的回答
Cris LaPierre
2021-4-13
Assuming x is symbolic
%feed composition
z1=.5;
z2=.1;
z3=.15;
z4=.25;
%other given data
F=150;
PD=250;
T=10;
syms x
L=150-x;
%k-values from chart yi/xi
k1=56;
k2=0.65;
k3=0.175;
k4=0.055;
%total balances
x1=(F*z1)/(k1*x+L);
x2=(F*z2)/(k2*x+L);
x3=(F*z3)/(k3*x+L);
x4=(F*z4)/(k4*x+L);
eqn=k1*x1+k2*x2+k3*x3+k4*x4==1
sol=solve(eqn)
double(sol)
It looks like there are 4 possible solutions to your equation, of which, a value close to 88 is one of them. If I solve your equation substituting in a value of 88, the result is close to 1.
double(subs(lhs(eqn),x,88))
3 个评论
Cris LaPierre
2021-4-14
If you use the exact values returned, every one of them will give you a result of 1. Otherwise, they wouldn't be a solution to the equation. It sounds like you need to maybe come up with a constraint for the solution, like it must be less than 100, for example.
更多回答(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!