MATLAB Answers

0

How do I refine my integration?

DM 님이 질문을 제출함. 27 Jan 2015
최근 활동 DM 님이 댓글을 추가함. 1 Feb 2015
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

What function are you numerically integrating?
What makes you skeptical about the results?

로그인 to comment.

답변 수: 3

Mike Hosea 님의 답변 1 Feb 2015
Mike Hosea 님이 편집함. 1 Feb 2015
 채택된 답변

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

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.

로그인 to comment.


John D'Errico 님의 답변 27 Jan 2015

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.

  댓글 수: 0

로그인 to comment.


Youssef Khmou 님의 답변 27 Jan 2015
Youssef Khmou 님이 편집함. 27 Jan 2015

Accurate result is obtained if you use the same sampling rate,as the original function, in integral.

  댓글 수: 0

로그인 to comment.



Translated by