# A Plotting the CS power spectrum

1. Feb 17, 2016

### sunrah

I'm having difficulty plotting the kernel $I(k_{1},k)$ of the cosmic shear power spectrum which is defined as
$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'$

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.

2. Feb 22, 2016

### Greg Bernhardt

Thanks for the post! This is an automated courtesy bump. Sorry you aren't generating responses at the moment. Do you have any further information, come to any new conclusions or is it possible to reword the post?

3. Feb 28, 2016

### fizzy

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.

4. Feb 29, 2016

### sunrah

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?

5. Feb 29, 2016

### fizzy

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.

6. Mar 2, 2016

### fizzy

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 realise that it is not a plotting problem.

Good luck.