数值多重积分(三重以上)怎么办? [英] How to do numerical multiple integral (more than triple)?

查看:311
本文介绍了数值多重积分(三重以上)怎么办?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用Matlab进行数值多重积分(大于三倍)?

How to do numerical multiple integral (more than triple) by using Matlab?

例如,我有一个函数,Y = Func.它有5个变种.因此,Y = func(a,b,c,d,e).如果我要对a,b,c,d,e进行积分. (var a是第一个,e是最后一个.)a = [0,b](这是一个函数句柄)的区域,b = [0,c],c = [0.d],d = [0,e],e = [0,Inf].

For example, I have a function,Y = Func. It has 5 var. Hence, Y= func(a,b,c,d,e). If I want to do the integration with respect to a,b,c,d,e. (var a is the first one, e is the last one.) And region of a = [0 ,b] (this is a function handle), b = [0,c], c= [0.d], d= [0,e], e=[0, Inf].

现在,这是我的真实"问题.代码在下面

Now, here is my 'real' question. The code is below

%%%==== just some parameters ====
a=4;
la1=1/(pi*500^2); la2= la1*5;
p1=25; p2=p1/25;
sgma2=10^(-11);
index=1;
g=2./a;
syms r u1 u2 u3 u4 u5
index = -2;  
    powe= index ;
    seta= 10^powe;
    xNor = ( (u5./u1).^(a./2)+ (u5./u2).^(a./2) + (u5./u3).^(a./2)+ (u5./u4).^(a./2) + 1    ).^(2./a);
    x = (xNor).^(0.5) * seta^(-1/a);
    q=pi.*(la1.*p1.^(2./a)+la2.*p2.^(2./a));
%%%====  parameters end ====   

      fun1 =  r./(1+ r.^a );

   out1 = int(fun1, x, Inf) ;
 out1fcn = matlabFunction(out1); %%===Convert symbolicto function handle 

 y  = @(u5,u4,u3,u2,u1) exp(-u3.*(1+2.*... %%<== in method 3, replace as 'y= exp(-u3.*(1+2.*...' 
    (  out1fcn   )./... %%<== in method 3, replace as '(  out1   )./...' 
          (  (( (u5./u1).^(a./2)+ (u5./u2).^(a./2) + (u5./u3).^(a./2)+ (u5./u4).^(a./2) + 1    ).^(2./a)).*seta.^(-2./a)))).*...
          exp(-sgma2.*q.^(-a./2).* seta.*u3.^(a./2)./...
          ((( (u5./u1).^(a./2)+ (u5./u2).^(a./2) + (u5./u3).^(a./2)+ (u5./u4).^(a./2) + 1    ).^(2./a)).^(a./2))  );

%%%=== method 1, not working ============ upper ,lower bound should be a number
%      y1 =   integral(  y  ,0,@(u2) u2);  
%      y2 =   integral(  y1 ,0,@(u3) u3); 
%      y3 =   integral(  y2 ,0,@(u4) u4); 
%      y4 =   integral(  y3 ,0,     Inf);     

%%%=== method 2, not working, y1 is already wrong  =============== 
%%%Undefined function 'minus' for input arguments of type 'function_handle'.
%      y1 =   quad(  y  ,0,@(u2) u2);  
%      y2 =   quad(  y1 ,0,@(u3) u3); 
%      y3 =   quad(  y2 ,0,@(u4) u4); 
%      y4 =   quad(  y3 ,0,     Inf);     

%%%=== method 3. not working, DOUBLE cannot convert the input expression into a double array. ==============
%      y1 =   int(  y  ,0,@(u2) u2);  
%      y2 =   int(  y1 ,0,@(u3) u3); 
%      y3 =   int(  y2 ,0,@(u4) u4); 
%      y4 =   int(  y3 ,0,     Inf);     
%      y5 =   double(y4)

推荐答案

Google搜索显示, ,没有可用的标准数值选项. 是您可以考虑使用的库.最后,如何使用蒙特卡罗?

A Google search showed that it is possible that by 2011 there was no standard numerical option available. This is a library you could consider. Finally, how about using Monte Carlo?

这篇关于数值多重积分(三重以上)怎么办?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆