Edit1: Sorry i found lens next to avatar ^^
Please can I ask newbie q, i need to make signum variable from another variable.
(tried things like type Int in variable type / sign function in constrains but get errors from solver/constrains)
But i am failing even with 2 state (0,1) variable:
using JuMP using Ipopt model = Model() @variable(model, d) @objective(model, Max, d ) @constraint(model, d^2 == d) set_optimizer(model, Ipopt.Optimizer) optimize!(model) value(d)
EXIT: Optimal Solution Found.
But d can be 1 :-/
How is possible to do sign like behavior?
model = Model() @variable(model, d) @variable(model, x) @objective(model, Max, d ) @constraint(model, (x) == 4.65) #@constraint(model, abs(x) == d*x) @constraint(model, d*x == abs(x))
ERROR: MethodError: no method matching abs(::VariableRef)