Borrar filtros
Borrar filtros

How to deal with implicit non-linear constraint in MATLAB GA function

4 visualizaciones (últimos 30 días)
Min Zhang
Min Zhang el 22 de Mayo de 2019
Editada: Sergio Bragagnolo el 23 de Abr. de 2020
I already have non-linear constraints in my problem, which is handled by a non-linear constraint subroutine.
Now I want to add one more constraint and I think it is called "implicit" constraint, which can not be described as an explicit formula/function as the variables I am optimizing. To add this constraint, I need to read the outputs (which is calculated by a black box, an external .exe) and get the value "Output_h" and then the constraint is "Output_h<=LIMIT".
I think I have two options:
  1. Modify the objective function value. In my objective function subroutine (which reads the input.txt, call and run the black box, read the outputs, calculate the objective function), I will check the value "Output_h" to see whether it is satisfying the above constraint. If not, I will add a much larger value to the initial objective function value. I think this is called the penalty approach.
  2. Add one more non-linear constraint. In my non-linear constraint subroutine, I will call and run the black box, read the outputs, and get the value "Output_h" and then add the constraint "Output_h - LIMIT <= 0".
What do you think?
But I have some concerns:
  1. For the first option, based on my understanding, GA will learn from the previous generation (probably learn from the objective function value) and generate the next generation. But here, I modify the initial objective function value. I am wondering how GA will learn from this and try to get a better solution gradually. Actually/physically, even I don't know how to generate a better solution since the value "Output_h" is an "implicit" function of the input variables (I am optimizing more than 10 variables).
  2. For the second option, it seems that in my non-linear constraint subroutine, I will have a lot of codes the same as my objective function subroutine, including reading the input.txt, calling and running the black box, reading the outputs. For me, it seems that for each GA population/case, the black box will be called twice (in both non-linear constraint and objective function subroutines)? Do you think it is wasting of time? Do I have a better way to do this? In addition, every run of the black box will take around 60s, which is the reason why I am trying to find a more efficient way to add this constraint.
Thanks!
Min

Respuestas (1)

Sergio Bragagnolo
Sergio Bragagnolo el 23 de Abr. de 2020
Editada: Sergio Bragagnolo el 23 de Abr. de 2020
Hello, I have a similar problem in my optimization problem.
I found the posibility of using a unique function for the objetive function and the non-linear constraint but I haven't implemented it yet.
Good luck.
Sergio

Categorías

Más información sobre Genetic Algorithm en Help Center y File Exchange.

Productos


Versión

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by