How to Integrate TWO times separately over different unknown parameters (THREE integrals in total) and come up with numerical result? My simulation is endless.

2 views (last 30 days)
I will try to explain my problem as clear as possible. Thank you for your help in advance!
There are three integrals in my equation, w.r.t parameters "v","d" and "phi", as shown in the picture below. Their limits are [0 Inf], [0,30] and [0 pi] respectively.
NOTE that the latter Two of them are in the index (power) of "e", so they should be calculated first and then go to the former integral (the first one). The integrand of the latter two integrals have the parameter of the first integral "v" so that the result of these two integrals should hold this parameter and send it to the former integral.
is the Bessel Function with first kind and zero order, which can be written as "besselj(0,z)" in MATLAB.
I need numerical result at last. I tried to use function "int()" and "vpaintegral()" but both come up with symbolic results and cannot be converted, because of the multiple unknown parameters. Thus, using functions "integral()" and "integral2()" is the best way.
My idea is, first step calculating the latter two integrals using "@(v) integral2(@(d,phi) func, 0,30,0,pi)". Second step using "integral(@(v) ...)" and call the functional result of the first step.
step1 = @(v)integral2(@(d,phi) 0.0054.*besselj(0,v.*phi.*(30-d)).*phi./(8.*pi.*(1.854-1.848.*cos(phi)).^(3./2)),0,30,0,pi);
step2 = integral(@(v) 3.*exp(-2.5.*10.^(-7).*v.^2-4.53).*besselj(0,0.3.*v).*v.*(exp(step1(v))-1),0,Inf,'ArrayValued',true);
This can also be done by writing a single-line code.
result = integral(@(v) 3.*exp(-2.5.*10.^(-7).*v.^2-4.53).*besselj(0,0.3.*v).*v.*(exp(integral2(@(d,phi) 0.0054.*besselj(0,v.*phi.*(30-d)).*phi./(8.*pi.*(1.854-1.848.*cos(phi)).^(3./2)),0,30,0,pi))-1),0,Inf,'ArrayValued',true);
When running the code, there is a warning showing up repeatly, and the compiling is ENDLESS (keeps running). I guess the issue is in the second step. But if I change the coefficients in this equaion to a simpler form, sometimes the result comes up.
Warning: Reached the maximum number of function evaluations (10000). The result fails the global error test.
I am wondering if anything is wrong or improper here.

Answers (1)

David Hill
David Hill on 26 Jan 2021
I would try something like:
syms phi d v;
A=vpaintegral(3*exp(-2.5e-7*v^2-4.53)*besselj(0,.3*v)*v*...
(exp(vpaintegral(vpaintegral((.0054*besselj(0,v*phi*(30-d))*phi)/...
(8*pi*(1.854-1.848*cos(phi))^1.5),d,0,pi), phi,0,30))-1),v,0,inf);
I am not sure how much run time is needed. I ran it for several minutes with no result.
  7 Comments
Jianming Wang
Jianming Wang on 27 Jan 2021
Edited: Jianming Wang on 27 Jan 2021
@Paul Hi, I tried to use trapezoidal method but I noticed that this method doesn't allow integration from "0" to "Inf" for parameter "v". I have to look into that to see if there is a solution to deal with the upper limit of "v".
Paul
Paul on 28 Jan 2021
Can't have v cover 0 to inf with trapezoidal, so instead need to integrate over v to some large number where it's believed the integral has converged close enough to the limit. I've been playing around with this problem and I'm seeing the integral over v oscillating. Presumably it's known that this integral converges in the limit as the upper bound on v approaches inf? If it does converge, it seems to be converging rather slowly from what I can tell.

Sign in to comment.

Products


Release

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!