# Solving the PDE $\partial_t u = \partial_x (u^2 \partial_xu)$

I'm trying to use Mathematica to solve the following equation $$\partial_t u = \partial_x (u^2 \partial_xu)$$ with $$u(0,t)=u(1,t)=0$$ and $$u_0(x)=\sin(\pi x)$$ in order to check a numerical method I developed with Python. What I obtain at time $$t=1$$ with Python is the following one: I want to use Mathematica to see whether its solution is the same I obtain or not, but since I'm not familiar, I can't do that and I need a check.

Any confirm or check is highly appreciated !

sol = NDSolveValue[{
D[u[x, t], t] == D[u[x, t]^2 D[u[x, t], x], x],
u[0, t] == 0, u[1, t] == 0, u[x, 0] == Sin[Pi x]}
, u, {x, 0, 1}, {t, 0, 1}]


Then

Plot[sol[x, t] /. t -> Range[0, 5]/5 // Evaluate, {x, 0, 1},
PlotLegends -> Range[0, 5]/5, PlotStyle -> ColorData] • Thanks I'm going to try now, but I can't understand (from your graph), what is the colour that corresponds to $t=1$. Sep 18, 2020 at 19:40
• I just reimplemented everything with finite differences (following this question math.stackexchange.com/questions/3805692/…), and I find the same solution you wrote for different times! Still don't know what's wrong with my FEM, but thanks again! Sep 18, 2020 at 23:04