Linearize Non-Linear Optimization Constraints

121 Views Asked by At

I'm trying to add a non-linear constraint to my model that describes as the amount of heated water (m_heated @ temp_heated) required to add to other cold/inlet/network water mass (m_inlet @ temp_inlet) to result in a defined temperature temp_set. The total flow rate m_total is total mixture, given by adding both flow rates m_total = m_heated + m_inlet. Assuming the same fluid, so I'm disregarding the specific heat capacity.

temp_set = ( m_heated * temp_heated + (m_total - m_heated) * temp_inlet ) / m_total

Since my goal is to find the m_heated (to add to the optimization problem), this simplifies to:

m_heated[t] = m_total * (temp_set - temp_inlet) / (temp_heated[t] - temp_inlet)

However, this results in a non-linear equation (m_total, temp_set, temp_inlet are known), and both m_heated and temp_heated are not, and they add to other constrains as well.

Both m_heated and temp_heated values add to a second restriction that calculates the stored energy (kWh) in the heater:

heater_energy[t] = m_heated[t] * c * (temp_heated[t] - temp_inlet)) / 3600

However, this restriction also show up as non-linear. I've tried the approach found AIMMS Modeling Guide - Integer Programming Tricks, but I was not able to comprehend it completly. All [t] variables are continuous.

Any clue how to convert these expressions into linear? Thanks!

1

There are 1 best solutions below

0
On

You can either follow what given in the AIMM Integer Tricks (Pg85, Ch-7) or you can try this trick For two continuous variables $ 0 \le a, b$, define another continuous variable $0\le z$ and a constraint
$ a+b = z$
Then replace $ab$ wherever it appears with $ z^2 - (a^2+b^2)$. Most solvers will handle squares in constraints. As for squares in objective these can be replaced by another variable $y$ supported by a constraint like $ z^2 = y$