symbolic solve gives a weird result

3 次查看(过去 30 天)
Sakai
Sakai 2016-3-9
编辑: Sakai 2016-3-10
%%% 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

回答(1 个)

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

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by