Message Boards Message Boards

0
|
3670 Views
|
1 Reply
|
2 Total Likes
View groups...
Share
Share this post:

how to handle ConditionalExpression

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

POSTED BY: peter weijnitz

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.

POSTED BY: Sean Clarke
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract