Numerical integration of double integral

2 ビュー (過去 30 日間)
Gunnar
Gunnar 2018 年 5 月 29 日
コメント済み: Ameer Hamza 2018 年 5 月 31 日
Dear all,
I am trying to numerically integrate the following double integral but have come across resistance:
It should be noted that similar questions have already been posed and answered in MATLAB Answers, but when I tried applying one of them (specifically, see the accepted answer https://www.mathworks.com/matlabcentral/answers/127087-using-integral2-on-a-matrix-with-function-handler-components#answer_134468), I get the error message that "A and B must be floating point scalars".
Here is my attempt to solve this.
y1min = 0;
y2min = @(y1) y1;
f1 = @(y1,y2) integral(@(x) x/(1+x^alpha/(0.1*y1+1.1*y2)),y2,Inf,'ArrayValued',1);
f2 = @(y1,y2) exp(-2*pi*f1(y1,y2)) * exp(-pi*y2^2)*y1*y2;
f3 = @(y1) integral(@(y2) f2(y1,y2),y2min,Inf,'ArrayValued',1);
res = integral(@(y1) f3(y1),y1min,Inf,'ArrayValued',1),
PS. It would be nice if the solution method that is in the end applied is flexible enough since I also plan to numerically integrate a triple integral later on.
Many thanks for your help.
  1 件のコメント
Gunnar
Gunnar 2018 年 5 月 30 日
編集済み: Gunnar 2018 年 5 月 30 日
No answers so far...
Anyone with any idea? Help is greatly appreciated!

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

採用された回答

Ameer Hamza
Ameer Hamza 2018 年 5 月 31 日
編集済み: Ameer Hamza 2018 年 5 月 31 日
Try this
f1 = @(y1,y2) integral(@(x) x./(1+x.^4/(0.1*y1.^4+1.1*y2.^4)),y2,Inf);
f2 = @(y1,y2) exp(-2*pi*f1(y1,y2)) * exp(-pi*y2^2)*y1*y2;
f3 = @(x) integral(@(y) f2(x,y), x, inf, 'ArrayValued', 1);
result = integral(f3, 0, inf, 'ArrayValued', 1);
To extend it to triple integral, just look at how f3 and result statement are related to each other.
  4 件のコメント
Gunnar
Gunnar 2018 年 5 月 31 日
Seems to be working! :)
Thanks very much! I will accept your answer.
Ameer Hamza
Ameer Hamza 2018 年 5 月 31 日
You are welcome.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMathematics についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by