solve an equation system with matlab

조회 수: 1 (최근 30일)
Alvaro Mª Zumalacarregui Delgado
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
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
.
Alvaro Mª Zumalacarregui Delgado
thanks star trider!!

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Equation Solving에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by