필터 지우기
필터 지우기

vpasolve: numeric instability leading to wrong solutions?

조회 수: 3 (최근 30일)
Hubert Villeneuve
Hubert Villeneuve 2016년 8월 11일
답변: Chidvi Modala 2020년 10월 27일
Hi,
I'm working on a real-time distance estimation program using data from successive image frames. To do so, I employ Perspective-3-Points, which boils down to solving systems of three nonlinear equations derived from the law of Cosines. I'm using vpasolve, as there are 8 sets of solutions, and while I often get the solutions I expect, I am occasionally getting erroneous values that come with the following warning:
Warning: Solution '[x1 = 50.513354258655913523642438228345, x2 = 70.834152303683331599397540128635, x3 = -3.6823353014471324108432162378347]' seems to be affected by some numeric instability. Inserting this solution into equation '(5682387108428029*x1^2)/36893488147419103232 - (2779811138476361*x1*x2)/9223372036854775808 + (1396576697819169*x2^2)/9223372036854775808 - 3837877865952747/73786976294838206464 = 0' produces the residue '0.074294366099841203751338186504608'.
I attached two sets of very similar variables, one resulting in errors and the other in expected solutions (with the right order of magnitude), to check with the code below:
clear; clc;
load('P3Pvar2.mat');
syms x1 x2 x3
F1=A*x1^2+B*x2^2-2*D(1)*x1*x2-d_bar(1)==0;
F2=B*x2^2+C*x3^2-2*D(2)*x2*x3-d_bar(2)==0;
F3=C*x3^2+A*x1^2-2*D(3)*x3*x1-d_bar(3)==0;
S = vpasolve([F1,F2,F3],[x1, x2, x3]);
sol=double([S.x1 S.x2 S.x3])
Are there any suggestions as to what could be the cause behind the erroneous solutions from vpasolve and how to solve it?

답변 (1개)

Chidvi Modala
Chidvi Modala 2020년 10월 27일
Hi Hubert,
You can refer to a similar question answered here

카테고리

Help CenterFile Exchange에서 Digital Filter Analysis에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by