Boundary-Value and Eigenvalue Problems

George E. Hrabovsky

MAST

Introduction

Last time we discussed how to solve ODE problems in Mathematica. In this lesson we will continue that theme to include methods of handling boundary-value and eigenvalue problems.

Boundary Value Problems for ODEs

We have already discussed how to handle initial-value problems. For an ODE a boundary-value problem is one where we not only have an initial-value, but some value along the boundary of your region of concern. Say that we have a general second-order homogeneous linear ODE,

l4_1.png

(4.1)

Say that this equation vanishes at some values of x, say a and b. We write this y(a)=0 and y(b)=0. The general solution is the linear combination of coefficients and linearly independent solutions,

l4_2.png

(4.2)

The boundary conditions impose these requirements,

l4_3.png

(4.3)

If the determinant of these coefficients does not vanish, then the only solution is the trivial one, l4_4.png. If the condition

l4_5.png

(4.4)

is met, then the two expressions in (4.2) are generally equivalent and one constant can be expressed in terms of the other through elimination. If the condition in (4.4) is satisfied then the second equation in (4.2) can be discarded and the first gives us l4_6.png. We can rewrite these as l4_7.png, and l4_8.png. The solution (4.3) is then rewritten.

l4_9.png

(4.5)

If l4_10.png, then this leads to a trivial solution and we must rewrite the general solution

l4_11.png

(4.6)

assuming that both l4_12.png and l4_13.png are not zero.

For symbolic solutions, this is fairly easy to include. Say we have the equation,

l4_14.png

l4_15.png

Let’s say that we have the same problem, but we have a boundary where we want the solution to be, say 5, and that this occurs at a grid point of say 10.

l4_16.png

l4_17.png

We can plot this curve.

l4_18.png

l4_19.gif

Read through the section Initial and Boundary Value Problems in the tutorial Symbolic Differential Equation Solving. Play with some examples.

We can also apply this to NDSolve.

l4_20.png

l4_21.png

l4_22.gif

This might not be accurate, so let’s plot it and  compare it to the symbolic case.

l4_23.png

l4_24.gif

This looks good, so let’s see them both on the same plot.

l4_25.png

l4_26.gif

We can see an inaccuracy form in the numerical solution at higher values of x. Is there a way to make this more accurate? We shall see.

Shooting Method

A common method for increasing the accuracy of BV problems is called the Shooting Method. It works like this, say we have a boundary-value problem,

l4_27.png

(4.7)

we can write a side condition

l4_28.png

(4.8)

where l4_29.png. The shooting method attempts to find initial conditions of the form l4_30.png so that (4.8) is satisfied. After writing g we then use some implementation of FindRoot to find c.

Returning to our example. We need an intermediate expression for the initial derivative.

l4_31.png

l4_32.png

We now continue with our solution.

l4_33.png

l4_34.png

l4_35.gif

We can plot this the same way we did before.

l4_36.png

l4_37.gif

l4_38.png

l4_39.gif

We see no difference.

We can plot the error.

l4_40.png

l4_41.gif

Let's see what happens if we change the method of finding the root.

l4_42.png

l4_43.png

l4_44.gif

No difference. We need to look at another method.

So, should we not use the Shooting Method? Let’s examine a few more cases before we pass judgement. We know that the equation we have been studying is in terms of Airy functions, so maybe that is the problem. How about an inhomogeneous linear equation?

l4_45.png

Here we get the general solution.

l4_46.png

l4_47.png

What happens when we fix the boundary values at x=0 and x=1 to be y(0)=y(1)=1?

l4_48.png

l4_49.png

We can plot this solution.

l4_50.png

l4_51.gif

Let’s try this out with NDSolve.

l4_52.png

l4_53.gif

Let’s plot this alongside the analytical solution.

l4_54.png

l4_55.gif

Pretty good.

In fact, you will find that the Shooting Method is pretty good in general.

Unlike IVPs, there is no theorem telling us that any solution exists, nor that such a solution is unique, for any particular BVP. So how do we know anything in general? If we look at the general solution we see a term involving l4_56.png. This term vanishes whenever x={0, 2 π, ...}. What happens when we try to solve for those values?

l4_57.png

l4_58.png

l4_59.png

No solution is returned.

As an exercise go ahead and work through Advanced Numerical Differential Equation Solving in the Wolfram Language tutorial, specifically the section on Boundary Value Problems and the subsection Shooting Method. Come up with some of your own examples.

The Chasing Method

There are some other methods for handling BVPs. The next one is called the chasing method, first proposed in 1965. To use this Mathematica establishes a set of auxiliary conditions that are then solved to determine initial conditions at some boundary. Once this is done, then NDSolve proceeds as normal.

l4_60.png

l4_61.png

l4_62.gif

We can plot the solutions.

l4_63.png

l4_64.gif

As the warning suggested the initial conditions are a problem, but starting at x=5 the previous problems disappear. We can try to increase the precision, to see if that helps.

l4_65.png

l4_66.gif

l4_67.png

l4_68.gif

We are left with the problem of solving this equation, and as things stand we cannot do it. The shooting method is good up to x=4, then the chasing method works.

It might be interesting to see if we could use a WhenEvent option to switch from the shooting method to the chasing method.

As an exercise go ahead and work through Advanced Numerical Differential Equation Solving in the Wolfram Language tutorial, specifically the section on Boundary Value Problems and the subsection Chasing Method. Come up with some of your own examples.

Eigenfunction Expansions

It is entirely possible to go through a first course on differential equations without ever getting to the topic of eigenvalue problems. Because of this I will spend a little more time on it. Often we have an ODE similar to (4.1) where one or both of the coefficients l4_69.png and l4_70.png depend on a parameter λ. In these cases the determinant in (4.4) may vanish for specific values of λ. For each such value of λ there will be a solution of the form (4.5). The values of λ that produce nontrivial solutions are called eigenvalues and the corresponding solutions are called eigenfunctions. In general these types of problems are called eigenvalue problems.

If we can write the equation in this form,

l4_71.png

(4.9)

you can write the operator

l4_72.png

(4.10)

Then (4.9) becomes

l4_73.png

(4.11)

where g and h constitute boundary conditions, we call this type of eigenvalue problem a Strum-Liouville problem.

We can use DSolve on this kind of problem.

l4_74.png

l4_75.png

Here  is a formal parameter that has no specified value. We can make a table of the first, say, six eigenfunctions assuming the constant of integration to be 1 and using the replace repeated command (//.).

l4_76.png

l4_77.png

We can plot these.

l4_78.png

l4_79.gif

As an exercise read through the part of Scope under DSolve that discusses Sturm-Liouville Problems. Work up some examples.

Green’s Functions Solutions

There is another kind of problem, where a system responds to an impulsive type of Dirac delta. If we define a differential operator we might be able to establish a solution based on a function that satisfies homogeneous boundary conditions. If we have the operator L(G(x,y))=δ(x-y), we might be able to find G. If we can write L(h(x))=f(x) with homogeneous boundary conditions we might be able to find a specific solution by applying the convolution integral

l4_80.png

(4.12)

If we have the initial-value problem.

l4_81.png

l4_82.png

We can plot this for various values of y.

l4_83.png

l4_84.gif

Here we have a Dirichlet-type boundary value problem.

l4_85.png

l4_86.png

We can plot this for various values of y.

l4_87.png

l4_88.gif

Here we have a Neumann-type boundary value problem.

l4_89.png

l4_90.png

We can plot this for various values of y.

l4_91.png

l4_92.gif

Here we have a Robin-type boundary value problem.

l4_93.png

l4_94.png

We can plot this for various values of y.

l4_95.png

l4_96.gif

We will see more about Green’s functions in future lessons.

As an exercise, read through the documentation for GreenFunction and note particularly the ODEs section under Scope.

Created with the Wolfram Language