필터 지우기
필터 지우기

Nonlinear overdetermined equation systems

조회 수: 5 (최근 30일)
Mustafa Duran
Mustafa Duran 2023년 8월 8일
편집: Torsten 2023년 8월 8일
There is a nonlinear overdetermined system. For example:
syms x y z t
x+y+z+t=0.5
3x+4y+5z+2t=5
2x+9y+3z+4t=6
2x+4y+8z+6t=2
x^2+y^2+3z+6t=9
I found the solution for linear overdetermined systems. However how can i solve nonlinear overdetermined equation systems like that in MATLAB?

답변 (1개)

Torsten
Torsten 2023년 8월 8일
편집: Torsten 2023년 8월 8일
By using "lsqnonlin", e.g.
sol0 = [0 0 0 0];
sol = lsqnonlin(@fun,sol0)
Local minimum possible. lsqnonlin stopped because the final change in the sum of squares relative to its initial value is less than the value of the function tolerance.
sol = 1×4
2.7023 0.0552 -1.0198 0.7598
norm(fun(sol))
ans = 2.0264
function res = fun(u);
x = u(1);
y = u(2);
z = u(3);
t = u(4);
res = [x+y+z+t-0.5,...
3*x+4*y+5*z+2*t-5,...
2*x+9*y+3*z+4*t-6,...
2*x+4*y+8*z+6*t-2,...
x^2+y^2+3*z+6*t-9];
end

카테고리

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