Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

A Plotting the CS power spectrum

  1. Feb 17, 2016 #1
    I'm having difficulty plotting the kernel [itex]I(k_{1},k)[/itex] 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. jcsd
  3. Feb 22, 2016 #2
    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?
  4. Feb 28, 2016 #3
    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.
  5. Feb 29, 2016 #4
    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?
  6. Feb 29, 2016 #5
    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.
  7. Mar 2, 2016 #6
    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.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted

Similar Threads for Plotting power spectrum
I Vertical axis of the CMB power spectrum
I Most powerful collision ever?