On Fri, 12 Feb 2021 at 14:33, mpierro3 <[email protected]> wrote: > > I tried using nsolve like you mentioned and got it to work. I then tried > again, except adding a bound, and it produced the following error: > > from sympy import * > > M_3a = symbols('M_3a') > eqn = nsolve([Eq(0.56*(0.33*M_3a**2 + 1)**1.99/M_3a, 2.77), M_3a <= 1], > [M_3a], 0.2) > print(eqn) > > AttributeError: 'LessThan' object has no attribute 'diff' > > Is nsolve able to compute with bounds?
You can use the bisect solver with both upper and lower bounds: In [17]: nsolve(sin(x), x, [3, 4], solver='bisect') Out[17]: 3.14159265358979 https://docs.sympy.org/latest/modules/solvers/solvers.html#sympy.solvers.solvers.nsolve Oscar -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAHVvXxR8CJzVTUvYeSV5eOMBBG11J%3D8YzQB9XH-_95Fov8-DjQ%40mail.gmail.com.
