I am trying to solve the optimization problem with 4 variables.
I have to give constraint in the scipy.optimize
,
the constraint is x[1] < x[2] < x[3] < x[4]
.
Is there any methodology to solve this problem in scipy.optimise
Asked
Active
Viewed 42 times
1

Manju l
- 13
- 2
-
`<` and `>` are not possible in optimization, only `≤` and `≥` (related to the mathematical concept of compactness). Sometimes, we can fudge: `x[1] < x[2] <=> x[1] ≤ x[2] - 0.0001`. – Erwin Kalvelagen May 30 '22 at 18:57
1 Answers
0
You can do a variable transformation, for example,
y[1]=x[1]
y[2] = x[2]-x[1]
y[3] = x[3]-x[2]
y[4] = x[4]-x[3]
Then you can use constraints like y[2] > 0
, y[3] > 0
, etc.

The Photon
- 1,242
- 1
- 9
- 12