Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Variable coefficient acoustics equation

This example is taken from

B. Fornberg, Practical Guide to Pseudo-Spectral Methods

see Section 4.2 and figures 4.2-1 and 4.2-2 in that section.

We solve

ut=vxvt=c2(x)ux\begin{align} u_t &= v_x \\ v_t &= c^2(x) u_x \end{align}

with periodic boundaries and initial condition

u(x,0)=2v(x,0)=exp⁡(−1600(x−1/4)2)u(x,0) = 2 v(x,0) = \exp(-1600(x-1/4)^2)

and

c(x)={1,−1<x<01/2,0<x<1c(x) = \begin{cases} 1, & -1 < x < 0 \\ 1/2, & 0 < x < 1 \end{cases}

The characteristic variables are

w1=u/2−v/(2c),w2=u/2+v/(2c)w_1 = u/2 - v/(2c), \qquad w_2 = u/2+ v/(2c)

and

∂tw1−c∂xw1=0,∂tw2+c∂xw2=0\partial_t w_1 - c \partial_x w_1 = 0, \qquad \partial_t w_2 + c \partial_x w_2 = 0
<Figure size 1200x1000 with 1 Axes>

Make animation

Loading...

The dotted line shows the speed function c(x)c(x).