evalf is a function. You have to give the precision as an argument:

>>> Prob.evalf(4)
0.7333
>>> Prob.evalf(10)
0.7333134908

Kalevi Suominen

On Monday, April 26, 2021 at 7:56:31 PM UTC+3 [email protected] wrote:

> Hi everyone,
> I am trying to compute the normal distribution of a function. So I need to 
> integrate from 'a' to 'b' and get a decimal answer that would be the 
> probability. When I integrate I get erf; how do I convert to decimal?[image: 
> Formula.png]
>
> This is my code:
> import sympy as syms
> from sympy import exp,sqrt,pi
> a=195
> b=205
> x= syms.symbols('x')
> u=202
> rho=4
> f=syms.exp((-(x-u)**2)/(2*rho**2))/(rho*syms.sqrt(2*syms.pi)) 
> Prob= syms.integrate(f,(x,a,b))
> Prob.evalf
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/050d8b3c-7032-4386-8630-e84ff293e4c7n%40googlegroups.com.

Reply via email to