Plotting the CS power spectrum

In summary, the OP is struggling with plotting the kernel I(k1,k) of the cosmic shear power spectrum, which involves a double integral and relies on spherical bessel functions. They have tried using Python libraries but have not been successful due to the slow performance of their laptop and the complexity of the problem. They are seeking assistance and recommendations for resources to speed up the numerical integration task. It is suggested that they may need to switch to a compiled language for more efficient calculations.
  • #1
sunrah
199
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.
 
  • #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.
 
  • #4
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?
 
  • #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.
 
  • #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 realize that it is not a plotting problem.

Good luck.
 

Related to Plotting the CS power spectrum

1. What is a CS power spectrum?

A CS power spectrum is a graphical representation of the distribution of power across different frequencies in a signal. It is used to analyze the strength and frequency components of a signal, such as in the field of signal processing.

2. How is a CS power spectrum plotted?

A CS power spectrum is typically plotted using a mathematical technique called the Fourier transform, which converts a signal from the time domain to the frequency domain. The resulting plot shows the power at each frequency, with higher peaks indicating stronger signals at those frequencies.

3. What is the significance of plotting the CS power spectrum?

Plotting the CS power spectrum can provide valuable insights into the characteristics of a signal. It can help identify dominant frequencies, detect noise or interference, and reveal patterns or trends in the data. This information can be useful in various fields, such as physics, engineering, and biology.

4. What are some common applications of plotting the CS power spectrum?

Plotting the CS power spectrum has a wide range of applications, including audio and image processing, telecommunications, biomedical engineering, and astronomy. It is also commonly used in scientific research to analyze data from experiments and simulations.

5. Are there any limitations to plotting the CS power spectrum?

While plotting the CS power spectrum can provide valuable information, it does have some limitations. One limitation is that it assumes the signal is stationary, meaning it does not change over time. Additionally, the accuracy of the spectrum can be affected by factors such as noise, signal processing techniques, and the length of the signal being analyzed.

Similar threads

Replies
2
Views
1K
Replies
1
Views
787
  • Calculus and Beyond Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
8
Views
2K
Replies
4
Views
5K
  • Introductory Physics Homework Help
Replies
17
Views
3K
  • Special and General Relativity
Replies
1
Views
562
  • Special and General Relativity
Replies
1
Views
1K
  • Electromagnetism
Replies
1
Views
5K
Back
Top