Numerical integration of double integral with two variables
6 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(1 个)
David Hill
2020-9-2
编辑:David Hill
2020-9-2
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 个评论
David Hill
2020-9-3
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);
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!