title: Python lmfit constraints: a < b < c
body: <p>I am using <code>lmfit</code> in Python to fit some data, which includes fitting the variables a, b, and c. I need to ensure that a &lt; b &lt; c. I found <a href="http://cars9.uchicago.edu/software/python/lmfit_MinimizerResult/constraints.html" rel="nofollow noreferrer">http://cars9.uchicago.edu/software/python/lmfit_MinimizerResult/constraints.html</a> which talks about constraints needing to be defined as inequalities and setting up dummy variables. For example, if I wanted a + b &lt;= 10, I could do:</p>
  
  <pre><code>pars.add('a',     value = 5, vary=True)
  pars.add('delta', value = 5, max=10, vary=True)
  pars.add('b',     expr='delta-a')
  </code></pre>
  
  <p>And this would ensure that a + b &lt;= 10.</p>
  
  <p>I suppose that I would need c - b > 0 and b - a > 0 (or alternatively a - b &lt; 0 and b - c &lt; 0), but I'm not sure how to code this.</p>