environmentalscience / essm

This package contains helpers to deal with physical variables and units.
https://environmentalscience.github.io/essm/
GNU General Public License v2.0
12 stars 5 forks source link

Assumptions #62

Closed schymans closed 5 years ago

schymans commented 5 years ago

This solves https://github.com/environmentalscience/essm/issues/56:

from essm.variables import Variable
from sympy import solve
from sympy.physics.units import second
class x(Variable):
     """Positive real variable."""  
     assumptions = {'positive': True, 'real': True}
assert x.is_positive == True    
print(solve(x**2 - 1))

[1]