フィルターのクリア

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 Center および File ExchangeSystems of Nonlinear Equations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by