Nonlinear overdetermined equation systems
2 views (last 30 days)
Show older comments
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?
0 Comments
Answers (1)
Torsten
on 8 Aug 2023
Edited: Torsten
on 8 Aug 2023
By using "lsqnonlin", e.g.
sol0 = [0 0 0 0];
sol = lsqnonlin(@fun,sol0)
norm(fun(sol))
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
0 Comments
See Also
Categories
Find more on Systems of Nonlinear Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!