I'm trying to develop my knowledge about numerical methods. When studying finite difference methods in the boundary value problem I try to realize my code solving problem I came up with.
I start thinking about easy problem $u''=1, u(0)=0, u'(0)=0, x\in [0,1]$. I took $h=0.1$, and used the second finite difference $$\frac{u_{i-1} -2u_i+u_{i+1}}{h^2}=1, u_0 = 0, \frac{u_1-u_0}{h}=0$$
Having solved the finite difference system on the grid with 10 nodes I noticed that my solution differs with analytical one sharply. I realized then that I actually should have solved initial value problem instead of boundary value problem. Then I used RK4 for solving this problem and it gave good results.
I wonder why finite difference method produce this result with my first formulation of the problem? What is the problem I solved at the first time?
