matlab MINLP optimization with ga

441 Views Asked by At

I have written a program for optimizing a set of generators. I have hourly price and cost data and need to figure out when a generator should run or just stay off. There are additional constraints but that is the main problem.

I am using matlabs ga function from the global optimization toolbox to try and solve this problem since it is non-linear as well as an integer problem.

However when I try to solve I get the following error:

Error using ga (line 285) Number of variables (NVARS) must be a positive integer.

can someone please point to the source of this error? I do not know which variables it means which need to be >0

many thanks, Jesse

1

There are 1 best solutions below

1
On BEST ANSWER

"nvars: Positive integer representing the number of variables in the problem."

It is an integer not a matrix.