symbolic solve gives a weird result

3 vues (au cours des 30 derniers jours)
Sakai
Sakai le 9 Mar 2016
Modifié(e) : Sakai le 10 Mar 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

Réponses (1)

Walter Roberson
Walter Roberson le 9 Mar 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 commentaire
Sakai
Sakai le 9 Mar 2016
Documentation has an example like this...
syms u v [solv, solu] = solve([2*u^2 + v^2 == 0, u - v == 1], [v, u])

Connectez-vous pour commenter.

Catégories

En savoir plus sur Symbolic Math Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by