How to add a constraint in lsqonlin minimization?
Show older comments
In the optimization problem below, I obtain a (1x5) vector x. I want to put the following additional constraint : 2*x(2)*x(3)>x(4)^2, such that the obtained vector x satisfies this constraint. Does someone knows how to do this? Help is very much appreciated.
x0=[.5, 50, .5, .5, 0];
lb = [0, 0, 0, 0, -1];
ub = [1, 100, 1, 1, 1];
x = lsqnonlin(@fun,x0,lb,ub);
Answers (1)
Alan Weiss
on 18 Jun 2015
0 votes
For that kind of nonlinear constraint, use fmincon instead of lsqnonlin. See the Optimization Decision Table.
Alan Weiss
MATLAB mathematical toolbox documentation
Categories
Find more on Choose a Solver 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!