필터 지우기
필터 지우기

evaluating double integral iteratively

조회 수: 1 (최근 30일)
R yan
R yan 2014년 7월 14일
댓글: Star Strider 2014년 7월 14일
I am trying to discretize a kernel K(x,t) for solving an integral equation. I need to implement
for i=1...N
for j=1..N
a(i,j) = Int1 Int2 K(x,t)dx dt
where Int1 has limits i/N to (i+1)/N and Int2 has limits j/N to (j+1)/N
I tried the symbolic computation but it takes a lot of time. I want to use the numerical computation and speed it up. thanks

답변 (1개)

Star Strider
Star Strider 2014년 7월 14일
If K(x,t) is a function, you can use integral2.
  댓글 수: 2
R yan
R yan 2014년 7월 14일
thanks. Does integral2 implement the iterative version?? I mean in Int1 Int2 K(x,t)dxdt, does it evaluate the integral Int2 K(x,t)dx treating t as constant?? and then evaluate Int1 over t.
Star Strider
Star Strider 2014년 7월 14일
My pleasure!
That’s my understanding of how integral2 works. See the More About in the documentation, and its friends (linked to at the end of the page). Note that only integral can take array-valued functions, so if K(x,t) in one such, you’ll have to nest calls to integral. If it’s scalar-valued, the integral functions will be happy and will return a scalar.

댓글을 달려면 로그인하십시오.

카테고리

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