From this program.............
num = 4
x, u = symbols('x u')
Irr = Function('Irr')(u)
Irr = 4*pi**2*u**2*Abs(integrate(0.25*(1-cos(2*pi*x*num))*exp(-I*2*pi*u*x), (x, 0, 1)))**2 # Notice the use of Abs function.
print(N(Irr.subs(u,1.1)))
The result is ..................
0.0279388389446924 + 1.23479674389006e-24*I
But it is supposed to be a real number, not a complex, even with an imaginary part close to zero !!!
On the other hand, the same program on PyCharm - Python 3.5 is 0.0279388389446924 (just real number)
Am I doing something wrong?
My system is.............
The version of the notebook server is 4.2.3 and is running on:
Python 3.5.2 |Anaconda 4.2.0 (64-bit)| (default, Jul 2 2016, 17:53:06)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]