How do I refine my integration?

2 ビュー (過去 30 日間)
DM
DM 2015 年 1 月 27 日
コメント済み: DM 2015 年 2 月 1 日
I am using integral and integral2 functions to numerically integrate, I am however very skeptical about the results. I was wondering how would one make the results more accurate? Any options that can make the answere more accutare.
  1 件のコメント
Star Strider
Star Strider 2015 年 1 月 27 日
What function are you numerically integrating?
What makes you skeptical about the results?

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

採用された回答

Mike Hosea
Mike Hosea 2015 年 2 月 1 日
編集済み: Mike Hosea 2015 年 2 月 1 日
I don't disagree with John at all, but here are some things that come to mind that you might do to either lend credence to, or to discredit the results you are getting, as the case may be.
if the region is finite and you are using the 'auto' method, then you can specify the 'iterated' method to perform an independent calculation using a different method.
integral2(f,a,b,c,d,'method','iterated')
Unfortunately, if any of the limits are infinite, it automatically chooses the iterated method, so of course specifying the iterated method won't change anything in that case.
Secondly, you can manipulate the tolerances. E.g.
integral2(f,a,b,c,d,'AbsTol',1e-12,'RelTol',1e-12)
Obviously this is intended to increase the accuracy of the output, but it assumes that the output is already accurate to approximately the degree implied by the default tolerances. If that is not the case, then you should not expect that this will necessarily have any effect. However, it might help the integrator to catch some variability in the integrand that it previously glossed over. This is more of a negative test in the sense that if you tighten the tolerances and they answer changes wildly, then you have problems, but if you tighten the tolerances and nothing changes, it doesn't mean anything.
Third, you can subdivide the region yourself into smaller pieces and add up the integrals over the smaller pieces. Especially try to put any interesting behavior on the boundary of a sub-integral. Getting consistent results no matter how you subdivide the region is a good sign.
Fourth, there are 3rd-party integrators written for MATLAB that can be downloaded from the file exchange. Some of them could provide independently computed results that would either lend credence to the results MATLAB is returning or cast doubt on them. If you have a smooth integrand, some of them can use quite high orders.
  1 件のコメント
DM
DM 2015 年 2 月 1 日
Thank you Mike you are always helpful and clear for questions regarding integral. I was wondering if you give my other question a look:
I would appreciate it.

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

その他の回答 (2 件)

John D'Errico
John D'Errico 2015 年 1 月 27 日
Huh? You have given us NO information to help you, except that you are doing an integration. I find myself left with many questions, any or all of which point to entirely possible factors, including the last one I mention.
- What is the kernel?
- What did you try?
- Are you using the tools improperly?
- Do you just have the tolerances set improperly for the problem you are trying to solve?
- Have you set the limits too wide?
- Is this just a very difficult problem to integrate?
- Is your kernel highly nonlinear? Are there singularities?
- Do you just have no clue as to how to use a numerical integration tool?
I'm sorry, but I have no idea what your capabilities are, so the last is entirely plausible since you have given us no information at all.
So you could read the help for those tools, which would tell you how to use them in great detail, including how one would set tolerances. I know, real men don't need no steenkin help.

Youssef  Khmou
Youssef Khmou 2015 年 1 月 27 日
編集済み: Youssef Khmou 2015 年 1 月 27 日
Accurate result is obtained if you use the same sampling rate,as the original function, in integral.

カテゴリ

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