Sorry, I meant I don't know what the boundary condition should be, I know how to include it. The approach I described is the only one I could come up with but it doesn't seem to work.
First of all, I didn't know whether to pick this subforum or the engineering/compsci one, I understand this might need to be moved to a more appropriate subforum.
The general approach is fairly obvious, use implicit method to construct the tridiagonal matrix for Thomas method and solve. However...