Having Trouble Plotting the Cosmic Shear Power Spectrum Kernel?

Join the discussion
Registration is free. Start your own thread to ask a follow-up.
4 replies · 2K views
sunrah
Messages
191
Reaction score
22
I'm having difficulty plotting the kernel [itex]I(k_{1},k)[/itex] of the cosmic shear power spectrum which is defined as
[itex] I(k_{1},k) = k_{1}\int^{\infty}_{0}r j_{l}(k_{1}r)dr \int^{r}_{0}\frac{r-r'}{r'}j_{l}(kr')\sqrt{P^{\Phi\Phi}(k)}dr'[/itex]

where the jl are spherical bessel functions.
I'v tried plotting I vs. k1 using python's sympy and scipy, but with no luck. My laptop is incredibly slow and I'm not thrilled by the results. It doesn't help that I can't see what this curve should look like. All assistance appreciated. If you know any helpful resources that would also be great.
 
Astronomy news on Phys.org
OP, how do you hope to plot a double integral without solving it ? Maybe you are assuming we all know what you are doing.

gnuplot is quite flexible and powerful plotting tool but it needs a fn to plot it cannot plot an integral.
 
fizzy said:
OP, how do you hope to plot a double integral without solving it ? Maybe you are assuming we all know what you are doing.

gnuplot is quite flexible and powerful plotting tool but it needs a fn to plot it cannot plot an integral.

I'v now plotted it numerically but it takes such a long time on my laptop and I still need to increase the number of data points. Are there any techniques to speed up this kind of numerical integration task?
 
OK , so what you have is a problem with numerical integration , not a plotting problem. That makes more sense.

If you rely on libraries ( I assume it's scipy providing the generic integration method ) you have to take what you get or dig the doc for information about options.

If you need something more specific, I suspect you are going to have to do some work. Sorry.
 
I should also point out the python is an interpreted language and is probably not the best solution for doing this kind of intensive calculation. You could look for a C or Fortran library or other compiled language which would certainly reduce run times considerably.

Numerical integration is a standard problem. I'm sure many solutions are available now you realize that it is not a plotting problem.

Good luck.