nonlinear optimization constraints problem

1 次查看(过去 30 天)
I've a optimization problem which has 2 design variables x1 and x2. There are 2 nonlinear constraints g1(x1,x2) and g2(x1,x2). g1 defines the nonlinear relationship between x1 and x2 such as x1^2 <= x2^2 - 1 and g2 can be determined after a simulation outside matlab. I chose sqp algorithm to solve the problem and the question is that sqp will calculate gradient of g2 even if g1 is violated(e.t. x1 = 1,x2 =1 ) and error will occur in g2 because of the design varibales will generate a wrong shape in simulation which can not be used. Correct shape can only be generated when g1 is satisfied. The biggest problem is that g1 can not be reformed to a linear constraint as an upper bound and a lower bound.What should I do?

回答(1 个)

Alan Weiss
Alan Weiss 2020-3-24
I suggest that you ensure that your initial point is feasible, and then insert code into your objective function that first evaluates the constraint, and, if not satisfied, returns NaN for the objective function value without any further calculation (I mean without calling the simulation).
Alan Weiss
MATLAB mathematical toolbox documentation

类别

Help CenterFile Exchange 中查找有关 Problem-Based Optimization Setup 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by