Bessel Integration in matlab

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I was trying to do integral in matlab with below equation. Could anyone help me please to do with Riemann sum approach in matlab? Thanks in advance!!



$$int_0^inftye^-k^2/4 J_0(k)kd k$$










share|cite|improve this question























  • this is not equation. did you miss something?
    – Nosrati
    Sep 7 at 3:53










  • Thanks a lot Nosrati! I removed some constant parameters.
    – Adilah
    Sep 7 at 4:03














up vote
1
down vote

favorite












I was trying to do integral in matlab with below equation. Could anyone help me please to do with Riemann sum approach in matlab? Thanks in advance!!



$$int_0^inftye^-k^2/4 J_0(k)kd k$$










share|cite|improve this question























  • this is not equation. did you miss something?
    – Nosrati
    Sep 7 at 3:53










  • Thanks a lot Nosrati! I removed some constant parameters.
    – Adilah
    Sep 7 at 4:03












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I was trying to do integral in matlab with below equation. Could anyone help me please to do with Riemann sum approach in matlab? Thanks in advance!!



$$int_0^inftye^-k^2/4 J_0(k)kd k$$










share|cite|improve this question















I was trying to do integral in matlab with below equation. Could anyone help me please to do with Riemann sum approach in matlab? Thanks in advance!!



$$int_0^inftye^-k^2/4 J_0(k)kd k$$







integration summation matlab bessel-functions






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Sep 7 at 14:11









mathreadler

13.9k72058




13.9k72058










asked Sep 7 at 3:43









Adilah

132




132











  • this is not equation. did you miss something?
    – Nosrati
    Sep 7 at 3:53










  • Thanks a lot Nosrati! I removed some constant parameters.
    – Adilah
    Sep 7 at 4:03
















  • this is not equation. did you miss something?
    – Nosrati
    Sep 7 at 3:53










  • Thanks a lot Nosrati! I removed some constant parameters.
    – Adilah
    Sep 7 at 4:03















this is not equation. did you miss something?
– Nosrati
Sep 7 at 3:53




this is not equation. did you miss something?
– Nosrati
Sep 7 at 3:53












Thanks a lot Nosrati! I removed some constant parameters.
– Adilah
Sep 7 at 4:03




Thanks a lot Nosrati! I removed some constant parameters.
– Adilah
Sep 7 at 4:03










2 Answers
2






active

oldest

votes

















up vote
3
down vote













No need for Riemann sums. By the very definition of $J_0$,



$$ int_0^+infty e^-x^2/4xJ_0(x),dx = sum_ngeq 0frac(-1)^n4^n n!^2underbraceint_0^+infty x^2n+1 e^-x^2/4,dx_2cdot 4^ncdot n!=2sum_ngeq 0frac(-1)^nn!=colorredfrac2e. $$






share|cite|improve this answer




















  • Wow that was short. Can you please explain or point to reference on how one knows / derives the integral which becomes $2cdot 2^2ncdot n!$ ?
    – mathreadler
    Sep 7 at 14:12






  • 1




    @mathreadler: $int_0^+infty z^n e^-z,dz = n!$.
    – Jack D'Aurizio♦
    Sep 7 at 14:14






  • 1




    Ah, wait it's gamma function isn't it? I didn't see it first.
    – mathreadler
    Sep 7 at 14:17

















up vote
0
down vote













There is a closed form (compact form) solution to this integration in the Table of Integrals 7E, Eq 6.631.1 as $$int_0^inftyx^mue^-alpha x^2,J_v(beta,x),dx = fracGammaleft(frac12v+frac12mu+frac12right)beta,alpha^frac12muGammaleft(v+1right)expleft(-fracbeta^28alpharight),M_frac12mu,,frac12vleft(fracbeta^24alpharight)$$



where $Gamma(.)$ is the Gamma function, and $M_mu,v(.)$ is the Whittaker function.



If you still want to do numerically



1- define the function $$f(k)=ke^-k^2/4J_0(k)$$.



2- Define the step size, e.g., dk = 0.01.



3- Initialize a variable total = 0.



4- loop over k from 0 to some upper bound with an increment size dk.



5- for each value of k add to total the value f(k).



6- At the end of the for loop, compare the result with the analytical solution to make sure your work is correct.






share|cite|improve this answer


















  • 1




    Your initial integral lacks an $x$ term. The actual outcome does not involve $I_0(1/2)$ but just $e^-1$.
    – Jack D'Aurizio♦
    Sep 7 at 13:31










  • Right, I treated k as a constant. I will edit my answer. Thanks
    – BlackMath
    Sep 7 at 16:33










Your Answer




StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "69"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2908247%2fbessel-integration-in-matlab%23new-answer', 'question_page');

);

Post as a guest






























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
3
down vote













No need for Riemann sums. By the very definition of $J_0$,



$$ int_0^+infty e^-x^2/4xJ_0(x),dx = sum_ngeq 0frac(-1)^n4^n n!^2underbraceint_0^+infty x^2n+1 e^-x^2/4,dx_2cdot 4^ncdot n!=2sum_ngeq 0frac(-1)^nn!=colorredfrac2e. $$






share|cite|improve this answer




















  • Wow that was short. Can you please explain or point to reference on how one knows / derives the integral which becomes $2cdot 2^2ncdot n!$ ?
    – mathreadler
    Sep 7 at 14:12






  • 1




    @mathreadler: $int_0^+infty z^n e^-z,dz = n!$.
    – Jack D'Aurizio♦
    Sep 7 at 14:14






  • 1




    Ah, wait it's gamma function isn't it? I didn't see it first.
    – mathreadler
    Sep 7 at 14:17














up vote
3
down vote













No need for Riemann sums. By the very definition of $J_0$,



$$ int_0^+infty e^-x^2/4xJ_0(x),dx = sum_ngeq 0frac(-1)^n4^n n!^2underbraceint_0^+infty x^2n+1 e^-x^2/4,dx_2cdot 4^ncdot n!=2sum_ngeq 0frac(-1)^nn!=colorredfrac2e. $$






share|cite|improve this answer




















  • Wow that was short. Can you please explain or point to reference on how one knows / derives the integral which becomes $2cdot 2^2ncdot n!$ ?
    – mathreadler
    Sep 7 at 14:12






  • 1




    @mathreadler: $int_0^+infty z^n e^-z,dz = n!$.
    – Jack D'Aurizio♦
    Sep 7 at 14:14






  • 1




    Ah, wait it's gamma function isn't it? I didn't see it first.
    – mathreadler
    Sep 7 at 14:17












up vote
3
down vote










up vote
3
down vote









No need for Riemann sums. By the very definition of $J_0$,



$$ int_0^+infty e^-x^2/4xJ_0(x),dx = sum_ngeq 0frac(-1)^n4^n n!^2underbraceint_0^+infty x^2n+1 e^-x^2/4,dx_2cdot 4^ncdot n!=2sum_ngeq 0frac(-1)^nn!=colorredfrac2e. $$






share|cite|improve this answer












No need for Riemann sums. By the very definition of $J_0$,



$$ int_0^+infty e^-x^2/4xJ_0(x),dx = sum_ngeq 0frac(-1)^n4^n n!^2underbraceint_0^+infty x^2n+1 e^-x^2/4,dx_2cdot 4^ncdot n!=2sum_ngeq 0frac(-1)^nn!=colorredfrac2e. $$







share|cite|improve this answer












share|cite|improve this answer



share|cite|improve this answer










answered Sep 7 at 13:30









Jack D'Aurizio♦

275k32268640




275k32268640











  • Wow that was short. Can you please explain or point to reference on how one knows / derives the integral which becomes $2cdot 2^2ncdot n!$ ?
    – mathreadler
    Sep 7 at 14:12






  • 1




    @mathreadler: $int_0^+infty z^n e^-z,dz = n!$.
    – Jack D'Aurizio♦
    Sep 7 at 14:14






  • 1




    Ah, wait it's gamma function isn't it? I didn't see it first.
    – mathreadler
    Sep 7 at 14:17
















  • Wow that was short. Can you please explain or point to reference on how one knows / derives the integral which becomes $2cdot 2^2ncdot n!$ ?
    – mathreadler
    Sep 7 at 14:12






  • 1




    @mathreadler: $int_0^+infty z^n e^-z,dz = n!$.
    – Jack D'Aurizio♦
    Sep 7 at 14:14






  • 1




    Ah, wait it's gamma function isn't it? I didn't see it first.
    – mathreadler
    Sep 7 at 14:17















Wow that was short. Can you please explain or point to reference on how one knows / derives the integral which becomes $2cdot 2^2ncdot n!$ ?
– mathreadler
Sep 7 at 14:12




Wow that was short. Can you please explain or point to reference on how one knows / derives the integral which becomes $2cdot 2^2ncdot n!$ ?
– mathreadler
Sep 7 at 14:12




1




1




@mathreadler: $int_0^+infty z^n e^-z,dz = n!$.
– Jack D'Aurizio♦
Sep 7 at 14:14




@mathreadler: $int_0^+infty z^n e^-z,dz = n!$.
– Jack D'Aurizio♦
Sep 7 at 14:14




1




1




Ah, wait it's gamma function isn't it? I didn't see it first.
– mathreadler
Sep 7 at 14:17




Ah, wait it's gamma function isn't it? I didn't see it first.
– mathreadler
Sep 7 at 14:17










up vote
0
down vote













There is a closed form (compact form) solution to this integration in the Table of Integrals 7E, Eq 6.631.1 as $$int_0^inftyx^mue^-alpha x^2,J_v(beta,x),dx = fracGammaleft(frac12v+frac12mu+frac12right)beta,alpha^frac12muGammaleft(v+1right)expleft(-fracbeta^28alpharight),M_frac12mu,,frac12vleft(fracbeta^24alpharight)$$



where $Gamma(.)$ is the Gamma function, and $M_mu,v(.)$ is the Whittaker function.



If you still want to do numerically



1- define the function $$f(k)=ke^-k^2/4J_0(k)$$.



2- Define the step size, e.g., dk = 0.01.



3- Initialize a variable total = 0.



4- loop over k from 0 to some upper bound with an increment size dk.



5- for each value of k add to total the value f(k).



6- At the end of the for loop, compare the result with the analytical solution to make sure your work is correct.






share|cite|improve this answer


















  • 1




    Your initial integral lacks an $x$ term. The actual outcome does not involve $I_0(1/2)$ but just $e^-1$.
    – Jack D'Aurizio♦
    Sep 7 at 13:31










  • Right, I treated k as a constant. I will edit my answer. Thanks
    – BlackMath
    Sep 7 at 16:33














up vote
0
down vote













There is a closed form (compact form) solution to this integration in the Table of Integrals 7E, Eq 6.631.1 as $$int_0^inftyx^mue^-alpha x^2,J_v(beta,x),dx = fracGammaleft(frac12v+frac12mu+frac12right)beta,alpha^frac12muGammaleft(v+1right)expleft(-fracbeta^28alpharight),M_frac12mu,,frac12vleft(fracbeta^24alpharight)$$



where $Gamma(.)$ is the Gamma function, and $M_mu,v(.)$ is the Whittaker function.



If you still want to do numerically



1- define the function $$f(k)=ke^-k^2/4J_0(k)$$.



2- Define the step size, e.g., dk = 0.01.



3- Initialize a variable total = 0.



4- loop over k from 0 to some upper bound with an increment size dk.



5- for each value of k add to total the value f(k).



6- At the end of the for loop, compare the result with the analytical solution to make sure your work is correct.






share|cite|improve this answer


















  • 1




    Your initial integral lacks an $x$ term. The actual outcome does not involve $I_0(1/2)$ but just $e^-1$.
    – Jack D'Aurizio♦
    Sep 7 at 13:31










  • Right, I treated k as a constant. I will edit my answer. Thanks
    – BlackMath
    Sep 7 at 16:33












up vote
0
down vote










up vote
0
down vote









There is a closed form (compact form) solution to this integration in the Table of Integrals 7E, Eq 6.631.1 as $$int_0^inftyx^mue^-alpha x^2,J_v(beta,x),dx = fracGammaleft(frac12v+frac12mu+frac12right)beta,alpha^frac12muGammaleft(v+1right)expleft(-fracbeta^28alpharight),M_frac12mu,,frac12vleft(fracbeta^24alpharight)$$



where $Gamma(.)$ is the Gamma function, and $M_mu,v(.)$ is the Whittaker function.



If you still want to do numerically



1- define the function $$f(k)=ke^-k^2/4J_0(k)$$.



2- Define the step size, e.g., dk = 0.01.



3- Initialize a variable total = 0.



4- loop over k from 0 to some upper bound with an increment size dk.



5- for each value of k add to total the value f(k).



6- At the end of the for loop, compare the result with the analytical solution to make sure your work is correct.






share|cite|improve this answer














There is a closed form (compact form) solution to this integration in the Table of Integrals 7E, Eq 6.631.1 as $$int_0^inftyx^mue^-alpha x^2,J_v(beta,x),dx = fracGammaleft(frac12v+frac12mu+frac12right)beta,alpha^frac12muGammaleft(v+1right)expleft(-fracbeta^28alpharight),M_frac12mu,,frac12vleft(fracbeta^24alpharight)$$



where $Gamma(.)$ is the Gamma function, and $M_mu,v(.)$ is the Whittaker function.



If you still want to do numerically



1- define the function $$f(k)=ke^-k^2/4J_0(k)$$.



2- Define the step size, e.g., dk = 0.01.



3- Initialize a variable total = 0.



4- loop over k from 0 to some upper bound with an increment size dk.



5- for each value of k add to total the value f(k).



6- At the end of the for loop, compare the result with the analytical solution to make sure your work is correct.







share|cite|improve this answer














share|cite|improve this answer



share|cite|improve this answer








edited Sep 7 at 16:45

























answered Sep 7 at 5:10









BlackMath

10018




10018







  • 1




    Your initial integral lacks an $x$ term. The actual outcome does not involve $I_0(1/2)$ but just $e^-1$.
    – Jack D'Aurizio♦
    Sep 7 at 13:31










  • Right, I treated k as a constant. I will edit my answer. Thanks
    – BlackMath
    Sep 7 at 16:33












  • 1




    Your initial integral lacks an $x$ term. The actual outcome does not involve $I_0(1/2)$ but just $e^-1$.
    – Jack D'Aurizio♦
    Sep 7 at 13:31










  • Right, I treated k as a constant. I will edit my answer. Thanks
    – BlackMath
    Sep 7 at 16:33







1




1




Your initial integral lacks an $x$ term. The actual outcome does not involve $I_0(1/2)$ but just $e^-1$.
– Jack D'Aurizio♦
Sep 7 at 13:31




Your initial integral lacks an $x$ term. The actual outcome does not involve $I_0(1/2)$ but just $e^-1$.
– Jack D'Aurizio♦
Sep 7 at 13:31












Right, I treated k as a constant. I will edit my answer. Thanks
– BlackMath
Sep 7 at 16:33




Right, I treated k as a constant. I will edit my answer. Thanks
– BlackMath
Sep 7 at 16:33

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2908247%2fbessel-integration-in-matlab%23new-answer', 'question_page');

);

Post as a guest