MINLP optimization using GA reaching different solutions every run

2 views (last 30 days)
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. I describe the problem in more detail below. I have programed this using matlabs global optimization toolbox and the ga solver. I run the solver and each time I run the solver I get a different solution. I am thinking this is because ga is no able to properly search the solution space for an optimal solution? Is it unable to cope with the use of x_3 to turn the generator off?
The solver stops with this status:
> Optimization terminated: average change in the penalty fitness value > less than options.TolFun and constraint violation is less than > options.TolCon.
*Problem Description*
x_1 is the generator output at any one point in time and is constrained to be between a min and max capacity
x_2 is an integer variable used simply to turn the generator off completely
x_3 lastly is another integer variable used to apply a startup cost whenever the generator is switched on.
x_1, x_2 and x_3 are vectors where the index of the vector (eg. x_1(1:5) is the data for the first 5 hours)
*Objective Function (totrevenue6):*
efficiency6 = 0.2621*x_1 - 0.1229*x_1^2 + 0.2543
income6 = {-x_1*(AC_1 + FC_1 - P_1 + FC_1)}/{efficiency6}
revenue6 = - SC_1*x_3 - x_2*(income6)
**totrevenue6** = -sum(revenue6)
*Constraints:*
- min_capacity <= generator6 power (x_1) <= max_capacity
- 0 <= generator6 toggle (x_2)<= 1
- The startup constraint (x_3) is x_2-x_{2-1}<=x_3 and rearranging
-x_{2-1}+x_2-x_3<=0
- 0 <= (x_3)<= 1
So my question(s) why does ga solver reach a new solution every time I run it? How do I get the solver to solve this type of problem?
many thanks

Accepted Answer

Matt J
Matt J on 13 Dec 2014
Edited: Matt J on 13 Dec 2014
The results of ga can be random, because it uses random mutation of a population of test points as part of its search.
If I take your problem statement literally, it looks like it can be simplified to a common MILP and solved with intlinprog, which should make the results more reliable. In particular, totalrevenue6 looks like it is a monotonic function of income6 which is in turn monotonic as a function of x_1. So you can optimize with respect to x1 independently, reducing the problem to an objective and constraints that are linear in the binary variables x_2 and x_3.
However, your problem description looks like it has several holes:
First, it is unclear what totalrevenue is summing over. Are you summing over hours? Over generators? Both? If x1,x2,x3 have further hidden indices over generators/hours, you should unhide them for us.
Similarly, what is x_j in the "startup constraint"? Does j=1,2,3 or is j an index for something else that's been hideen? The constraint x_2-x_1-s_1<=0 looks very strange if x_1 still refers here to generator output and x_2 still refers to the binary on/off state of the generator. Since you mention (x3), I assume you really might mean x3_j where j s an index for .... something.
Finally, it looks like you are minimizing income6, which is also strange. If I expand your expression for totalrevenue6, rearranging the minus signs, I obtain
totalrevenue6 = sum( SC_1*x_3 + x_2*(income6) )
In other words, your objective function improves if you decrease income6, which seems counter-intuitive.
  4 Comments
Jesse
Jesse on 14 Dec 2014
I agree the negatives are not intuitive. These are being generated from the symbolic toolbox. Ive programed
  • income6 = X_1.*(P_1-CC_1-AC_1-FC_1./efficiency6);
  • revenue6 = X_2.*(income6) - SC_1.*X_3;
  • totrevenue6 = -sum(revenue6);
the point about the efficiency being monotonic is a great help. I see your point now about solving for x_1 first, then solving for x_2 and x_3. In the future I must add additional constraints to the generators capacity, but I believe the same will still hold then.
many thanks, Jesse
Jesse
Jesse on 21 Jan 2015
I have continued to develop the program to optimize the set of generators and I now need to make sure that a minimum demand is met. In order to do so I have added the profit from two additional blocks to the objective function.
income6 = {(x_16)*(AC_1 + FC_1 - P_1 + FC_1/{el_efficiency6})}
revenue6 = - SC_16*x_36 + x_26*(income6)
income7 = {(x_17)*(AC_1 + FC_1 - P_1 + FC_1/{el_efficiency7})}
revenue7 = - SC_17*x_37 + x_27*(income6)
income8 = {(x_18)*(AC_1 + FC_1 - P_1 + FC_1/{el_efficiency8})}
revenue8 = - SC_18*x_38 + x_28*(income6)
*totrevenue6* = -sum(revenue6+revenue7+revenue8)
In order to solve this problem before I used your suggestion to take advantage of the monotonic relationship and split the problem into two parts. Optimization for the generator output first, then a second optimization to take care of the remaining constraints. As a result however, if I want to make sure a minimum demand is met, I have to add two separate constraints, the first optimization of x_1 and the second for the optimization of x_2 and x_3:
  • x_16 + x_17 + x_18 >= (thermal_demand at time t)*thermal_efficiency
  • x_26*x_16 + x_27*x_17 + x_28*x_18 >= (thermal_demand at time t)*thermal_efficiency
Essentially I need to make sure that both optimizations meet the demand for each time step.
I do not believe that this breaks the monotonic relationship. But I am worried that it wont lead to an optimal result. Does this formulation make sense and can it lead to an optimal result?
Many thanks, Jesse

Sign in to comment.

More Answers (0)

Categories

Find more on Get Started with Optimization Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!