this is my first time on overflow and i’m pretty new to using jupyter and sympy. i’m trying to integrate a function numerically as it simply cannot be done analytically, and here’s the code:
from sympy import exp, integrate, symbols
b, G, a, P = symbols('b G a P', nonzero=True, positive=True, real=True, constant=True)
t=symbols('t', positive=True, real=True)
f = 1/((1-b*G*t))**2*exp(-a*G/(1-b*G*t)-t/P)
res = integrate(f, (t, 0, 1/(b*G)))
print (res)
I’m not encountering any errors on running it, but the result is simply Integral(exp(-t/P)*exp(-G*a/(-G*b*t + 1))/(G*b*t - 1)**2, (t, 0, 1/(G*b)))
which is just the integral itself unsolved.
I don’t even know how to begin troubleshooting, any idea why this is happening?
cody is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.