I am trying to solve the following BVP using the Finite Difference Method:
$$y'' - y' + y = 0; \hspace{1em} y(0) = 1; \hspace{1em} y(10) = 5$$
I am using 3 points for each approximation. Using the 3-point finite difference approximations, the equation at the ith point comes out to be-
$$\frac{y_{i+1} - 2y_i + y_{i-1}}{h^2} - \frac{y_{i+1} - y_{i-1}}{2h} + y_i = 0$$
$$\Big(\frac{1}{h^2} + \frac{1}{2h}\Big)y_{i-1} + \Big(\frac{-2}{h^2} + 1\Big)y_{i} + \Big(\frac{1}{h^2} - \frac{1}{2h}\Big)y_{i-1} = 0$$
I wrote a code in python that can take an input n and then solve the system using n grid points along the interval [0, 10].
Here I noticed that 12 or higher grid points produce similarly shaped curves (higher number of grid points produce smoother curves) which are also of the correct shape(Checked with MATLAB). But going 11 or below produces differently shaped curves and these are all wrong shapes.
I want to know-
1) why this is happening and
2) how I can figure out the minimum amount of grid points without trial and error method
I have attached some screenshots for reference:
MATLAB plot (the Blue line is y. The orange line is y')-

Python program plots (All lines are y)-




