Converting a simple conditional statement constraint into linear equation

237 views Asked by At

I am using PuLP method to optimize a problem. I have a simple conditional statement as:

If A = 0, x = 0

Else if A>0, x = 1

How can I change it into mathematical equation (or a list of equations) if I want to use it as a constraint in optimization using PuLP method?

1

There are 1 answers

0
Erwin Kalvelagen On
0.001⋅x ≤ A ≤ 640⋅x
x ∈ {0,1}
  

For PuLP split this into two inequality constraints.