In MATLAB, can we use ga with numerical constraint ?

It might be weird question, if i cannot perform the analytic function of constraint, i have only numerical constraint, can we use ga with this numerical constraints?
thank you very much. best regard!!

 Respuesta aceptada

Star Strider
Star Strider el 7 de Sept. de 2015
If you want to put only upper and lower bounds on your parameters, you have to fill the unused arguments with ‘empty’ values using the empty matrix, [].
For instance, to only specify the upper and lower bounds:
LB = [ ... ]; % Vector Of Lower Bounds For Each Parameter
UB = [ ... ]; % Vector Of Upper Bounds For Each Parameter
x = ga(fitnessfcn,nvars,[],[],[],[],LB,UB)

2 comentarios

chan trea
chan trea el 7 de Sept. de 2015
so if I have the numerical constraint such as nonlinear constraint. what can I handle with it?
Star Strider
Star Strider el 7 de Sept. de 2015
I’ve rarely used nonlinear constraints, usually only linear constraints and parameter bounds. I thought you wanted to impose parameter bounds.
Writing your nonlinear constraint function depends on what you want to do. I refer you to the documentation under Input Arguments for nonlcon. See specifically Vectorized Constraints.

Iniciar sesión para comentar.

Más respuestas (1)

Greg Heath
Greg Heath el 7 de Sept. de 2015
Editada: Walter Roberson el 7 de Sept. de 2015
Of course.
Check the ga documentation:
help ga
doc ga
Hope this helps.
Thank you for formally accepting my answer
Greg

Etiquetas

Preguntada:

el 7 de Sept. de 2015

Editada:

el 7 de Sept. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by