Linear constraints using lsqnonlin
조회 수: 16 (최근 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
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
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
2022년 9월 30일
Or rather minimize norm( F(x,y,z) )^2 to ensure differentiability of the objective.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Quadratic Programming and Cone Programming에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!