vpasolve: numeric instability when solving a system of three quadratic equations
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello everybody,
Does anybody know why vpasolve could give this warning message when trying to solve a system of three quadratic equations? No valid solutions are found when it happens.
Warning: Solution '[u = -2.5286701614737728998253152777292, v = -3.7031043121341872713420994690679, w = 7.2317744736079601711674147467972]' seems to be affected by some numeric instability. Inserting this solution into equation '- 1830*u^2 - 1209*u + 61*v^2 + 61*w^2 + 39 = 0' produces the residue '-4578.4... [numeric::polysysroots::checkstability]
The code for the system of equations is the following:
% LUT dimensions
dim = 32
max = dim - 1
idxu = 1
idxv = 4
idxw = 26
du = idxu/max
dv = idxv/max
dw = idxw/max
% Symbols
syms u v w
% Lambda
l=0.61
% Equations
eq1 = du == (l*u^2 + (1-l)*u)/(l*(u^2+v^2+w^2)+(1-l));
eq2 = dv == (l*v^2 + (1-l)*v)/(l*(u^2+v^2+w^2)+(1-l));
eq3 = dw == (l*w^2 + (1-l)*w)/(l*(u^2+v^2+w^2)+(1-l));
% Restrictions
init_guess = [0 1; 0 1; 0 1]
assume(u, 'real')
assume(v, 'real')
assume(w, 'real')
% Solve
[su, sv, sw] = vpasolve([eq1, eq2, eq3], [u,v,w], init_guess)
Other values of idxu,idxv,idxw (1,3,27 for instance) do not cause vpasolve to generate warnings at all.
I don't understand the reason for this, I'm basically working with barycentric coordinates (u,v,w) and the system of equations only performs a conversion within the valid range of barycentric coords (all components belong to [0 1] and their sum equal 1).
Any help would be appreciated!
댓글 수: 0
답변 (3개)
Yinghui You
2018년 2월 27일
I met the same problem ,Have you got the answer?If so,would you like to tell me about that?(..My poor English)
댓글 수: 0
Alex Sha
2019년 12월 10일
The unique stable results are:
u: 0.241646208739371
v: -1.29626943837113
w: 2.05462322963176
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!