필터 지우기
필터 지우기

Need help with a system non-linear equation with three variables

조회 수: 1 (최근 30일)
Tanay Tayade
Tanay Tayade 2024년 3월 3일
답변: John D'Errico 2024년 3월 3일
I have a set of data:
x (array) containing as many data points as we want (known to user)
y (array) containing as many data points as x (also known)
and corresponding set of X (array) and Y (array) (both known).
Now using these arrays, we can frame the following expressions:
Rx(i)=((d*cos(theta)*cos(phi)+X(i)*sin(phi))*(x(i)*cos(psi)-y(i)*sin(psi))-d*sin(theta)*(x(i)*sin(psi)+y(i)*cos(psi)))/(X(i)*cos(phi2)-d*sin(phi2)*cos(theta2))
Ry(i)=((d*sin(theta)*cos(phi)+Y(i)*sin(phi))*(x(i)*cos(psi)-y(i)*sin(psi))+d*cos(theta)*(x(i)*sin(psi)+y(i)*cos(psi)))/(Y(i)*cos(phi2)-d*sin(phi2)*sin(theta2))
(we can get as many set of expressions for Rx and Ry as many data points we've considered for x, y, X, Y)
Note that the other variables (d, phi2, theta2) are also known.
Using this expressions, i want to find the value of theta, phi and psi for which:
F(i)=Rx(i)-Ry(i)=0
theta can take values from [0,360], psi from [0,360], and phi from [0,90] (in degrees)
There can be multiple solutions.

답변 (1개)

John D'Errico
John D'Errico 2024년 3월 3일
Simple. Use lsqnonlin.
There will almsot certainly be no exact solution. All you can do is find a parameter set that minimizes the sum of squares of the difference, i.e., lsqnonlin.
Yes, there will ALWAYS be multiple colutions, since this is a trig problem, and therefore infinitely many equivalent solutions.

카테고리

Help CenterFile Exchange에서 Systems of Nonlinear Equations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by