Hi, I am trying to optimize operation of CHP with objective function to minimize economic costs. I have binary variable y_CHP(t) which denotes if the CHP is on (y_CHP=1) or off (=0) at specific time. I want to minimize the number of times it turns on/off by multiplying the change by some cost parameter: (y_CHP(t1)y_CHP(t))*1000 The problem is when the state changes, y_CHP(t1)y_CHP(t)is either 1 or 1 and the cost is 1000 or 1000. So if I do this, the programm will try to have as many 1000 as possible which is not realistc. So I need to somehow make abs( y_CHP(t1)y_CHP(t) )*1000. Any idea how this can be done? Thanks! asked 28 Apr '14, 04:52 cesnjak 
While I don't really see how the sum of two binary variables, answered 28 Apr '14, 05:25 fbahr ♦ Sorry, It should say y_CHP(t1)y_CHP(t) everywhere. I will have a look at the link. Thanks!
(28 Apr '14, 05:28)
cesnjak

Well, if you add an other variable z_t that models the cost from the transition 0 to 1 or 1 to 0, you can indeed add z_t to the minimize function with the following
You can see z_t as an upper bound to the absolute value, so minimizing z_t will let you automatically find the absolute value. answered 28 Apr '14, 11:13 David 