python - SymPy integration, constant term -
i can't understand behavior of sympy.integrate() function. simplest example, integrate , differentiate:
t = sy.symbol('t') t1 = sy.symbol('t1') f = sy.function('f')(t) = sy.integrate(f, (t, 0, t1)) f1 = i.diff(t1) print f1 prints following:
f(t1) + integral(0, (t, 0, t1)) but expect see f(t). calling f1.simplify() not help.
why not sympy symplify second term? how kill it?
you may invoke doit method:
>>> f1.doit() f(t1) i believe sympy reluctant perform these operations automatically since may arbitrarily expensive, , there no universal system of predicting how expensive be. maybe wise add heuristics integrals of 0 - don't know. if interested in seeing "fixed" might want consider opening issue @ http://github.com/sympy/sympy/issues
Comments
Post a Comment