How to compute Double Integral of highly oscillating function?

조회 수: 8 (최근 30일)
Junxian
Junxian 2013년 11월 21일
답변: Mike Hosea 2013년 11월 21일
I encountered a problem of computing double integral of highly oscillating function such as:
integrate sin(a*(x-y)) where a is constant (i.e. 10) x and y are variables, the lower and upper bound for x and y are the same from 0 to 100
I tried the built-in function 'integral2', which gives me large error.
Can anyone please share some MATLAB scripts or ideas that accurately compute the above quadrature?
Thanks in advance.

답변 (1개)

Mike Hosea
Mike Hosea 2013년 11월 21일
So I assume you saw this:
>> a = 10;
>> f = @(x,y)sin(a*(x-y))
f =
@(x,y)sin(a*(x-y))
>> integral2(f,0,100,0,100,'method','tiled')
Warning: Reached the maximum number of function evaluations (10000). The
result fails the global error test.
> In funfun\private\integral2Calc>integral2t at 129
In funfun\private\integral2Calc at 9
In integral2 at 106
ans =
-2.655339166047913
The warning just tells you that the integration was never completed, so the answer is not really an answer. You could divide the region into smaller regions, but instead try the iterated method.
>> integral2(f,0,100,0,100,'method','iterated')
ans =
-3.013333361769528e-12

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by