Lsqnonlin with nonlinear constraint!

Dear Community, I need to use a nonlinear constraint with the "lsqnonlin" optimization algorithm. To apply the constraint I am using the following procedure. FF = myfunction(pars). In myfunction I use the IF statement as follows: IF "nonlin constraints are respected" then compute FF ELSE FF=10e100 END. In other words, I make the objective function very large if the constraint is not respected, making the algorithm search for other parameters. Since I do not know how the algorithm works, is this a feasible solution? Thanks

 採用された回答

Alan Weiss
Alan Weiss 2015 年 9 月 8 日

1 投票

It seems to me that you have a nonlinear constraint with a sum of squares problem. If you examine the Optimization Decision Table, you see that you should use fmincon, not lsqnonlin. Rewrite the objective function for fmincon so that it is a sum of squares, F'*F if F is a column vector of the components of the lsqnonlin objective function.
And no, it is not a good idea to have a non-smooth objective function that takes an arbitrary large value for infeasible points.
Alan Weiss
MATLAB mathematical toolbox documentation

1 件のコメント

GMark
GMark 2015 年 9 月 8 日
Hi Alan, thanks a lot for responding. This is exactly the answer I wanted. I am already using fmincon and the on-website function fminsearchcon to double check my optimization. I wanted to use lsqnonlin as an extra tool, but I kind of realized it was not a good idea to break the function for non-feasible parameters. Thanks a lot

サインインしてコメントする。

その他の回答 (0 件)

質問済み:

2015 年 9 月 6 日

コメント済み:

2015 年 9 月 8 日

Community Treasure Hunt

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

Start Hunting!

Translated by