Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.

 View Only
Expand all | Collapse all

Optimizing memory usage on quadratic problem

  • 1.  Optimizing memory usage on quadratic problem

    Posted Tue December 03, 2013 05:33 PM

    Originally posted by: TimTC


    Hello, thanks for reading a potentially really silly question. I have a machine that turns on (1) and off (0) throughout the day. I want to penalize the switching, while still fulfilling a total amount of output (amongst other constraints).
    What I thought of so far:
    Subtract the state of the machine by the previous state and store that in a set of cplex variables, so that machine states (0 1 1 1 0) become switching states (1 0 0 0 -1).
     
    Now there's a 1 or -1 everytime the machine turns on or off. I would like to penalize these values, but I'm not sure how to deal with the negative sign. One solution I thought of was to square the variable using a quadratic constraint so that I can just multiply the variables with the switching cost, but this generates many huge matrices that only contain one value and makes cplex really slow.
     
    Is there a more efficient way of doing this? Am I missing something? =(
     
    Thank you!

    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Optimizing memory usage on quadratic problem

    Posted Wed December 04, 2013 04:22 PM

    The more typical approach (which has the advantage of preserving linearity) is to define three variables at each time t: s_t is the state during time period t; x_t is 1 if you turn the machine on at the start of period t, 0 if not; and y_t is 1 if you turn the machine off at the start of period t, 0 if not. (I'm assuming state changes occur at the start of a period, but you can modify easily if they occur at the end of the period. x and y must be declared binary, but s can be declared continuous over the domain [0, 1] so long as you give the machine an initial state of either 0 or 1. The state equations (assuming you begin at time t = 0 with the machine in state s0) are:

    s_0 = s0

    s_t = s_{t-1} + x_t - y_t

    In the objective function, you penalize x_t and y_t (equally or not, your choice). The domain restriction 0 <= s_t <= 1 ensures that you never turn on a machine that is already running or turn off a machine that is already idle. Penalizing x and y in the objective is enough to ensure that you do not try to turn the machine both off and on at the same time.

    Paul


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Optimizing memory usage on quadratic problem

    Posted Thu December 05, 2013 02:32 PM

    Originally posted by: TimTC


    Hello!

    I was actually thinking about having separate on / off variables but couldn't figure out a way to tie them to the state variables! thanks for laying things out so clearly.

    Thank you so much again!

     

    Tim

     


    #CPLEXOptimizers
    #DecisionOptimization