A Having Trouble Plotting the Cosmic Shear Power Spectrum Kernel?

AI Thread Summary
The discussion centers on difficulties in plotting the kernel I(k_{1},k) of the cosmic shear power spectrum, particularly regarding numerical integration and plotting techniques. The original poster (OP) struggles with slow performance on their laptop while using Python libraries like SymPy and SciPy. Respondents clarify that the issue lies in numerical integration rather than plotting, suggesting that the OP needs to solve the double integral before plotting. Recommendations include exploring more efficient programming languages, such as C or Fortran, for faster computation. Overall, the conversation emphasizes the importance of addressing numerical integration challenges in the context of plotting complex functions.
sunrah
Messages
191
Reaction score
22
I'm having difficulty plotting the kernel I(k_{1},k) of the cosmic shear power spectrum which is defined as
<br /> I(k_{1},k) = k_{1}\int^{\infty}_{0}r j_{l}(k_{1}r)dr \int^{r}_{0}\frac{r-r&#039;}{r&#039;}j_{l}(kr&#039;)\sqrt{P^{\Phi\Phi}(k)}dr&#039;<br />

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.
 
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.
 
https://en.wikipedia.org/wiki/Recombination_(cosmology) Was a matter density right after the decoupling low enough to consider the vacuum as the actual vacuum, and not the medium through which the light propagates with the speed lower than ##({\epsilon_0\mu_0})^{-1/2}##? I'm asking this in context of the calculation of the observable universe radius, where the time integral of the inverse of the scale factor is multiplied by the constant speed of light ##c##.
Why was the Hubble constant assumed to be decreasing and slowing down (decelerating) the expansion rate of the Universe, while at the same time Dark Energy is presumably accelerating the expansion? And to thicken the plot. recent news from NASA indicates that the Hubble constant is now increasing. Can you clarify this enigma? Also., if the Hubble constant eventually decreases, why is there a lower limit to its value?
Back
Top