Docsity

Math 151B Homework #5: Solving a Boundary Value Problem and Iterative Methods, Assignments of Mathematics

Toggle sidebar
bg1
Math 151B Homework #5 โ€“ Due Friday 2/20
1. Boundary value problem
Consider the boundary value problem
y00 = 1
with y(0) = 0 and y(3) = 9.
a. What is the exact solution?
Answer:
y(x) = 1
2x2โˆ’
3
2x
b. Write down a set of second-order discrete difference equation which approximates this
problem.
Answer:
y(xiโˆ’1)โˆ’2y(xi) + y(xi+1)
h2= 1
y(xiโˆ’1)โˆ’2y(xi) + y(xi+1) = h2
c. Write the above as a matrix equation, for the case h= 1.
Answer:
x0= 0, x1= 1, x2= 2, x3= 3
y(0) โˆ’2y(1) + y(2) = 1
y(1) โˆ’2y(2) + y(3) = 1
2y(1) โˆ’y(2) = y(0) โˆ’1
โˆ’y(1) + 2y(2) = y(3) โˆ’1
๎˜”2โˆ’1
โˆ’1 2 ๎˜•๎˜”y(1)
y(2)๎˜•=๎˜”โˆ’1
8๎˜•
d. Consider the general form for iteratively solving a linear system
x(k)=Tx(kโˆ’1) +c
1. For Jacobi iteration, what are Tand c?
pf2

Partial preview of the text

Download Math 151B Homework #5: Solving a Boundary Value Problem and Iterative Methods and more Assignments Mathematics in PDF only on Docsity!

Math 151B Homework #5 โ€“ Due Friday 2/

  1. Boundary value problem

Consider the boundary value problem

y โ€ฒโ€ฒ = 1

with y(0) = 0 and y(3) = 9.

a. What is the exact solution?

Answer:

y(x) =

x 2 โˆ’

x

b. Write down a set of second-order discrete difference equation which approximates this problem.

Answer:

y(xiโˆ’ 1 ) โˆ’ 2 y(xi) + y(xi+1)

h^2

y(xiโˆ’ 1 ) โˆ’ 2 y(xi) + y(xi+1) = h 2

c. Write the above as a matrix equation, for the case h = 1.

Answer: x 0 = 0, x 1 = 1, x 2 = 2, x 3 = 3

y(0) โˆ’ 2 y(1) + y(2) = 1

y(1) โˆ’ 2 y(2) + y(3) = 1

2 y(1) โˆ’ y(2) = y(0) โˆ’ 1

โˆ’y(1) + 2y(2) = y(3) โˆ’ 1

[

] [

y(1) y(2)

]

[

]

d. Consider the general form for iteratively solving a linear system

x (k) = T x (kโˆ’1)

  • c
  1. For Jacobi iteration, what are T and c?

Answer:

Tj = D โˆ’ 1 (โˆ’L โˆ’ U )

[

1 2 0 (^0 )

] [

]

[

1 2 1 2 0

]

c = D โˆ’ 1 b

[

1 2 0 (^0 )

] [

]

[

1 2 4

]

  1. For Gauss-Seidel iteration, what are T and c?

Answer:

Tg = (D + L)โˆ’^1 (โˆ’U )

[

1 2 0 โˆ’^1412

] [

]

[

1 2 0 โˆ’ 1 4

]

c = (D + L) โˆ’ 1 b

[

1 2 0 โˆ’^1412

] [

]

[

1 2 15 4

]

e. For Jacobi iteration, is T convergent?

Answer:

The eigenvalues are ฮป 1 = ฮป 2 = 1/2, so Tj is convergent.

f. For Gauss-Seidel iteration, is T convergent?

Answer:

The eigenvalues are ฮป 1 = 0 and ฮป 2 = โˆ’ 1 /4, so Tj is convergent.

g. Have you ever seen a question with so many parts?

Answer:

If you have then the answer is yes.

If you havenโ€™t, now you have, so the answer is yes.