solve an equation system with matlab
1 view (last 30 days)
Show older comments
Alvaro Mª Zumalacarregui Delgado
on 1 Mar 2021
Commented: Alvaro Mª Zumalacarregui Delgado
on 1 Mar 2021
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 Comments
Star Strider
on 1 Mar 2021
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
.
Answers (0)
See Also
Categories
Find more on Systems of Nonlinear Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!