non linear equation, help me solve this please

2 次查看(过去 30 天)
hi, please help me to solve this
i tried with this
syms x1 x2 x3
eq1 = 12804.724*(0.127-x1);
eq2 = 5894.25*(x2-x3);
eq3 = 98.20*(x3-22);
eq4 = 1.8897*(50-x2)/log(0.127/(0.127-x1));
eq5 = eq1 = eq2 = eq3 = eq4
sol = solve(eq1,eq2,eq3,eq4,eq5);
sol.x1
but it didn't work, please help. Thank you

回答(1 个)

Ced
Ced 2016-3-25
编辑:Ced 2016-3-25
Hi
1. What does the error say? "The expression to the left of the equals sign is not a valid target for an assignment."
This is referring to eq5 = eq4 = eq3 etc... Matlab does not understand what you want to do in this line
2. I think you misunderstood how solve works. You need to actually pass it equations, and add the variables of interest at the end.
eq1 = 1.2962e+04*(0.127-x1);
is not an equation. This is a variable eq1 with the value 1.2962e+04*(0.127-x1). So, you would need to do something like
sol = solve(eq1==eq2, ... , x1,x2,x3)
3. Last but not least, I think there is a typo in your code, some of the constants do not match the original equations you gave

标签

Community Treasure Hunt

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

Start Hunting!

Translated by