I am trying to minimize the following equation:
P_ch_max = min(22, E_need*m_int) where E_need*m_int
can be bigger or lower than 22 depending on the data.
I am using the following equations in pyomo
to do it:
m.C6 = ConstraintList()
for t in m.ts2:
m.C6.add(expr = m.char_power - m.var_E_need[0,t]*m_int <= 100*m.Y[t])
m.C6.add(expr = m.var_E_need[0,t]*m_int - m.char_power <= 100 * (1-m.Y[t]))
m.C6.add(expr = m.var_P_ch_max[0,t] <= m.var_E_need[0,t]*m_int )
m.C6.add(expr = m.var_P_ch_max[0,t] <= m.char_power)
m.C6.add(expr = m.var_P_ch_max[0,t] >= m.var_E_need[0,t]*m_int - 100*(1-m.Y[t]))
m.C6.add(expr = m.var_P_ch_max[0,t] >= m.char_power - 100*m.Y[t])
m.char_power = 22; m.Y
is a boolean;
100 is my big` in this case
When I substitute the values of Y manually, these equations make sense:
When Y=0
I get that P_ch_max<= 22
and P_ch_max>= 22
which would make P_ch_max == 22
.
When Y=1
I get that P_ch_max<= E_need*m_int
and P_ch_max>= E_need*m_int
which would make P_ch_max = E_need*m_int
.
However, when I run the code in pyomo
it says it's unfeasible or unbounded and I don't understand why. Is there any other way to do this? Or can you tell me if I am doing something wrong pls?