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