Day 13

Tuesday, March 14, 2017

And why do we call it the wave equation?

Consider a function of x and t of the form *u*(*x*, *t*) = *G*(*x* − *ct*)
where *G* is any function you like (that's twice continuously differentiable).

What does that look like?

What about *u*(*x*, *t*) = *G*(*x* + *ct*)?

Are these representable as mixtures of the normal modes we found?

Let's generalize the problems we've been looking at so far.

Going way back to Ch. 1, we have the following PDE for the temperature
profile *u*(*x*, *t*) in a slender bar, allowing all the material properties
all to be non-constant:

*c*(*x*)*ρ*(*x*)*A*(*x*)*u*_{t}(*x*, *t*) = (*A*(*x*)*K*_{0}(*x*)*u*_{x}(*x*, *t*))_{x}.

Setting *u*(*x*, *t*) = *φ*(*x*)*h*(*t*) this says

*c*(*x*)*ρ*(*x*)*A*(*x*)*φ*(*x*)*h*^{′}(*t*) = (*A*(*x*)*K*_{0}(*x*)*φ*^{′}(*x*))^{′}*h*(*t*)

which separates as

(*h*^{′}(*t*))/(*h*(*t*)) = ((*A*(*x*)*K*_{0}(*x*)*φ*^{′}(*x*))^{′})/(*c*(*x*)*ρ*(*x*)*A*(*x*)*φ*(*x*)) = − *λ*

giving

*h*^{′}(*t*) = − *λ**h*(*t*),

(*A*(*x*)*K*_{0}(*x*)*φ*^{′}(*x*))^{′} + *λ**c*(*x*)*ρ*(*x*)*A*(*x*)*φ*(*x*) = 0.

Let us assume the bar has uniform material composition, so that *K*_{0}
*ρ* and *c* do not depend on location - say *K*_{0}(*x*) = 1, *ρ*(*x*) = 1,
*c*(*x*) = 1, but we allow the cross-sectional area, *A*(*x*), to vary.

Also, let's assume we will hold the left-hand end (x=0) at 0 degrees, and insulate the opposite end (x=L) so the flux is zero at x=L.

Then the spatial eigenproblem becomes:

(*A*(*x*)*φ*^{′}(*x*))^{′} + *λ**A*(*x*)*φ*(*x*) = 0,

*φ*(0) = 0, *φ*^{′}(*L*) = 0.

If we can find some solutions of this ODE BVP, then they are spatial eigenfunctions
of the PDE. *A priori* they might not be orthogonal, though, and it might be possible that we'll have
only a limited number of them. (The Sturm-Liouville theory will answer these worries.)

Let us pick some specific varying cross-section function, *A*(*x*) and then
use an ODE solver in Python to try and find the eigenvalues and eigenfunctions
for the corresponding ODE for *φ*(*x*) using the *"shooting"*
method I will describe.

Suppose we choose *A*(*x*) = 1.1 + cos(2*π**x*)/(*L*)

(Python code to draw bar here)

What do **you** think the slowest-decaying (i.e. smallest *λ*) eigenfunction will look like in this problem?
Think about it, then draw your guess on the board, and sign it!

Will the *λ*_{1} for this non-uniform bar be larger (i.e. mode decays faster)
or smaller (i.e. mode decays slower) than the *λ*_{1} for the uniform bar?

Numerical ODE solvers are all set up to solve systems of *1st order* ODES.
So we'll need to convert our 2nd order ODE to that form.

First expand the first term of the ODE using the product rule as:

(*A**φ*^{′})^{′} = *A**φ*^{′′} + *A*^{′}*φ*^{′}.

Then continue by defining *φ*′ = *ψ*, say.

Specifically, let us find the first (smallest) several eigenvalues and make a plot the corresponding eigenfunctions.

It would be nice to compare and contrast with the eigenthings for a uniform bar, and see
if our eigenvalues and eigenfunctions (especially *λ*_{1}
and *φ*_{1}(*x*)) for this particular non-uniform bar "make sense".

Can we also check to see if your eigenfunctions are orthogonal? (Just one pair, let's say.)

We will see that we actually have to modify the definition of orthogonality slightly to make this work:

∫^{L}_{0}*φ*_{1}(*x*)*φ*_{2}(*x*)*σ*(*x*)*dx* = 0

where *σ*(*x*) is a weighting function specific to the DE we're solving.

If we have two eigenfunctions and the weighting function all evaluated at a grid of x-values (the same grid for all), then the integral of their product can be approximated by forming the elementwise product of the three vectors and summing.

Note on checking orthogonality: We are computing approximations to
the eigenfunctions, so they cannot be expected to be *exactly*
orthogonal. So when we compute the (weighted) integral of their product,
which you expect to be zero, you have to have some sense of how small
is close enough to zero. Whatever this measure is, it should account
for the fact that eigenfunctions are determined only up to scale.
Thus your measure of their (lack of) orthogonality should be invariant
(unchanged) if either of the eigenfunctions is rescaled. One way of
doing this is to normalize all your eigenfunctions (analogous to making
them "unit vectors") as follows:

*φ*(*x*) → (*φ*(*x*))/(√(∫^{L}_{0}*φ*(*x*)^{2}*σ*(*x*)*dx*)).

Then if the "scalar product"

∫^{L}_{0}*φ*_{1}(*x*)*φ*_{2}(*x*)*σ*(*x*)*dx*

is small *compared to 1*, *φ*_{1} and *φ*_{2} can be
considered approximately orthogonal.