0
|
3911 Views
|
|
2 Total Likes
View groups...
Share
GROUPS:

# how to handle ConditionalExpression

Posted 10 years ago
 I'm aware that nowadays Mathematica have inbuilt Maxwell distribution. But if I type the expression for a maxwell distribution. In[34]:= maxwellianPDF[v, a] = (v^2 Exp[-a v^2])/ Integrate[v^2 Exp[-a v^2], {v, 0, Infinity}] I get: Out[34]= ConditionalExpression[(4 a^(3/2) E^(-a v^2) v^2)/Sqrt[[Pi]],Re[a] > 0] And if I type the cumulative distribution using In[34]: In[35]:= maxwellCDF[w_] = Integrate[ maxwellianPDF[v, a], {v, 0, w/Sqrt[a]}] I get: Out[35]= ConditionalExpression[-((2 E^-w^2 w)/Sqrt[[Pi]]) + Erf[w], Re[a] > 0] Out[35] does not contain the parameter a but maxwellCDF still needs to know that Re[a]>0 So e.g. trying to plot the CDF does not work unless I set a to some arbitrary value. is there some smother way to handle this? Peter
 You can Integrate with the assumption that a is positive. Assuming[a > 0, (v^2 Exp[-a v^2])/Integrate[v^2 Exp[-a v^2], {v, 0, Infinity}]] Mathematica has a framework for declaring assumptions like these. There's also a global variable for tracking assumptions called \$Assumptions.