BVPs, BCs, nonlinear, nonuniform grids

Boundary conditions

Two Approaches

Approach 1. Ghost Cell Method Include the boundary point in the list of unknowns (like interior points). * Discretize the boundary point exactly as if it was an interior point. * For central differences, this will reference one point past the boundary. \\| \\| \\| * * * * i-1 \\|i i+1 -1 \\|0 1 2 \\| \\|

Method 2 Don’t include the boundary point in the list of unkowns.

```        
\\|
\\|
\\|
  *         *          *        *  
\\|i-1      i         i+1
\\|-1       0          1        2  
\\|
```

Nonlinear relaxation methods

Question What are other approaches that could (or should?) be used?

import numpy as np
import matplotlib.pyplot as plt

y = np.linspace(0,10,100)

y0 = 3
y2 = y**2
y0y = y0 * y
yta = y0**2 + 2*y0*(y-y0)

plt.rc('font', size=14)
plt.plot(y,y2, color='grey', lw=5)
plt.plot(y,yta, 'k-')
plt.plot(y,y0y, 'b--')
plt.xlabel("y")
plt.ylabel("yy")
plt.legend(['exact', 'Taylor', 'simple'], frameon=False);
BVP

Nonuniform grids

Method 1

 *     *                         * 
i-1    i                        i+1

Method 2

Questions