# Numerical Methods Qualification Exam Problems and Solutions (University of Maryland)/Aug06 667

## Problem 4

 Suppose that ${\displaystyle f:R\rightarrow R\!\,}$ is smooth and that the boundary value problem ${\displaystyle u''=f(u){\mbox{ on }}(0,1),\quad u(0)=(1)=0\!\,}$ has unique solution.

## Problem 4a

 For ${\displaystyle N\in \mathbb {N} \!\,}$, let ${\displaystyle x_{i}={\frac {1}{N}},i=0,\ldots ,N\!\,}$. Write down a system of ${\displaystyle N+1\!\,}$ equations to obtain an approximation ${\displaystyle u_{i}\!\,}$ for the solution ${\displaystyle u\!\,}$ at ${\displaystyle x_{i}\!\,}$ by replacing the second derivatives by a symmetric difference quotient.

## Solution 4a

The symmetric difference quotient is given by

${\displaystyle {\frac {u(x+h)-2u(x)+u(x-h)}{h^{2}}}=u''(x)\!\,}$

Hence we have the following system equations that incorporates the initial conditions ${\displaystyle u(0)=u(1)=0\!\,}$.

${\displaystyle \underbrace {{\frac {1}{h^{2}}}{\begin{bmatrix}1&&&&&&\\1&-2&1&&&&\\&1&-2&1&&&\\&&\ddots &\ddots &\ddots &&\\&&&&1&-2&1\\&&&&&&1\end{bmatrix}}} _{A}\underbrace {\begin{bmatrix}u_{0}\\u_{1}\\u_{2}\\\vdots \\\vdots \\u_{n}\end{bmatrix}} _{U}=\underbrace {\begin{bmatrix}0\\f(u_{1})\\f(u_{2})\\\vdots \\f(u_{n-1})\\0\end{bmatrix}} _{f}\!\,}$

## Problem 4b

 Write the system of equations in the form ${\displaystyle F(U)=0\!\,}$. Define domain and range of ${\displaystyle F\!\,}$ and explain the meaning of the variable ${\displaystyle U\!\,}$.

## Solution 4b

${\displaystyle \underbrace {AU-f} _{F(U)}=0\!\,}$

Domain: ${\displaystyle R^{N+1}\!\,}$

Range: ${\displaystyle R^{N+1}\!\,}$

${\displaystyle U\!\,}$ is a vector containing ${\displaystyle N+1\!\,}$ approximations ${\displaystyle u_{i}\!\,}$ for the solution ${\displaystyle u\!\,}$ at ${\displaystyle x_{i}\!\,}$

## Problem 4c

 Formulate Newton's method for the solution of the system in (b) with ${\displaystyle U^{(0)}=0\!\,}$. Give explicit expressions for all objects involved (as far as this is reasonable). Determine a sufficient condition that ensures that the iterates ${\displaystyle U^{(k)}\!\,}$ in the Newton scheme are defined. Without doing any further calculations, can you decide whether the sequence ${\displaystyle U^{(k)}\!\,}$ converges. Why or why not?

## Solution 4c

### Newton's Method

${\displaystyle U^{k+1}=U^{k}-J(F(U^{(k)})^{-1}F(U^{(k)})\!\,}$

where ${\displaystyle J(A)\!\,}$ denotes the Jacobian of a matrix ${\displaystyle A\!\,}$.

Specifically,

${\displaystyle J(F(U^{(k)})=J(AU-F)=A-J(F)\!\,}$

### Sufficient Condition

If ${\displaystyle J(F(U^{(k)})^{-1}\!\,}$ exists, then ${\displaystyle U^{(k)}\!\,}$ iterates are defined.

### Convergence of sequnce

We cannot decide if the sequence converges since Newton's method only guarantees local convergence.

In general, for local convergence of Newton's method we need:

• ${\displaystyle F\!\,}$ differentriable

• ${\displaystyle D(F(U^{*}))\!\,}$ invertible

• ${\displaystyle D(F)\!\,}$ Lipschitz

• ${\displaystyle U^{(0)}\!\,}$ close to solution ${\displaystyle U^{*}\!\,}$

## Problem 5

 Consider the boundary value problem ${\displaystyle -u''=f,\quad 0 with boundary conditions ${\displaystyle u(0)=0\!\,}$ and ${\displaystyle u'(1)+\alpha u(1)=0\!\,}$. Here ${\displaystyle \alpha \!\,}$ is a given positive number.

## Problem 5a

 Describe a Galerkin method to solve this problem using piecewise linear functions with respect to a uniform mesh.

### Weak Formulation

Find ${\displaystyle u\in U=\{u\in H^{1}:u(0)=0\}\!\,}$ such that for all ${\displaystyle v\in U\!\,}$

${\displaystyle \int _{0}^{1}-u''v=\int _{0}^{1}fv\!\,}$

which after integrating by parts and plugging in initial conditions we have

${\displaystyle \int _{0}^{1}u'v'=\int _{0}^{1}fv-\alpha u(1)v(1)\!\,}$

Let ${\displaystyle \{x_{i}\}_{i=0}^{N+1}\!\,}$ be the nodes of a uniform partition of ${\displaystyle [0,1]\!\,}$ where ${\displaystyle x_{0}=0\!\,}$ and ${\displaystyle x_{i}=ih\!\,}$.

Let ${\displaystyle \{\phi _{i}\}_{i=0}^{N+1}\!\,}$ be the standard "hat" functions defined as follows:

For ${\displaystyle i=1,2\ldots ,N\!\,}$

${\displaystyle \phi _{i}={\begin{cases}{\frac {x-x_{i-1}}{h}}&{\mbox{ for }}x\in [x_{i-1},x_{i}]\\{\frac {x_{i+1}-x}{h}}&{\mbox{ for }}x\in [x_{i},x_{i+1}]\\0&{\mbox{ otherwise }}\end{cases}}\!\,}$

${\displaystyle \phi _{N+1}={\begin{cases}{\frac {x-x_{N}}{h}}&{\mbox{ for }}x\in [x_{N},x_{N+1}]\\0&{\mbox{ otherwise }}\end{cases}}}$

Also ${\displaystyle \phi _{0}=0\!\,}$ since ${\displaystyle u(0)=0\!\,}$

Then ${\displaystyle \{\phi _{i}\}_{i=0}^{N+1}\!\,}$ forms a basis for the discrete space ${\displaystyle U_{h}=\{u\in H^{1}[0,1]:u(0)=0,u{\mbox{ piecewise linear }}\}\!\,}$

## Problem 5b

 Derive the matrix equations for this Galerkin method. Write out explicitly that equation of the linear system which involves ${\displaystyle \alpha \!\,}$

### Discrete Weak Formulation

Find ${\displaystyle u_{h}\in U_{h}\!\,}$ such that for all ${\displaystyle v\in U_{h}\!\,}$

${\displaystyle \int _{0}^{1}u_{h}'v_{h}'=\int _{0}^{1}fv_{h}-\alpha u(1)v(1)\!\,}$

Since ${\displaystyle \{\phi _{i}\}_{i=0}^{N+1}\!\,}$ forms a basis, we have

${\displaystyle u_{h}=\sum _{i=0}^{N+1}u_{hi}\phi _{i}\!\,}$

Also for ${\displaystyle j=1,\ldots ,N+1\!\,}$

${\displaystyle \sum _{i=0}^{N+1}u_{hi}\int _{0}^{1}\phi _{i}'\phi _{j}'=\int _{0}^{1}f\phi _{j}+\alpha \sum _{i=0}^{N+1}u_{hi}\phi _{i}(1)\phi _{j}(1)\!\,}$

In matrix form

${\displaystyle {\begin{bmatrix}{\frac {2}{h}}&-{\frac {1}{h}}&&&&\\-{\frac {1}{h}}&{\frac {2}{h}}&-{\frac {1}{h}}&&&\\&\ddots &\ddots &\ddots &&\\&&&&-{\frac {1}{h}}&{\frac {2}{h}}+\alpha \end{bmatrix}}{\begin{bmatrix}u_{h_{1}}\\u_{h_{2}}\\\vdots \\u_{h_{N+1}}\end{bmatrix}}={\begin{bmatrix}\int _{0}^{1}f\phi _{1}\\\int _{0}^{1}f\phi _{2}\\\vdots \\\int _{0}^{1}f\phi _{N+1}\end{bmatrix}}\!\,}$

## Problem 6

 Consider the linear multistep method ${\displaystyle y_{n+1}={\frac {4}{3}}y_{n}-{\frac {1}{3}}y_{n-1}+{\frac {2}{3}}hf(x_{n+1},y_{n+1})\!\,}$ for the solution of the initial value problem ${\displaystyle y'(x)=f(x,y(x)),y(0)=y_{0}\!\,}$

## Problem 6a

 Show that the truncation error is of order 2.

## Problem 6b

 State the condition for consistency of a linear multistep method and verify it for the scheme in this problem.

## Solution 6b

{\displaystyle {\begin{aligned}y_{n+1}&=\sum _{j=0}^{p}a_{j}y_{n-j}+h\sum _{j=-1}^{p}b_{j}f(t_{n-j},y_{n-j})\\&=a_{0}y_{n}+a_{1}y_{n-1}+\ldots +a_{p}y_{n-p}+h[b_{-1}f(t_{n+1},y_{n+1})+b_{0}f(t_{n},y_{n})+b_{1}f(t_{n-1},y_{n-1})+\ldots +b_{p}f(t_{n-p},y_{n-p})]\end{aligned}}\!\,}

Conditions:

(i) ${\displaystyle \sum _{j=0}^{p}a_{j}=1\!\,}$

${\displaystyle {\frac {4}{3}}+-{\frac {1}{3}}=1\!\,}$

(ii)${\displaystyle \sum _{j=-1}^{p}b_{j}-\sum _{j=0}^{p}ja_{j}=1\!\,}$

${\displaystyle {\frac {2}{3}}-(0\cdot {\frac {4}{3}}+1\cdot -{\frac {1}{3}})=1\!\,}$

## Problem 6c

 Does the scheme satisfy the root condition and or the strong root condition?

The scheme satisfies the root condition but not the strong root condition since the roots are given by

${\displaystyle \lambda ={\frac {{\frac {4}{3}}\pm {\sqrt {{\frac {16}{9}}-{\frac {4}{3}}}}}{2}}\!\,}$

which implies ${\displaystyle \lambda _{1}=1\!\,}$ and ${\displaystyle \lambda _{2}={\frac {1}{3}}\!\,}$