Linear constraints using lsqnonlin

7 次查看(过去 30 天)
Hi, I'm solving a non-linear system of 3 equations in 3 unkowns:
I'm using lsqnonlin to solve it:
lambda = lsqnonlin(F,lambda0,lb,ub,options);
Moreover, I need to add some constraints to the variables:
How can pass this constraints to the solver?
Thanks in advance!
  2 个评论
Torsten
Torsten 2022-9-28
编辑:Torsten 2022-9-28
A system of 3 equations in 3 unknowns usually has a unique solution.
So how can you put constraints on the solution ?
Do you want the 3 nonlinear equations only approximately to be satisfied ?
Walter Roberson
Walter Roberson 2022-9-28
A system of 3 equations in 3 unknowns usually as a unique solution.
That is not generally the case for nonlinear systems. For example 3 curved surfaces might intersect at multiple locations and the constraints could narrow the result down to one particular quandrant.

请先登录,再进行评论。

采纳的回答

Walter Roberson
Walter Roberson 2022-9-28
lsqnonlin() does not support constraints other than upper bound and lower bound.
I suggest you minimize the norm() of F(x,y,z)-lambda0 using fmincon() as you can supply linear inequality constraints for that.
  2 个评论
Matt J
Matt J 2022-9-30
Or rather minimize norm( F(x,y,z) )^2 to ensure differentiability of the objective.

请先登录,再进行评论。

更多回答(0 个)

类别

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