Borrar filtros
Borrar filtros

nonlinear optimization constraints problem

1 visualización (últimos 30 días)
Zhang Zhang
Zhang Zhang el 24 de Mzo. de 2020
Comentada: Zhang Zhang el 13 de Mayo de 2020
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?

Respuestas (1)

Alan Weiss
Alan Weiss el 24 de Mzo. de 2020
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
  1 comentario
Zhang Zhang
Zhang Zhang el 13 de Mayo de 2020
Sry to reply late. That worked well with my code, thanks.

Iniciar sesión para comentar.

Categorías

Más información sobre Problem-Based Optimization Setup en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by