Hi,
I am trying to constrain my optimization for min f(x) by restricting the range allowed for a dependent variable h(x). I am using a the ga optimizer from the Optimization Toolbox. Do I need to write a penalty or barrier function into by objective function, or is there another simpler way that I can apply the constraint? I tried using the nonlcon input in the ga function, however have been unable to get it to converge. The documentation suggests that nonlcon can only take x (independent variable vector) as an input and so I think that reading in dependent variables may be a misuse of the function.
Please help! Any guidance would be greatly appreciated.
Best Answer