I wonder if there is a default way to implement equality constraints.
F(x) = 0 , x \in \mathbb{R}
At the moment, I create two positive variables and a nonlinear expression to design a free variable in combination with an equality constraint:
@variable(model, lambda1 >= 0)
@variable(model, lambda2 >= 0)
@NLexpression(model, lambda,
lambda1 - lambda2)
@mapping(model, market_lambda1,
+ sum(xname[s] for s in scenarios)
+ sum(ynoname[s] for s in scenarios if INDEX[s] > 0)
- 10)
@complementarity(model, market_lambda1, lambda1)
@mapping(model, market_lambda2,
- sum(xname[s] for s in scenarios)
- sum(ynoname[s] for s in scenarios if INDEX[s] > 0)
+ 10)
@complementarity(model, market_lambda2, lambda2)
or is this simply the same as:
@variable(model, lambda)
@mapping(model, market_lambda,
+ sum(xname[s] for s in scenarios)
+ sum(ynoname[s] for s in scenarios if INDEX[s] > 0)
- 10)
@complementarity(model, market_lambda, lambda)
maybe we could improve the documentation accordingly?
Hallo,
I wonder if there is a default way to implement equality constraints.
F(x) = 0 , x \in \mathbb{R}
At the moment, I create two positive variables and a nonlinear expression to design a free variable in combination with an equality constraint:
or is this simply the same as:
maybe we could improve the documentation accordingly?
Regards, Hanspeter