Day 13

Tuesday, March 14, 2017

Ch 4 Wave equation: vibrating strings, cont'd

What about those traveling waves?

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?

Ch 5: Sturm-Liouville problems

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

Heat flow in a bar of non-uniform cross-section

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)ut(x, t) = (A(x)K0(x)ux(x, t))x.

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

c(x)ρ(x)A(x)φ(x)h(t) = (A(x)K0(x)φ(x))h(t)

which separates as

(h(t))/(h(t)) = ((A(x)K0(x)φ(x)))/(c(x)ρ(x)A(x)φ(x)) =  − λ

giving

h(t) =  − λh(t), 

(A(x)K0(x)φ(x)) + λc(x)ρ(x)A(x)φ(x) = 0.

Let us assume the bar has uniform material composition, so that K0 ρ and c do not depend on location - say K0(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.

Exercise 1

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

non-uniform_bar.png

(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!

Exercise 2

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?

Numerically compute the first eigenfunction and the corresponding eigenvalue

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".

Are the eigenfunctions mutually orthogonal?

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:

L0φ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))/((L0φ(x)2σ(x)dx)).

Then if the "scalar product"

L0φ1(x)φ2(x)σ(x)dx

is small compared to 1, φ1 and φ2 can be considered approximately orthogonal.