I need to compute a solution of the following PDE:
$$\frac{\partial u}{\partial t} + v \frac{\partial u}{\partial x} = 0$$
For didactic purposes, I need to use an IMEX method. The point is no one ever illustrated such methods to me, so I did some research on the web and on chatgpt and I got to some conclusions. I am here to ask if my reasoning is correct and if not (as it probably is) what I'm doing wrong.
What I learned is
- Take your PDE and solve one of the two derivatives explicitly. For this I can use, for instance, Heun's method. What I obtain is
$$\frac{\partial u}{\partial t} + v \frac{u_{ex}^{n+1} - u^n}{\Delta x} = 0$$
where $u_{ex}^{n+1}$ is the solution of Heun's method, i.e. the explicit step.
- Use your new explicit solution to resolve implicitly the other derivative. In other words, use Backward Euler (for instance) to resolve
$$\frac{u^{n+1}-u_{ex}^{n+1}}{\Delta t} + v \frac{u^{n+1}-u_{ex}^{n+1}}{\Delta x} = 0$$
where $u^{n+1}$ is the solution of the implicit method and of the whole time step.
- Iterate.
Is the reasoning right? I already don't think so because if I develop the last equation I get
\begin{align} \Delta x \cdot (u^{n+1}-u_{ex}^{n+1}) &= -v \Delta t \cdot (u^{n+1}-u_{ex}^{n+1}) \\ u^{n+1}(v\Delta t + \Delta x) &= u_{ex}^{n+1}(v\Delta t + \Delta x) \\ u^{n+1} &= u_{ex}^{n+1} \end{align}
which makes the implicit step useless.
So please, what's that I couldn't get right? It's ok even if you only point a book or a text where to learn.
EDIT:
As Matthew Cassell replied, I used the same discretisation both for time and space. Dividing the two different discretisations on the index $n$ for time and $k$ for space, I get
$$\frac{u_{k+1}^{n+1}-u_{k+1}^n}{\Delta t}+v\frac{u_{k+1}^n-u_k^n}{\Delta x}=0$$
where I first derived on $k$ (space) with the Heun's method (explicit) and then on $n$ (time) using Backward Euler (implicit). But now two more doubts arise:
In the last equation, everything but $u_{k+1}^{n+1}$ is known, so I can easily develop the equation and get to $$u_{k+1}^{n+1}=u_{k+1}^n-v\Delta t\frac{u_{k+1}^n-u_k^n}{\Delta x}$$ So where's the implicit step? I expected an equation less trivial, in which something of uncertain nonsingularity would end at denominator; but I guess that since my implicit term $\left(\frac{\delta u}{\delta t}\right)$ is linear i don't get that. Good!
In this way, I get $u_{k+1}^{n+1}$, which is the value at the next time step, but also at the next space step. Isn't it a problem that my solution moves forward in space, if I have no periodic boundary condition? In other words, how do I get $u_k^{n+1}$? But do I really need $u_k^{n+1}$?