tlycken/Interpolations.jl — pull request #9 by tlycken (2014-11-24 20:01:31+00:00)
Title: First attempt at linear bc/extrap for B2

I made an attempt at building linear extrapolation and boundar conditions as well, but I can't seem to get it right.

The math behind is quite straightforward; in the middle of the (1D) domain, the relevant in the tridiagonal system matrix is `[1/8 3/4 1/8]`. In order to specify the `f'` at the edge, I introduce a ghost point `y0` at `x=0` and give it a value such that it is on the line between `y1` and `y2`, yielding `y0 = 2y1 - y2`. Inserting in the equation `y0/8 + 3y1/4 + y2/8 = A[1]` yields `y1 = 0`. Thus, I modify the system ([here](https://github.com/tlycken/Interpolations.jl/compare/linear-extrap?expand=1#diff-5e94a3cdbd539f0ea6a0901666c1eab2R145)) so that the first row is `[1, 0, ...]` and the last row is `[ ... 0, 1 ]`.

![linear-bc](https://cloud.githubusercontent.com/assets/1550920/5172064/03e5cf8e-741d-11e4-9c7a-f5769bb1e9a9.png)

However, this doesn't seem to give me enough to get where I want - I suspect I have to do something more (like what I did for flat BC [here](https://github.com/tlycken/Interpolations.jl/blob/master/src/quadratic.jl#L56-L61)) but I can't figure out what. I just stole that piece from Grid, but there is no corresponding BC implemented in Grid to look at for this.