2

I have a number of linear and non-linear equations and inequalities (about twenty), and am looking for solutions to these. The equations either relate or constrain a number of variables. These variables are either constant, allowed to be within some range, or are being solved for. I would like to be able to easily adjust this.

I have considered python-constraint, as well as LMFIT and scipy.optimize.fsolve, but haven't had much luck. Although I don't understand them very well, so I might be missing something!

Ideally, I would like to be able to write something along these lines (just an example):

variables = {x1: 23, x2: [2:51], x3, x4: 1, x5}
equations = [x1**2 = x2 - x3, x5 / x1 * pi = x3, x3 <= 34, x5 > 0]
x1, x2, x3, x4, x5 = solve_equations(variables, equations)

Is something like this possible?

Heisenbugs
  • 35
  • 4

0 Answers0