solve an equation system with matlab
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Alvaro Mª Zumalacarregui Delgado
el 1 de Mzo. de 2021
Comentada: Alvaro Mª Zumalacarregui Delgado
el 1 de Mzo. de 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 comentarios
Star Strider
el 1 de Mzo. de 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
.
Respuestas (0)
Ver también
Categorías
Más información sobre Systems of Nonlinear Equations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!