Solve the system of 51 differential equations: $$\frac{du_1}{dt}=0$$ $$\frac{du_k}{dt}=100(u_{k+1}-2u_k+u_{k-1})$$ $$\frac{du_{51}}{dt}=0$$
with initial condition $$u_k=\frac{k-1}{10}$$ from $t=0$ to $t=10$
I know I need to use backwards euler to solve the system since that is what we are studying. Also I must use successive over relaxation scheme to solve the matrix. To begin using backwards euler i know $$\frac{u_k^{n+1}-u_k^n}{dt}=\frac{du_k^{n+1}}{dt}$$ and the apply that to the system, but coding this into matlab is where i am stuck.
Construct the system matrix
Then your ODE system is just $\dot u = Au+b$. Solving the implicit Euler step requires to solve $$u^{n+1}+dt·A·u^{n+1} = u^n-dt·b.$$