In the case of plane-wave propagation in the x direction within a uniform medium, the homogeneous momentum equation (3.9) for shear waves can be expressed as
∂ 2 u ∂ t 2 = β 2 ∂ 2 u ∂ x 2 ,
where u is the displacement. Write a computer program that uses finite differences to solve this equation for a bar 100 km in length, assuming β = 4 km/s. Use dx = 1 km for the length spacing and dt = 0.1 s for the time spacing. Assume a source-time function at u(50 km) of the form
u 50 ( t ) = sin 2 ( π t 5 ) , 0 < t < 5 s .
Apply a stress-free boundary condition at u(0 km) and a fixed boundary condition at u(100 km). Approximate the second derivatives using the finite difference scheme:
∂ 2 u ∂ x 2 = u i + 1 − 2 u i + u i − 1 d x 2 .
Plot u(x) at 4 s intervals from 1 to 33 s. Verify that the pulses travel at velocities of 4 km/s. What happens to the reflected pulse at each endpoint? What happens when the pulses cross?
Create an animation of your seismic pulse and show me how it and your code works in a short video submission created with Kaltura capture.
Hint: Examples of part of the code to do this problem in MATLAB and Python are provided
PYTHON
import numpy as np
(initialize t, dx, dt, tlen, beta and ul, u2, u3 arrays)
while (t