# Finite Difference method, ADI Scheme of Douglas and Rachford

I am trying to implement the ADI scheme of Douglas and Rachford.

For $$p(X,Z,t)$$, there is:

$$\begin{gathered} A=p^{n-1}+\Delta t_n\left[F_0\left(p^{n-1}, t_{n-1}\right)+F_1\left(p^{n-1}, t_{n-1}\right)+F_2\left(p^{n-1}, t_{n-1}\right)\right] \\ B-\alpha \Delta t_n F_1\left(B, t_n\right)=A-\alpha \Delta t_n F_1\left(p^{n-1}, t_{n-1}\right) \quad \quad(*) \\ C-\alpha \Delta t_n F_2\left(C, t_n\right)=B-\alpha \Delta t_n F_2\left(p^{n-1}, t_{n-1}\right) \quad \quad(**) \\ p^n=C, n=1, \ldots, N, \end{gathered}$$

with

$$\begin{gathered} F_0(p, t)=\frac{\partial^2}{\partial X \partial Z}p \\ F_1(p, t)=-\frac{\partial}{\partial Z}p+\frac{1}{2} \frac{\partial^2}{\partial Z^2}p \\ F_2(p, t)=-\frac{\partial}{\partial X}p+\frac{1}{2} \frac{\partial^2}{\partial X^2}p \end{gathered}$$

I am confused with equations $$(*)$$ and $$(**)$$. How can I calculate the $$B$$ and $$C$$ if they are functions of themselves? I have checked other resources and the 2nd correction always depends on itself, as seen in the image below ($$U^{m+1*}$$ and $$U^{m+1**}$$ are functions of themselves). How do I go about calculating this?

• This seems to be an implicit method, meaning that these quantities are computed by solving a linear or nonlinear system of equations at each step. Dec 8, 2023 at 5:17