solve an equation system with matlab
1 次查看(过去 30 天)
显示 更早的评论
I trying to solve a system but when I run matlab send me an error, this is the code
syms a b
xo = 7000;
yo = 8000;
x = 6600;
y = 6500;
t = 7;
eq1 = (b*xo-a*yo)/(exp(((b*xo-a*yo)*t)-((b*xo-a*yo)*(log(b*xo/yo)/(-(b*xo-a*yo)))))) == y;
eq2 = -(b*xo-a*yo)/(exp(((b*xo-a*yo)*t)-((b*xo-a*yo)*(log(-a*yo/xo)/(-(b*xo-a*yo)))))) == x;
solve([eq1 eq2], [a, b])
and the error
Warning: Unable to find explicit solution. For options, see help.
> In sym/solve (line 317)
In sistema (line 16)
ans =
struct with fields:
a: [0×1 sym]
b: [0×1 sym]
2 个评论
Star Strider
2021-3-1
The two functions do not intersect, so they have no values of either ‘a’ or ‘b’ in common:
syms a b
xo = 7000;
yo = 8000;
x = 6600;
y = 6500;
t = 7;
eq1 = (b*xo-a*yo)/(exp(((b*xo-a*yo)*t)-((b*xo-a*yo)*(log(b*xo/yo)/(-(b*xo-a*yo)))))) == y;
eq2 = -(b*xo-a*yo)/(exp(((b*xo-a*yo)*t)-((b*xo-a*yo)*(log(-a*yo/xo)/(-(b*xo-a*yo)))))) == x;
eq1 = simplify(lhs(eq1)-rhs(eq1), 'Steps',500);
eq2 = simplify(lhs(eq2)-rhs(eq2), 'Steps',500);
figure
fsurf(eq1, [-1 1 -1 1]*1E+8)
hold on
fsurf(eq2, [-1 1 -1 1]*1E+8)
hold off
.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Systems of Nonlinear Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!