13.07.2014 Views

Madagascar Programming Reference Manual

Madagascar Programming Reference Manual

Madagascar Programming Reference Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 2<br />

An example: Finite-Difference<br />

modeling<br />

To demonstrate the use of the RSF library, a time-domain finite-difference modeling program<br />

is explained in detail.<br />

2.1 Introduction<br />

This section presents time-domain finite-difference modeling [1] written with the RSF library.<br />

The program is demonstrated with the C, C++ and Fortran 90 interfaces. The<br />

acoustic wave-equation<br />

∆U − 1 v 2 ∂ 2 U<br />

∂t 2<br />

= f(t)<br />

can be written as<br />

|∆U − f(t)|v 2 = ∂2 U<br />

∂t 2 ,<br />

where ∆ is the Laplacian symbol, f(t) is the source wavelet, v is the velocity, and U is a<br />

scalar wavefield. A discrete time-step involves the following computations:<br />

U i+1 = [∆U − f(t)]v 2 ∆t 2 + 2U i − U i−1 ,<br />

where U i?1 , U i and U i+1 represent the propagating wavefield at various time steps. In this<br />

exercise we shall use a discrete Laplacian accurate up to the fourth order and the second<br />

derivative of time is accurate up to the second order.<br />

13

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!