Genetic Algorithm fails to find any feasible solution for a MINLP (when there are indeed feasible solutions around)

3 views (last 30 days)
Hi Everyone, long story short, I tried to use GA for a MINLP problem, but GA always terminates without finding any feasible solution.
The problem is generator scheduling, a generator runs in conjunction with other sources to meet the required electricity demand, with objective being minimizing the generator usage.
Model has 48 time points, with 96 variables in x, 1-48 being the generation level and 49-96 being boolean integer value of 0/1 to simulate the corresponding on/off state of the generator.
Assuming the max generation is 100 kW the bounds are:
-----code-----
bounds = zeros(1,96);
lb = bounds(:);
ub = bounds(:);
ub(1:48) = 100;
ub(49:96) = 1;
---end of code---
The reason I included the on/off variables is to have non-linear constraints limiting the generation to be at least 30% of the load:
----code-----
x(t) <= 100 * x(t+48) % ---- generation must not exceed 100 kW. (1)
x(t) >= 100 * 0.3 * x(t+48) % ---- generation must be at least 30 kW. (2)
---end of code---
My thoughts are, when the boolean value is 0, RHS for both (1) and (2) will be 0, forcing x(t) to be 0. When boolean value is 1, RHS of (1) will be 100 and (2) will be 30, forcing x(t) to pick a value between 30 and 100.
GA was run to minimize sum(x(1:48)) and returned result had x(49:96) being all at 1, even at time steps where I feel the generator was clearly not needed. To test my theory I changed the generation upper bound of those hours to 0, GA happily accepted the changes and gave me feasible result with generators off at those time steps (both lb and ub are 0, hence x(t) = 0 and x(t+48) = 0).
After being convinced that it is definitely possible to have the generator off at some time points, I reverted back the generation upper bound of all time points back to 100, and added a new linearly inequality in matrix A to give GA a little push:
sum(x(49:96)) <= 47
This way GA had to turn the generator off at least once in the 48 time points, which was proven possible in the previous tests.
Ran model over and over again, no feasible solutions could be found...
I am left confused, why does it solve when the variable has the range of 0:0, but not when it has a strictly wider range 0:100 ?
P.S. gaoptimset was left blank, is there something I need to do? Or should I manually set the initial population?
My apologies for the long post, I hope I made it clear and simple to understand.
Regards,
Tu
Edit:
After taking a break, I realized those non-linear constraints are in fact linear, will put them back into A and see what happens when I finish work today.

Accepted Answer

Alan Weiss
Alan Weiss on 4 May 2015
You will probably be much happier using intlinprog instead of ga. intlinprog is faster and more reliable. There is a worked example of a generator scheduling problem, different than yours, but you might find it interesting.
Alan Weiss
MATLAB mathematical toolbox documentation
  2 Comments
Tu Tu
Tu Tu on 5 May 2015
Thanks for the help! That example is definitely quite similar to my problem, however it does not solve my puzzle since it is formulated in intlinprog.
In fact I used intlinprog because GA and it worked well, I wanted to reproduce the model using GA only because of the potential expansion I am planning and the nonlinear constraints that are likely to come with it.
Tried to put all constraints into A last night, calling GA under the syntax of
x = ga(fitnessfcn,nvars,A,b,Aeq,beq,LB,UB)
Still fail to give me a feasible solution
Alan Weiss
Alan Weiss on 5 May 2015
ga runs an MINLP algorithm that is not very robust. If I were you, I would try very hard to try to turn my problem into an MILP problem, and always use intlinprog.
Alan Weiss
MATLAB mathematical toolbox documentation

Sign in to comment.

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!