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:


The problem is when the state changes, y_CHP(t-1)-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(t-1)-y_CHP(t) )*1000.

Any idea how this can be done?


asked 28 Apr '14, 04:52

cesnjak's gravatar image

accept rate: 0%

edited 28 Apr '14, 05:27

While I don't really see how the sum of two binary variables, y_CHP(t-1) + y_CHP(t) (w/ y_CHP in {0,1}), ever results in -1 ... @Paul Rubin has written a blog post for you (and me, and everyone who has had, still has or will have this question): http://orinanobworld.blogspot.com/2012/07/modeling-absolute-values.html


answered 28 Apr '14, 05:25

fbahr's gravatar image

fbahr ♦
accept rate: 13%

edited 28 Apr '14, 07:24

Sorry, It should say y_CHP(t-1)-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

z_t >= y_CHP(t-1)-y_CHP(t)
z_t >= y_CHP(t)-y_CHP(t-1)

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's gravatar image

accept rate: 12%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 28 Apr '14, 04:52

Seen: 1,646 times

Last updated: 28 Apr '14, 11:13

OR-Exchange! Your site for questions, answers, and announcements about operations research.