I have 17 inequalities:
1: (x[0] + x[1] + x[2] + x[4] + x[6] + x[7])/(x[0] + x[1] + x[2] + x[3] + x[4] + x[5] + x[6] + x[7]) >= 0.4
2: (x[3] + x[5])/(x[0] + x[1] + x[2] + x[3] + x[4] + x[5] + x[6] + x[7]) <= 0.6
3: x[0]/(x[0] + x[1] + x[2] + x[3] + x[4] + x[5] + x[6] + x[7]) <= 0.1
4: (x[0] + x[2] + x[4] + x[6])/(x[0] + x[1] + x[2] + x[3] + x[4] + x[5] + x[6] + x[7]) <= 0.1
5: (1.2*x[11]*x[3] + 1.2*x[13]*x[5])/(x[3] + x[5]) <= 520
6: (1.2*x[11]*x[3] + 1.2*x[13]*x[5])/(x[3] + x[5]) >= 470
7: (x[0]*x[8] + x[1]*x[9] + x[10]*x[2] + x[12]*x[4] + x[14]*x[6] + x[15]*x[7])/(x[0] + x[1] + x[2] + x[4] + x[6] + x[7]) <= 420
8: (x[3] + x[7])/x[5] >= 0.05
9: (x[3] + x[7])/x[5] <= 0.2
10: x[2]/(x[3] + x[7]) >= 0.05
11: x[2]/(x[3] + x[7]) <= 0.15
12: x[5]/(x[3] + x[5]) >= 0.95
13: 0.833333333333333/x[11] >= 376
14: 0.833333333333333/x[11] <= 424
15: x[13]/x[11] >= 0.7
16: x[13]/x[11] <= 0.82
17: 1.2*x[11]*x[3] + 1.2*x[13]*x[5] <= 317300.0
And 16 variables.
I need to fit values of variables to these constraints.
Also: x[0-7] values must be between 20 and 600 x[8-15] values must be between 200 and 600
I tried scipy.optimize.minimize() optimizer with SLSQP method with using simple function as sum of all variables. But I guess it is not guarantied that minimize() satisfy all constrains. Some of my constraints are ignored.
I don't even need to minimize all values but I can't find any other solution.
P.S. I am far from math and programming, so sorry for simple mistakes.
Erwin is correct: no solver will be able to solve this completely because it's infeasible. Picking and choosing your constraints, relaxing one side each of the double-sided constraints that are non-satisfiable (11, 13), a partially valid solution is
Removing the relaxation constraint values from constraints 11 or 13 will instead produce this approximated result violating constraints 3, 4, 6, 9, 11, 12, 13, and 16:
Even constraint 13 on its own doesn't make any sense. Given the bounds of variable 11, expression 13 can only vary between
and
so there's absolutely no way it's going above 376.