I am trying to implement a model, and I have this conditional Piecewise function, as part of the model.
where T_zone(=293) and T_in(=348) are previously defined constants, x2 and x5 are variables dependent on other equations that depend on T_in and T_out.
All of them have defined initial values.
temperature_zone=293.0
T_in = m.Var(value=temperature_zone)
T_zone = m.Var(value=temperature_zone)
x2 = m.Var(value=temperature_zone)
x5 = m.Var(value=temperature_zone)
Tout = m.Var(value=temperature_zone)
Tp1out=m.Var(value=temperature_zone)
m1out=m.if3(((2.0*(x2))-T_in-T_zone), 0, ((2.0*(x2))-T_in-T_zone))
m.Equation(T_p1out== T_zone+m1out)
m2out=m.if3(((2.0*(x5))-T_p1out-T_zone), 0, ((2.0*(x5))-T_p1out-T_zone))
m.Equation(T_out == T_zone+m2out)
In the code above, I tried separating the equation into 2 parts, and make the result of the if condition to be added as an additional variable to the base/minimum value, and it resulted in no solutions.