I am trying to simplify a symbolic expression with sympy.simplify, and the expression looks something like this, where all I should be left with is a e^c. But simplify does nothing to that expression. Is there a different function to do that? Or am I missing something?
Thanks!
[Edit:] The code I'm running is:
# Given the following probability function: f(c)=4*pi*(m/(2*pi*kb*T))^(3/2)*c^2*exp(-1/2*m*c^2/(kb*T))
# The ratio of the fraction of molecules with the rms speed, over 3*c_rms
# Where: c_rms=sqrt(3*kb*T/m)
# So the ratio is: f(c_rms)/f(3*c_rms)
from sympy import *
f = Symbol('f')
c = Symbol('c')
kb = Symbol('kb')
T = Symbol('T')
m = Symbol('m')
def f(c):
f=4*pi*(m/(2*pi*kb*T))**(3/2)*c**2*exp(-1/2*m*c**2/(kb*T))
return f
cr1= (3*kb*T/m)**(1/2)
cr3 = 3*cr1
p1 = f(cr1)
p3= f(cr3)
ratio = simplify(p1/p3)
print(ratio)
Where ratio is the expression to be simplified.