【问题标题】:Quadruple integration using Gauss-Legendre quadrature使用 Gauss-Legendre 求积的四重积分
【发布时间】:2021-01-31 16:58:53
【问题描述】:

我想在 Matlab 中使用 Gauss-Legendre 求积来计算四重积分。我发现以下代码适用于双积分,但在切换到 4 个变量时,我不知道如何操作。

a = 2; b=2;
[x,w] = lgwt(50);

y=(b*(1+x))/2;
x=(a*(1+x))/2;
[X, Y] = meshgrid(x,y);
fun = @(x,y) exp(1i*x)./(sqrt(x.^2+y.^2));
t = w * fun(X,Y) * w'

我想集成的功能:

fun = @(x,y,z,t) 1./sqrt(x.^2+y.^2+z.^2+t.^2)

有人有想法吗?

【问题讨论】:

    标签: matlab numerical-integration


    【解决方案1】:

    This solution 似乎是您的最佳选择。

    整合fun = @(x,y,z,t)的最佳方式来自 a <= x <= bc <= y <= de <= z <= gh <= t <= i 是嵌套 integral3()integral()。它们都是 Matlab 的内置函数。

    Q = integral(@(x)integral3(@(y,z,t)f(x,y,z,t),c,d,e,g,h,i),a,b,'ArrayValued',true);
    

    【讨论】:

      猜你喜欢
      • 2016-12-13
      • 2016-12-13
      • 2021-10-24
      • 1970-01-01
      • 2015-01-22
      • 2019-10-01
      • 1970-01-01
      • 2023-03-17
      • 1970-01-01
      相关资源
      最近更新 更多