Using EXCEL Spreadsheets to Solve a 1D Wave
Equation
The goal of this tutorial is to describe how to use an EXCEL spreadsheet to compute numerically the solution
to the following initialboundary value problem for the onedimensional wave equation:
Let us introduce a finite difference mesh
x
n
=
n
Δ
x
and
t
k
=
k
Δ
t
, and let the corresponding nodal values be
denoted by
Derivatives will be approximated by central differences both in space and time,
By rearranging terms, one obtains
where
r
= (c Δ
t
/Δ
x
).
The resulting discrete equation involves three distinct time levels: known data from steps
k
 1 and
k
are
transferred to step
k
+ 1. In other words, to compute the time evolution of the solution its values at both time
t
k
and an earlier time
t
k1
must be known.
This threelevel scheme poses some challenges when imposing the initial condition. To calculate the value of
u
n
at the first time step
k
= 1, one needs information from step
k
=  1 and
k
= 0. The initial condition
u(x, 0)
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document= f(x)
provides information at step
k
= 0. Any information at an earlier time must be inferred. The initial
velocity condition can be used to do that. Imagine a row of false mesh point at time
t
=  Δ
t
=
t
1
, then the
initial velocity condition can be approximated using central differences as
thus
Assuming that the discrete wave equation also holds at
t
= 0, one can compute the value of the solution at
time
t
=
t
1
as
and substitute in the expression for
u
n
1
derived from the initial velocity condition. After rearranging one
obtains
Since
u
n
0
=
f
(
x
n
) and
g
(
x
n
) are known at all nodes, we are now in a position to specify the first two rows of
nodes. Let's see how to build an EXCEL spreadsheet that implements this calculation.
In line with the spreadsheet format used in other tutorials, we will be working with a spreadsheet where rows
represent time levels, and columns correspond to spatial nodes. In particular, throughout this tutorial we will
refer to
this spreadsheet
.
1.
How to Tabulate the Spatial/Time Interval
2.
How to Include the Initial Condition
3.
How to Compute the First Time Step
4.
How to Compute the Solution at Subsequent Time Steps
5.
How to Create an Animation of the Solution
Step 1: How to Tabulate the Spatial/Time Interval
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '11
 lo
 Math, ΔT

Click to edit the document details