# How to model a pump behavior using MILP?

The behavior of a pump is the following:

• If $h \geq h_{start}$, then pumped flow is a constant $Q_p$. The pump works as long as $h > h_{stop}$
• If $h \leq h_{stop}$, then pumped flow is 0. The pump will be off until $h < h_{start}$.

Here $h$ is the water level in the pumping well, $h_{start}$ is the height where the pump starts, and $h_{stop}$ is the height where the pump stops.

I modeled this using MILP as :

$$h_{temp} = b\,h_{start} + (1-b) h_{stop}$$ $$h - h_{start} \leq M (1-b)$$ $$h_{stop} - h \leq M \,b$$

$$Q = \left\{\begin{array}l Q_p & \text{if } h \geq h_{temp} \\ 0 & \text{otherwise} \end{array}\right.$$

where $b$ is a binary variable and $Q$ is the pumped flow.

This works well when $h \geq h_{start}$ or when $h \leq h_{stop}$. But I'm not sure of the behavior when $h_{stop} \leq h \leq h_{start}$. In that case, both $b=0$ and $b=1$ are valid possibilities.

Is there a way to model this behavior such that $b$ can't change value except when $h \geq h_{start}$ or when $h \leq h_{stop}$?

Thanks.

You're dealing with a system that has "hysteresis" that is, the action of the pump depends not only on the current head $h$, but also on the past history of head.

Your system has four identifiable states:

1: $h \geq h_{start}$.

2: $h \leq h_{stop}$.

3: $h_{stop} \leq h \leq h_{start}$ and $h$ was most recently at $h_{start}$.

4: $h_{stop} \leq h \leq h_{start}$ and $h$ was most recently at $h_{stop}$.

You can use two binary variables to encode these four states at any point in time. One binary variable is not going to be sufficient since it can only encode two states.

If you want to model the dynamic activity of the system, then you'll need to encode this state at each moment (in some discretized sense of "moment") in time.

• Thanks. I was hoping there was a solution that doesn't involve previous state of the hysteresis. You confirm what I thought. Sep 20 '13 at 12:52