# What will PDE discretization matrix look like for time and space? [duplicate]

Please note: this question is not a duplicate of this question since, while the PDE is the same, the nature of this question is different, i.e. the other question treats a different aspect of this PDE.

Here is the PDE system I am working with:

$$\partial_tu = \nabla \cdot (a(x)\nabla u)-\beta(x)u\\ \partial_nu=0, x \in \Omega \subset \mathbb{R}^2\\ \beta(x)>0$$

1. Integrate the PDE:

$$\int_\Omega \partial_t u=\int_\Omega \nabla\cdot (a(x)\nabla u)dx-\int_\Omega \beta(x)udx$$

1. Apply the Divergence theorem:

$$\int_\Omega \partial_t u=\int_{\partial\Omega} a(x)\nabla u\cdot nds-\int_\Omega \beta(x)udx$$

1. Apply the Neuman boundary condition:

$$\int_\Omega \partial_t u=\int_{\partial\Omega} a(x)\partial_n uds-\int_\Omega \beta(x)udx=-\int_\Omega \beta(x)udx$$

1. Obtain a new PDE:

$$\partial_t u+\beta(x)u=0$$

This PDE is in essence an ODE, so we can get the following solution for this ODE:

$$u(x,t)=e^{-\beta(x)t}D(x),$$ where $$D(x)$$ is an integration "constant".

1. Discretize the ODE:

$$\frac{u_{ij}^{n+1}-u_{ij}^n}{\Delta t}=-\beta_{ij} u_{ij}^n$$ or $$u^{n+1}_{ij} = u^n_{ij}(1-\Delta t \beta_{ij})$$

Now we can assign lexicographical ordering to each $$i,j$$ and denote it by a function $$p(i,j)$$, thus rewriting the discretized PDE about as follows:

$$u^{n+1}_{p(i,j)} = u^n_{p(i,j)}(1-\Delta t \beta_{p(i,j)})$$

Am I correct to deduce that for each $$n$$ we have a linear system of the form

$$U^{n+1}=AU^n$$

where $$A$$ is constant and $$A = diag(1-\beta_{ij},\dots , 1-\beta_{ij})$$? If this is true then is it also correct that there are thus as many such linear systems as there are $$n$$'s (say, $$M$$) and to solve this discretized system we need to solve $$M$$ such linear systems?

I think, alternatively, we can probably extend the system to include not only $$i,j$$ in the lexicographical ordering, but also to include $$n$$ in it, so as to get only one linear system to solve.

• It's a duplicate of question 31343 -- and the major mistake going from 3 to 4 is the same. – Wolfgang Bangerth Apr 2 at 3:27
• It's not really a duplicate, since the nature of the questions is different. – sequence Apr 2 at 5:03
• There are no linear systems of equations to be solved in what you wrote, it's just matrix-vector multiplication, but it is true that you have one such matrix per time step. And the mistake in concluding 4 from 3 does really invalidate the question a little bit if your goal is to solve the PDE up at the top. – Kirill Apr 2 at 8:38