6 edited tags | link edited Jun 27 '15 at 8:27 J. M. will be back soon♦ 101k1111 gold badges320320 silver badges479479 bronze badges 5 Typos edited Oct 30 '14 at 6:27 cmbfast 1544 bronze badges I want to plot the following indefinite integral : $$C_l^{CC}=\int k^2\mathrm{d}k\: [e^{-2k^{2}}P_{Cl}^2(k\eta)|\dot{h}(\eta)|^2]$$ with k from 0 to some large value (considered to be $$\infty$$), where: $$P_{Cl}(k\eta) = \frac{2(l+2)}{(2l+1)}j_{l-1}(k\eta) - \frac{2(l-1)}{2l+1} j_{l+1}(k\eta)$$ $$\dot{h}(\eta) = r^{1/2} [A_1j_2(k\eta)+A_2y_2(k\eta)]$$ where $$A_1=\frac{3k-k\cos{2k}+2\sin{2k}}{2k^2}$$ $$A_2 = \frac{2-2\cos{2k}-k-2k^2}{2k^2}$$ $$j_l$$ are the spherical Bessel functions and $$y_l$$ are spherical Neumann functions. $$\eta$$ may be set to $$0.0195$$. I would like to do a LogLogPlot of the above integral with $$l$$ on the x axis and maybe even manipulate over the values $$r=0.01,0.1,0.3$$. However NIntegrate took an exceedingly long time to evaluate the integral and returned nothing after several minutes of waiting. What approach should i take now for plotting ? Edit : New error for the moment with the codes i tried p[l_, k_] := (2 (l + 2))/(2 l + 1) SphericalBesselJ[l - 1, k] - (2 (l - 1))/(2 l + 1) SphericalBesselJ[l + 1, k] d[k_] := (1/2)(E^(-2 k^2)) a[k_] := (3 k - k Cos[2 k] + 2 Sin[2 k])/(2 k^2) b[k_] := (2 - 2 Cos[2 k] - k Sin[2 k] - 2 k^2)/(2 k^2) h[k_] := k(a[k] SphericalBesselJ[2, k] + b[k] SphericalBesselY[2, k]) NIntegrate[k^2 (d[k])^2 (p[l, k])^2 (h[k])^2 /. l -> 1, {k, 0.1, 10}]  $$\eta$$ is set to $$1$$ for simplicity. And yeah i haven't even plotted yet. Just tried to integrate. Edit #2 : Thanks to @Koen for pointing errors in code. After successful NIntegrate I tried to plot the results ListLogLinearPlot[Table[NIntegrate[-k^2ListLogLinearPlot[Table[NIntegrate[k^2 (d[k])^2 (p[l, k])^2 (h[k])^2, {k, 110, 10100}],{l, 0.1, 50, 0.1}], Joined -> True, AxesLabel -> Automatic,Frame -> True, Axes -> False] But I was expecting something like this (according to textbooks) Where could I have gone wrong ? I want to plot the following indefinite integral : $$C_l^{CC}=\int k^2\mathrm{d}k\: [e^{-2k^{2}}P_{Cl}^2(k\eta)|\dot{h}(\eta)|^2]$$ with k from 0 to some large value (considered to be $$\infty$$), where: $$P_{Cl}(k\eta) = \frac{2(l+2)}{(2l+1)}j_{l-1}(k\eta) - \frac{2(l-1)}{2l+1} j_{l+1}(k\eta)$$ $$\dot{h}(\eta) = r^{1/2} [A_1j_2(k\eta)+A_2y_2(k\eta)]$$ where $$A_1=\frac{3k-k\cos{2k}+2\sin{2k}}{2k^2}$$ $$A_2 = \frac{2-2\cos{2k}-k-2k^2}{2k^2}$$ $$j_l$$ are the spherical Bessel functions and $$y_l$$ are spherical Neumann functions. $$\eta$$ may be set to $$0.0195$$. I would like to do a LogLogPlot of the above integral with $$l$$ on the x axis and maybe even manipulate over the values $$r=0.01,0.1,0.3$$. However NIntegrate took an exceedingly long time to evaluate the integral and returned nothing after several minutes of waiting. What approach should i take now for plotting ? Edit : New error for the moment with the codes i tried p[l_, k_] := (2 (l + 2))/(2 l + 1) SphericalBesselJ[l - 1, k] - (2 (l - 1))/(2 l + 1) SphericalBesselJ[l + 1, k] d[k_] := (1/2)(E^(-2 k^2)) a[k_] := (3 k - k Cos[2 k] + 2 Sin[2 k])/(2 k^2) b[k_] := (2 - 2 Cos[2 k] - k Sin[2 k] - 2 k^2)/(2 k^2) h[k_] := k(a[k] SphericalBesselJ[2, k] + b[k] SphericalBesselY[2, k]) NIntegrate[k^2 (d[k])^2 (p[l, k])^2 h[k] /. l -> 1, {k, 0.1, 10}]  $$\eta$$ is set to $$1$$ for simplicity. And yeah i haven't even plotted yet. Just tried to integrate. Edit #2 : Thanks to @Koen for pointing errors in code. After successful NIntegrate I tried to plot the results ListLogLinearPlot[Table[NIntegrate[-k^2 (d[k])^2 (p[l, k])^2 h[k], {k, 1, 10}],{l, 0.1, 50, 0.1}], Joined -> True, AxesLabel -> Automatic,Frame -> True, Axes -> False] But I was expecting something like this (according to textbooks) Where could I have gone wrong ? I want to plot the following indefinite integral : $$C_l^{CC}=\int k^2\mathrm{d}k\: [e^{-2k^{2}}P_{Cl}^2(k\eta)|\dot{h}(\eta)|^2]$$ with k from 0 to some large value (considered to be $$\infty$$), where: $$P_{Cl}(k\eta) = \frac{2(l+2)}{(2l+1)}j_{l-1}(k\eta) - \frac{2(l-1)}{2l+1} j_{l+1}(k\eta)$$ $$\dot{h}(\eta) = r^{1/2} [A_1j_2(k\eta)+A_2y_2(k\eta)]$$ where $$A_1=\frac{3k-k\cos{2k}+2\sin{2k}}{2k^2}$$ $$A_2 = \frac{2-2\cos{2k}-k-2k^2}{2k^2}$$ $$j_l$$ are the spherical Bessel functions and $$y_l$$ are spherical Neumann functions. $$\eta$$ may be set to $$0.0195$$. I would like to do a LogLogPlot of the above integral with $$l$$ on the x axis and maybe even manipulate over the values $$r=0.01,0.1,0.3$$. However NIntegrate took an exceedingly long time to evaluate the integral and returned nothing after several minutes of waiting. What approach should i take now for plotting ? Edit : New error for the moment with the codes i tried p[l_, k_] := (2 (l + 2))/(2 l + 1) SphericalBesselJ[l - 1, k] - (2 (l - 1))/(2 l + 1) SphericalBesselJ[l + 1, k] d[k_] := (1/2)(E^(-2 k^2)) a[k_] := (3 k - k Cos[2 k] + 2 Sin[2 k])/(2 k^2) b[k_] := (2 - 2 Cos[2 k] - k Sin[2 k] - 2 k^2)/(2 k^2) h[k_] := k(a[k] SphericalBesselJ[2, k] + b[k] SphericalBesselY[2, k]) NIntegrate[k^2 (d[k])^2 (p[l, k])^2 (h[k])^2 /. l -> 1, {k, 0.1, 10}]  $$\eta$$ is set to $$1$$ for simplicity. And yeah i haven't even plotted yet. Just tried to integrate. Edit #2 : Thanks to @Koen for pointing errors in code. After successful NIntegrate I tried to plot the results ListLogLinearPlot[Table[NIntegrate[k^2 (d[k])^2 (p[l, k])^2 (h[k])^2, {k, 10, 100}],{l, 0.1, 50}], Joined -> True, AxesLabel -> Automatic,Frame -> True, Axes -> False] But I was expecting something like this (according to textbooks) Where could I have gone wrong ? 4 Image size reduced and minor typo corrected edited Oct 30 '14 at 6:02 cmbfast 1544 bronze badges I want to plot the following indefinite integral : $$C_l^{CC}=\int k^2\mathrm{d}k\: [e^{-2k}P_{Cl}^2(k\eta)|\dot{h}(\eta)|^2]$$$$C_l^{CC}=\int k^2\mathrm{d}k\: [e^{-2k^{2}}P_{Cl}^2(k\eta)|\dot{h}(\eta)|^2]$$ with k from 0 to some large value (considered to be $$\infty$$), where: $$P_{Cl}(k\eta) = \frac{2(l+2)}{(2l+1)}j_{l-1}(k\eta) - \frac{2(l-1)}{2l+1} j_{l+1}(k\eta)$$ $$\dot{h}(\eta) = r^{1/2} [A_1j_2(k\eta)+A_2y_2(k\eta)]$$ where $$A_1=\frac{3k-k\cos{2k}+2\sin{2k}}{2k^2}$$ $$A_2 = \frac{2-2\cos{2k}-k-2k^2}{2k^2}$$ $$j_l$$ are the spherical Bessel functions and $$y_l$$ are spherical Neumann functions. $$\eta$$ may be set to $$0.0195$$. I would like to do a LogLogPlot of the above integral with $$l$$ on the x axis and maybe even manipulate over the values $$r=0.01,0.1,0.3$$. However NIntegrate took an exceedingly long time to evaluate the integral and returned nothing after several minutes of waiting. What approach should i take now for plotting ? Edit : New error for the moment with the codes i tried p[l_, k_] := (2 (l + 2))/(2 l + 1) SphericalBesselJ[l - 1, k] - (2 (l - 1))/(2 l + 1) SphericalBesselJ[l + 1, k] d[k_] := (1/2)(E^(-2 k^2)) a[k_] := (3 k - k Cos[2 k] + 2 Sin[2 k])/(2 k^2) b[k_] := (2 - 2 Cos[2 k] - k Sin[2 k] - 2 k^2)/(2 k^2) h[k_] := k(a[k] SphericalBesselJ[2, k] + b[k] SphericalBesselY[2, k]) NIntegrate[k^2 (d[k])^2 (p[l, k])^2 h[k] /. l -> 1, {k, 0.1, 10}]  $$\eta$$ is set to $$1$$ for simplicity. And yeah i haven't even plotted yet. Just tried to integrate. Edit #2 : Thanks to @Koen for pointing errors in code. After successful NIntegrate I tried to plot the results ListLogLinearPlot[Table[NIntegrate[-k^2 (d[k])^2 (p[l, k])^2 h[k], {k, 1, 10}],{l, 0.1, 50, 0.1}], Joined -> True, AxesLabel -> Automatic,Frame -> True, Axes -> False] But I was expecting something like this (according to textbooks) Where Where could I have gone wrong ? I want to plot the following indefinite integral : $$C_l^{CC}=\int k^2\mathrm{d}k\: [e^{-2k}P_{Cl}^2(k\eta)|\dot{h}(\eta)|^2]$$ with k from 0 to some large value (considered to be $$\infty$$), where: $$P_{Cl}(k\eta) = \frac{2(l+2)}{(2l+1)}j_{l-1}(k\eta) - \frac{2(l-1)}{2l+1} j_{l+1}(k\eta)$$ $$\dot{h}(\eta) = r^{1/2} [A_1j_2(k\eta)+A_2y_2(k\eta)]$$ where $$A_1=\frac{3k-k\cos{2k}+2\sin{2k}}{2k^2}$$ $$A_2 = \frac{2-2\cos{2k}-k-2k^2}{2k^2}$$ $$j_l$$ are the spherical Bessel functions and $$y_l$$ are spherical Neumann functions. $$\eta$$ may be set to $$0.0195$$. I would like to do a LogLogPlot of the above integral with $$l$$ on the x axis and maybe even manipulate over the values $$r=0.01,0.1,0.3$$. However NIntegrate took an exceedingly long time to evaluate the integral and returned nothing after several minutes of waiting. What approach should i take now for plotting ? Edit : New error for the moment with the codes i tried p[l_, k_] := (2 (l + 2))/(2 l + 1) SphericalBesselJ[l - 1, k] - (2 (l - 1))/(2 l + 1) SphericalBesselJ[l + 1, k] d[k_] := (1/2)(E^(-2 k^2)) a[k_] := (3 k - k Cos[2 k] + 2 Sin[2 k])/(2 k^2) b[k_] := (2 - 2 Cos[2 k] - k Sin[2 k] - 2 k^2)/(2 k^2) h[k_] := k(a[k] SphericalBesselJ[2, k] + b[k] SphericalBesselY[2, k]) NIntegrate[k^2 (d[k])^2 (p[l, k])^2 h[k] /. l -> 1, {k, 0.1, 10}]  $$\eta$$ is set to $$1$$ for simplicity. And yeah i haven't even plotted yet. Just tried to integrate. Edit #2 : Thanks to @Koen for pointing errors in code. After successful NIntegrate I tried to plot the results ListLogLinearPlot[Table[NIntegrate[-k^2 (d[k])^2 (p[l, k])^2 h[k], {k, 1, 10}],{l, 0.1, 50, 0.1}], Joined -> True, AxesLabel -> Automatic,Frame -> True, Axes -> False] But I was expecting something like this (according to textbooks) Where could I have gone wrong ? I want to plot the following indefinite integral : $$C_l^{CC}=\int k^2\mathrm{d}k\: [e^{-2k^{2}}P_{Cl}^2(k\eta)|\dot{h}(\eta)|^2]$$ with k from 0 to some large value (considered to be $$\infty$$), where: $$P_{Cl}(k\eta) = \frac{2(l+2)}{(2l+1)}j_{l-1}(k\eta) - \frac{2(l-1)}{2l+1} j_{l+1}(k\eta)$$ $$\dot{h}(\eta) = r^{1/2} [A_1j_2(k\eta)+A_2y_2(k\eta)]$$ where $$A_1=\frac{3k-k\cos{2k}+2\sin{2k}}{2k^2}$$ $$A_2 = \frac{2-2\cos{2k}-k-2k^2}{2k^2}$$ $$j_l$$ are the spherical Bessel functions and $$y_l$$ are spherical Neumann functions. $$\eta$$ may be set to $$0.0195$$. I would like to do a LogLogPlot of the above integral with $$l$$ on the x axis and maybe even manipulate over the values $$r=0.01,0.1,0.3$$. However NIntegrate took an exceedingly long time to evaluate the integral and returned nothing after several minutes of waiting. What approach should i take now for plotting ? Edit : New error for the moment with the codes i tried p[l_, k_] := (2 (l + 2))/(2 l + 1) SphericalBesselJ[l - 1, k] - (2 (l - 1))/(2 l + 1) SphericalBesselJ[l + 1, k] d[k_] := (1/2)(E^(-2 k^2)) a[k_] := (3 k - k Cos[2 k] + 2 Sin[2 k])/(2 k^2) b[k_] := (2 - 2 Cos[2 k] - k Sin[2 k] - 2 k^2)/(2 k^2) h[k_] := k(a[k] SphericalBesselJ[2, k] + b[k] SphericalBesselY[2, k]) NIntegrate[k^2 (d[k])^2 (p[l, k])^2 h[k] /. l -> 1, {k, 0.1, 10}]  $$\eta$$ is set to $$1$$ for simplicity. And yeah i haven't even plotted yet. Just tried to integrate. Edit #2 : Thanks to @Koen for pointing errors in code. After successful NIntegrate I tried to plot the results ListLogLinearPlot[Table[NIntegrate[-k^2 (d[k])^2 (p[l, k])^2 h[k], {k, 1, 10}],{l, 0.1, 50, 0.1}], Joined -> True, AxesLabel -> Automatic,Frame -> True, Axes -> False] But I was expecting something like this (according to textbooks) Where could I have gone wrong ? 3 New plots added edited Oct 30 '14 at 5:52 cmbfast 1544 bronze badges 2 Codes and new errors added edited Oct 29 '14 at 13:03 cmbfast 1544 bronze badges 1 asked Oct 29 '14 at 9:03 cmbfast 1544 bronze badges