symbolic solve gives a weird result

3 visualizaciones (últimos 30 días)
Sakai
Sakai el 9 de Mzo. de 2016
Editada: Sakai el 10 de Mzo. de 2016
%%% This seems to be a legitimate bug. Developemnt team is further investigating the issue.
Can someone help figure out what's going on? I am using 2015a.
The following two systems should give the same set of solutions for x.
syms x y
x_sol1=solve(1.01/5*x^5-1,x);
double(x_sol1)
[x_sol,y_sol]=solve([ 1.01 - x*y, 5/x^6 - y],[x,y]);
double([x_sol y_sol])
What I got is as follows. None of them coincides. It makes me crazy.
ans =
1.3770 + 0.0000i
0.4255 - 1.3096i
0.4255 + 1.3096i
-1.1140 + 0.8094i
-1.1140 - 0.8094i
ans =
0.8602 - 0.6250i 0.7684 + 0.5583i
-1.0633 + 0.0000i -0.9499 - 0.0000i
-0.3286 + 1.0113i -0.2935 - 0.9034i
0.8602 + 0.6250i 0.7684 - 0.5583i
-0.3286 - 1.0113i -0.2935 + 0.9034i

Respuestas (1)

Walter Roberson
Walter Roberson el 9 de Mzo. de 2016
solve() does not accept vectors of equations or vectors of variables to solve for. Each one needs to be a distinct argument.
[x_sol, y_sol] = solve( 1.01 - x*y, 5/x^6 - y, x, y);
  1 comentario
Sakai
Sakai el 9 de Mzo. de 2016
Documentation has an example like this...
syms u v [solv, solu] = solve([2*u^2 + v^2 == 0, u - v == 1], [v, u])

Iniciar sesión para comentar.

Categorías

Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by