Having Trouble Plotting the Cosmic Shear Power Spectrum Kernel?

Click For Summary

Discussion Overview

The discussion revolves around the challenges of plotting the cosmic shear power spectrum kernel, specifically the double integral involved in its computation. Participants explore issues related to numerical integration and the efficiency of different programming languages for this task.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • The original poster (OP) describes difficulties in plotting the kernel I(k_{1},k) due to slow performance and lack of clarity on the expected curve shape.
  • Some participants question how the OP intends to plot a double integral without solving it first, suggesting that a function is needed for plotting.
  • The OP mentions successfully plotting the integral numerically but faces performance issues on their laptop and seeks techniques to speed up numerical integration.
  • One participant clarifies that the issue is related to numerical integration rather than plotting, suggesting reliance on documentation for integration methods.
  • Another participant recommends considering compiled languages like C or Fortran for better performance in intensive calculations compared to Python.

Areas of Agreement / Disagreement

Participants generally agree that the problem lies in numerical integration rather than plotting. However, there is no consensus on the best approach to improve performance or the most suitable programming language for the task.

Contextual Notes

Participants note that numerical integration can be computationally intensive and that the choice of programming language may significantly affect performance. There are unresolved aspects regarding the specific techniques for speeding up integration tasks.

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.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K