CVX Forum: a community-driven support forum
Latest Categories Search
Home / Nonconvex / Comparison on variables

Comparison on variables

Nonconvex
Jul 22, 2014
H
Hassan
Jul 22, 2014 #1

hello dears.
how can I code sth like below on CVX?

variable x

if x>=x_max
    charge=x-x_max
    d_charge=0
elseif x<=x_min
    d_charge=x_min-x
    charge=0
else
    charge=0
    d_charge=0
end
c_min<=charge<=c_max
dc_min<=d_charge<=dc_max

regards

M
Michael C. Grant
Jul 22, 2014 #2

FAQ: Why doesn’t CVX accept my problem? [READ THIS FIRST]

Archive of CVX Forum: a community-driven support forum — Generated as a static archive