Numerical integration of double integral with two variables

7 vues (au cours des 30 derniers jours)
Shahrukh Khan Kasi
Shahrukh Khan Kasi le 2 Sep 2020
Hi,
I am trying to numerically integrate the following double integral in MATLAB:
where Im is the imaginary part of expression, i is the imaginary number, x and y are variables while a, b, and c are constants.
Here is my attempt to solve this.
a = 3;
b = 4;
c = 5;
innerintegral = @(x) integral(@(y) (1i.*x.*y)./(y.^a-1i.*x),0,6);
outerintegral = integral(@(x) imag(exp(-1i.*x.*c+b.*innerintegral(x))),0,inf, 'ArrayValued', 1);
Is this the correct way of applying numerical integration with more than one variable? Also I am getting a warning when I run this expression which reads as "Warning: Reached the limit on the maximum number of intervals in use. Approximate bound on error is 6.7e+00. The integral may not exist, or it may be difficult to approximate numerically to the requested accuracy."
Can anyone please validate if the above implementation is a correct way of implementing the expressions state above.

Réponses (1)

David Hill
David Hill le 2 Sep 2020
Modifié(e) : David Hill le 2 Sep 2020
a = 3;
b = 4;
c = 5;
syms x y;
fun = @(x,y)(1i.*x.*y)./(y.^a-1i.*x);
I=vpaintegral(@(x)imag(exp(-1i.*x.*c+b.*vpaintegral(fun,y,0,6))),x,0,inf);
I get:
I= -0.0125514
  3 commentaires
David Hill
David Hill le 3 Sep 2020
Runs fine with the following a,b,c constants. Not sure why the other constants are causing problems.
a = 3;
b = 4;
c = 5;
syms x y;
fun = @(x,y)(1i.*x.*y)./(y.^a-1i.*x);
I=vpaintegral(@(x)imag(exp(-1i.*x.*c+b.*vpaintegral(fun,y,0,6))./x),x,0,inf);
Shahrukh Khan Kasi
Shahrukh Khan Kasi le 3 Sep 2020
Yes it does with these set of dummy values but for different values of a, b and c, sometimes it runs fine while at other times it gives error for "Failed precision goal. Try using 'MaxFunctionCalls'." Also if I change the limits of first integral from (0,6) to (0,1) it gives the same error.
My question is should there be some additional check on the values of input constants such as a, b, c and the upper limit of inner integral due to the usage of vpaintegral? During the mathematical derivation of these expressions there is no such restriction on the values of a, b and c except that they have to be greater than 0. However with the numerical integration approach it run into "Failed precision goal."

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by