Boundary Condition and coefficient from discrete data

Please format your code using 3x` to make it readable.

For your actual question, consider: