# Oscillations when solving parabolic heat equation with FTCS

I'm wondering if someone could help me out, or point me in a direction of how I can understand the following oscillations that occur when I solve the Porous Medium Equation $$u_t = u_{xx}^{m+1}$$ using FTCS method. The following plots occur for a the following initial condition $$f(x) = \begin{cases} 1 & \text{if}\ |x| \geq 1 \\ 1 - e^{-1/(1-|x|^2)} & \text{if}\ |x| < 1 \end{cases}$$ with Dirichlet boundary conditions as $$u(x_0, t)= u(x_M,t) = 1$$.

By adjusting the step size for space and time, I end up with the given plots below. The surprising result for me, who just learned about finite difference methods, is that the numerical solution does not converge for values where $$\frac{k\ \text{max}\{u^{m}\}}{h^2} < \frac{1}{2}.$$ How come? It seems to converge for values $$< \frac{1}{4}$$ instead.

• What are the values for $x_0$ and $x_M$? Also, what is $m$? – nicoguaro Apr 3 '19 at 12:07
• @nicoguaro for these plots I believe I used -2.5 to 2.5 with 40 steps, and around 2225 steps in time from 0.0 to 9. m was 1. But I've broken it down to be related to the ratio between k and h, but I can't figure out how to derive this convergence rate. – Gjert Apr 3 '19 at 12:42
• So, $u_{xx}^{m+1}$ is the second derivative of $u$ with respect to $x$ to the second power? – nicoguaro Apr 3 '19 at 12:51
• @nicoguaro Correct. We compare it to the Barenblatt analytic solution when changing the initial value and the boundaries to that of the Barenblatt equation. It's basically the Porous Medium Equation. – Gjert Apr 3 '19 at 20:40
• In that case, your equation is nonlinear and I doubt that the stability condition is that simple. – nicoguaro Apr 3 '19 at 20:44