integral multiple infinite limits

16 ビュー (過去 30 日間)
kostas
kostas 2011 年 9 月 2 日
Hi , i have to solve one more difficult integral...its an integral like this
fun=[exp(-u^2)*(fun1(v,u,x,Kt)dv)*(fun2(v,u,x,Kt)dv]du
The limits are for v[1e-9,Inf] and u[-inf,inf]
I tried to transform the function mydblquad of Mike Hossea http://www.mathworks.com/matlabcentral/answers/14514-double-integral-infinite-limits but i didn't manage to do it..Is there any idea??? Thanks!!!

採用された回答

Mike Hosea
Mike Hosea 2011 年 9 月 2 日
Try this:
function q = paris(fun1,fun2,x,Kt)
% q = ∫[exp(-u^2)*(∫fun1(v,u,x,Kt)dv)*(∫fun2(v,u,x,Kt)dv]du
% The limits are 1e-9 <= v < inf and -inf < u < inf.
a = 1e-9;
innerintegral = @(u) ...
arrayfun(@(u1) ... % u1 is always a scalar here.
exp(-u1^2) * ...
quadgk(@(v)fun1(v,u1*ones(size(v)),x,Kt),a,inf) * ...
quadgk(@(v)fun2(v,u1*ones(size(v)),x,Kt),a,inf), ...
u);
q = quadgk(innerintegral,-inf,inf);
  3 件のコメント
Mike Hosea
Mike Hosea 2011 年 9 月 2 日
If fun1 and fun2 are m-files, you need to use "@", i.e. paris(@fun1,@fun2,x,Kt). You leave off the "@" when they are instead variables to which you have stored anonymous functions. Note that the way I set it up, fun1 and fun2 are both functions of 4 variables: v, u, x, and Kt.
kostas
kostas 2011 年 9 月 2 日
Ok , that works perfect!!
Thanks a lot again!!!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNumerical Integration and Differentiation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by