I'm trying to solve the following non-linear diffusion equation: $$ \frac{\partial}{\partial t} u(x,t)= \frac{\partial^{2}}{\partial x^{2}}u(x,t)^{3}$$ $$ -1\leq x \leq1, t \geq 0 $$ with the boundary conditions: $$u(1,t)=-u(-1,t)=1$$ and the initial conditions: $$u(x,0)=x$$ I'm trying to implement a Crank-Nicolson scheme but I'm a little stuck. Here's what I have so far: $$\frac{u_{i}^{n+1} - u_{i}^{n}}{\Delta t} = \frac{(u^{3})_{i-1}^{n+1} - 2(u^{3})_{i}^{n+1} + (u^{3})_{i+1}^{n+1} + (u^{3})_{i-1}^{n} - 2(u^{3})_{i}^{n} + (u^{3})_{i+1}^{n}}{2\Delta x^2}$$ I'm not sure how to evaluate $$(u^3)_i^{n+1}$$ How should I proceed?

Edit: Forgot to mention that the analytical solution is: $$u(x,\infty) = x^{\frac{1}{3}}$$


You should rearrange the terms so that all of the $n+1$ terms are together on one side of the equals sign and all of the $n$ terms are on them other. Then you will have a system of non-linear equations like:

$$ A(u^{n+1}_i) u^{n+1}_i=b $$

Where $A$ is a non-linear matrix. Then you can use something like Newton-Raphson to linearize the system and your favorite linear solver to solve the resulting linear systems at each Newton step.

| cite | improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.