Take a read of Please read: make it easier to help you. It’s easier to help if you can provide a reproducible example that someone can copy-paste. If you don’t have that, then simplify the problem as much as possible and provide what you want to do in math. Your question is a little confusing, because there is a lot of other things going on.
What are your decision variables? What is the data? What is the math formulation you’re trying to achieve? I don’t see the piecewise linearity (Piecewise linear function - Wikipedia), only two nonlinear constraints?
You should introduce flow
and level
as decision variables. Then you’ll need to add the constraints you have using @NLconstraint
. You can’t use @constraint
or @expression
because you have a 1 / level
term in there.