Docsity

Boundary Value Problems, Lecture Notes - Advanced Calculus, Study notes of Calculus

Toggle sidebar
bg1
Math 128A Problem Set 4: Boundary Value
Problems and Tri-Diagonal Systems
Adrian Down
February 10, 2006
Approximating the differential equation
Note. I use the notation of the problem set, in which yj=y(xj), and likewise
for other functions.
I want to find an approximation of y′′
jin terms of the values of {yk},1≤
k≤n+ 1
I consider the Taylor series of the yk’s near yj,
yj+1 =y(xj+h) = yj+y′
jh+1
2y′′
jh2+O(h3)
Now consider yj−1. I simply replace hby −hin the Taylor expansion just
found,
yj−1=y(xj−h) = yj−y′
jh+1
2y′′
jh2+O(h3)
Adding these two Taylor expansions cancels the odd terms,
yj+1 +yj−1= 2yj+y′′
jh2+O(h4)
Isolating y′′
j,
y′′
j=yj−1−2yj+yj+1
h2+O(h4)
In the limit of small h, the given set of differential equation becomes
y′′(xj) = −f(xj)
→yj−1−2yj+yj+1 =−h2fj
1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Boundary Value Problems, Lecture Notes - Advanced Calculus and more Study notes Calculus in PDF only on Docsity!

Math 128A Problem Set 4: Boundary Value

Problems and Tri-Diagonal Systems

Adrian Down

February 10, 2006

Approximating the differential equation

Note. I use the notation of the problem set, in which yj = y(xj ), and likewise

for other functions.

I want to find an approximation of y

′′ j in terms of the values of^ {^ yk^ }^ ,^1 ≤

k ≤ n + 1

I consider the Taylor series of the yk’s near yj ,

yj+1 = y(xj + h) = yj + y

′ j h^ +

y

′′ j h

2

  • O(h

3 )

Now consider yj− 1. I simply replace h by −h in the Taylor expansion just

found,

yj− 1 = y(xj − h) = yj − y

′ j h^ +

y

′′ j h

2

  • O(h

3 )

Adding these two Taylor expansions cancels the odd terms,

yj+1 + yj− 1 = 2yj + y

′′ j h

2

  • O(h

4 )

Isolating y

′′ j ,

y

′′ j =^

yj− 1 − 2 yj + yj+

h^2

  • O(h

4 )

In the limit of small h, the given set of differential equation becomes

y

′′ (xj ) = −f(xj )

→ yj− 1 − 2 yj + yj+1 = −h

2 fj

Problem 1

Part a

Imposing the given initial conditions, y 0 = yn+1 = 0. Thus,

j = 1

− 2 y 1 + y 2

h

2

= −f 1

j = 2

y 1 − 2 y 2 + y 3

h

2

= −f 2

j = 3

y 2 − 2 y 3 + y 4

h

2

= −f 3

j = n − 1

yn− 2 − 2 yn− 1 + yn

h^2

= −fn− 1

j = n

yn− 1 − 2 yn

h^2

= −fn

Writing this system of equations in matrix form,

y 1

y 2

. . .

. . .

yn− 1

yn

= −h

2

f 1

f 2

. . .

. . .

fn− 1

fn

Part b

General case

The general formulation of the decomposition is,

A =

a 1 b 1

c 1

. (^) bn− 1

cn− 1 an

l 1

ln− 1 1

u 1 b 1

.. .

. (^) bn− 1

un

The unknowns are { lk } and { uk }.

above,

l 1 =

c 1

u 1

Hence the induction hypothesis holds for k = 1.

Now assume the induction hypothesis for k ≤ n. Determining un+1,

un+1 = an+1 − lnbn

n

n + 1

− 2 n − 2 + n

n + 1

n + 2

n + 1

Now for ln+1,

ln+1 =

cn+

un+

n+ n+

n + 1

n + 2

Thus the induction hypothesis holds ∀k ∈ N, and the LU decomposition is,

A =

1 2

2 3

3 4

n− 1 n

n n+

3 2

4 3

5 4

n n− 1

n+ n

Part c

General case

Define the vector UY = Z. The goal is then to solve two separate systems

successively,

LZ = F UY = Z

Solving the system LZ = F can be done using forward elimination start-

ing from the first row, since L is a lower triangular matrix.

LZ = F ⇔

z 1 = f 1

l 1 z 1 + z 2 = f 2

. . .

ln− 1 zn− 1 + zn = fn

⇒ zk = fk − lk− 1 zk− 1

Since { fk } is known, the first equation determines z 1 , the second equa-

tion determines z 2 , and so on.

The next step is to perform the backward elimination to determine Y.

UY = Z ⇔

u 1 y 1 + b 1 y 2 = z 1

u 2 y 2 + b 2 y 3 = z 2

. . .

un− 1 yn− 1 + bn− 1 yn = zn− 1

unyn = zn

⇒ yk =

zk − bkyk+

uk

Since { zk } and { bk } are known, the first equation determines y 1 , the second

equation determines y 2 , and so on.

Given particular case

I take the case of n = 4. I obtain the LU decomposition using the results of

part b,

A =

1 2

2 3

3 4

3 2

4 3

5 4

I use the equations above to solve for y using elimination, given the

particular f’s in the problem.

f = [0 1 0 0]

T

z 1 = 0

z 2 = −h

2

· 0 = −h

2

z 3 = 0 +

· −h

2 = −

h

2

z 4 = 0 −

h

2 ·

h

2

⇒ z = −h

2

2 3

1 2

)T

y 4 =

1 2

h

2

5 4

h

2

y 3 =

2 3

h

2 −

2 5

h

2

4 3

h

2 · −

h

2

y 2 =

−h

2 −

4 5

h

2

3 2

h

2 · −

h

2

y 1 =

6 5

h

2

h

2

y =

3

)T

f = [0 0 1 0]

T Because A is symmetric, solving this system of equations is

the same as solving the previous system with the matrices written “upside

down”,

y 1

y 2

y 3

y 4

= −h

2

f 1

f 2

f 3

f 4

y 4

y 3

y 2

y 1

= −h

2

f 4

f 3

f 2

f 1

Comparing with the previous solution for f = [0 1 0 0]

T and reflecting

the matrices vertically, the solution in this case is

y =

3

)T

f = [0 0 0 1]

T By the same arguments of reflection symmetry used above,

comparing with the previous solution for f = [1 0 0 0]

T ,

y =

)T

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0

LU decomposition solution of d

2 y(x) = −f(x)

f=[1 0 0 0]

f=[0 1 0 0]

f=[0 0 1 0]

f=[0 0 0 1]

the first column of A

− 1 , and likewise for the other columns of A

− 1

. Hence,

A

− 1 = −

h^2

y 1 |y 2 |y 3 |y 4

Problem 2

Part a

If y

′ (xj ) = 0, then y changes very little over a small interval about xj , i.e.

yj ≈ yj± 1. In this particular case,

y

′ (1) = 0 ⇒ yn+1 ≈ yn

To formulate A, I use the same approximation of the second derivative

used above. All of the rows except the last remain the same. For the last

row,

−h

2 fn =

yn− 1 − 2 yn + yn+

h^2

= yn− 1 − yn

Writing this system in matrix form,

A =

Part b

Section i

I determine the recursive relationship between the elements of y by starting

at yn,

yn− 1 − yn

h

2

⇒ yn = yn− 1

yn− 2 − 2 yn − yn− 1

h

2

yn− 2 − yn− 1

h

2

= 0 ⇒ yn− 2 = yn− 1

Continuing in this manner, yj = yj+1 ∀j such that k ≤ j ≤ n. Now for j = k,

yk− 1 − 2 yk + yk+

h^2

yk− 1 − yk

h^2

= − 1 ⇒ yk − yk− 1 = h

2

Considering j < k,

yj− 2 − 2 yj− 1 + yj

h^2

yj− 2 − yj− 1 − (yj− 1 − yj )

h^2

= 0 ⇒ yj− 1 − yj− 2 = h

2

yj− 3 − 2 yj− 2 + y 1

h

2

yj− 3 − yj− 2 − (yj− 2 − yj− 1 )

h

2

= 0 ⇒ yj− 2 − yj− 3 = h

2

Continuing in this manner, yj − yj− 1 = h

2 ∀j such that 1 ≤ j < k.

Section ii

Examining the particular case of j = 1,

− 2 y 1 + y 2

h^2

−y 1 − (y 1 − y 2 )

h^2

= 0 ⇒ y 1 = h

2

Using the results of section i above,

yk = yk− 1 + h

2

Thus,

y 2 = y 1 + h

2 = 2h

2

y 3 = y 2 + h

2 = 3h

2

yk = yk− 1 + h

2 = kh

2

for j ≤ k, and yj = kh

2 for j ≥ k.

performing the matrix multiplication AY = 0,

−y 1 + y 2 = 0 ⇒ y 1 = y 2

y 1 − 2 y 2 + y 3 = (y 1 − y 2 ) − y 2 + y 3 = 0 ⇒ y 2 = y 3

yn− 1 − yn = 0 ⇒ yn− 1 = yn

Hence, yk = yk+1, ∀k such that 1 ≤ k < n. A basis for the null space of A

is thus,

)T

, and any vector in the null space is equal to this

basis vector multiplied my some constant.

Taking the limit as the mesh size approaches 0, this result indicates that

the set of functions who satisfy the boundary conditions and whose sec-

ond derivative vanish ∈ (0, 1) are precisely those functions that are constant

∈ (0, 1). Having an identically 0 second derivative indicates that the first

derivative must be constant, and so ordinarily one would expect linear func-

tions to also satisfy y

′′ (x) = 0. However, in this case, the requirement that

y

′ (0) = y

′ (1) = 0 completely determine y

′ (x), since y

′ (x) is in this case linear,

and two points determine a line. Hence

y

′′ (x) = 0 and y

′ (0) = y

′ (1) = 0 ⇒ y(x) = constant

Part b

It is shown in a course on linear algebra that the system of equations BX = Z

has a solution if and only if the rank of B is equal to the rank of B with Z

appended. In other words, Z must be expressible as a linear combination of

the columns of B.

I form the appended matrix in this particular case, multiplying f by

1 h^2

which does not change whether f is a linear combination of the columns of

A,

[A| − F ] =

− 1 1 −f 1

1 − 2 1 −f 2

1 − 2 1 −fn− 1

1 − 1 −fn

To determine the rank of the matrix, I convert it to row echelon form. I first

add row 1 to row 2 to form

[A| − F ] =

h^2

− 1 1 −f 1

0 − 1 1 −(f 1 + f 2 )

1 − 2 1 −fn− 1

1 − 1 −fn

I continue adding row k to row k + 2 to get

[A| − F ] =

− 1 1 −f 1

0 − 1 1 −(f 1 + f 2 )

0 − 1 1 −(f 1 + f 2 +... fn− 1 )

0 0 −(f 1 + f 2 +... fn)

Multiplying by −1,

[A| − F ] =

1 − 1 f 1

0 1 − 1 f 1 + f 2

0 1 − 1 f 1 + f 2 +... fn− 1

0 0 f 1 + f 2 +... fn

The last row of the matrix is now in row echelon form. For the rank of A

to be equal to the rank of [A| − F ], all of the elements of the last column

must be 0 when the matrix is in row echelon form. Thus, if AY = −F has a

solution, it must be that

∑n

k=0 fk^ = 0.

Part c

Assume the given boundary value problem has a solution y(x) such that

y

′′ (x) = −f (x). I now integrate both sides for x ∈ (0, 1),

∫ (^1)

0

y

′′ (x)dx = −

0

f (x)dx