## 6 Algorithms for Solution of Finite Difference Algebraic Systems
### The IP3 and IP1  
Now we will extend the described above algorithm for the solution of IP3. After the full discretization, the obtained linear system of algebraic equations has the following canonical form:  
\[a_{i}U_{i-1}^{j+1}+c_{i}U_{i}^{j+1}+d_{i}U_{i+1}^{j+1}+k_{i}b_{i-1}^{j+1}+l_{i} b_{i}^{j+1}+r_{i}b_{1}^{j+1}+s_{i}b_{N-1}^{j+1}=G_{i}^{j+1} \tag{42}\] \[\hat{a}_{i}b_{i-1}^{j+1}+\hat{c}_{i}b_{i}^{j+1}+\hat{d}_{i}b_{i+1 }^{j+1}+\hat{k}_{i}U_{i-1}^{j+1}+\hat{l}_{i}U_{i+1}^{j+1}+\hat{r}_{i}b_{1}^{j+1 }+\hat{s}_{i}b_{N-1}^{j+1}=G_{i}^{j+1} \tag{43}\]  
where  
\[ \begin{array}{l}a_{i}=d_{i}=-\frac{\
u}{2h^{2}},\ \ \ c_{i}=\frac{1}{\tau}+\frac{\
u}{h^{2}}\\ k_{i}^{j+1}=-l_{i}^{j+1}=\frac{1}{4 hg^{j+1}}\left(r^{j,j+\frac{1}{2}}+\frac{ \
u}{X}h_{i}^{j+\frac{1}{2}}\right)+\frac{\
u_{m}}{4h^{2}g^{j+0.5}}\left(b_{1}^{ j}+b_{N-1}^{j}\right)\\ r_{i}^{j+1}=s_{i}^{j+1}=-\frac{\
u_{m}}{4h^{2}g_{i}^{j+0.5}}\left(b_{i+1}^{j}-b_{ i-1}^{j}\right)-\frac{\
u_{m}h_{i}^{j+0.5}}{2 hXg^{j+0.5}}\\ G_{i}^{j+1}=\frac{1}{\tau}U_{i}^{j}+\frac{\
u}{2h^{2}}\left(U_{i+1}^{j}-2U_{i}^{j }+U_{i+1}^{j}\right)+\frac{1}{4 hg_{i}^{j+0.5}}\left(F^{\prime,j+0.5}+\frac{\
u}{X} h^{j+0.5}\right)\left(b_{i+1}^{j}-b_{i-1}^{j}\right)\\ \hskip 142.26378 pt+\frac{\
u_{m}h^{j+0.5}}{2 hXg^{j+\frac{1}{2}}}\left(b_{N-1}^{j}+b_ {1}^{j}\right)\\ \hskip 142.26378 pt-f^{j+\frac{1}{2}}-u_{l}^{\prime j+0.5}-\frac{x_{i}}{X} ^{\prime}g^{\prime,j+\frac{1}{2}}+\left(F^{\prime j+\frac{1}{2}}+\frac{\
u}{X}h^{j +\frac{1}{2}}\right)\frac{h^{j+\frac{1}{2}}}{Xg^{j+\frac{1}{2}}}\end{array} \]\[ \begin{split}&\dot{a}_{i}=\dot{d}_{i}=-\frac{v_{m}}{2\hbar^{2}},\quad \dot{c}_{i}=\frac{1}{\tau}+\frac{v_{m}}{\hbar^{2}}\quad\dot{k}_{i}=-\dot{l}_{i }=k_{i}\\ &\dot{r}_{i}^{j+1}=\dot{s}_{i}^{j+1}=-\frac{v_{m}}{4\hbar^{2}g_{i }^{j+0.5}}\Big{(}\dot{U}_{i+1}^{j}-\dot{U}_{i-1}^{j}\Big{)}-\frac{v_{m}\hbar_{ i}^{j+0.5}}{2\hbar Xg^{j+0.5}}\\ &\dot{G}_{i}^{j+1}=\frac{1}{\tau}b_{i}^{j}+\frac{\
u}{2\hbar^{2}} \Big{(}b_{i+1}^{j}-2b_{i}^{j}+b_{i+1}^{j}\Big{)}+\frac{1}{4\hbar g_{i}^{j+0.5} }\Big{(}F^{{}^{\prime}j+0.5}+\frac{\
u}{X}h^{j+0.5}\Big{)}\Big{(}\dot{U}_{i+1} ^{j}-\dot{U}_{i-1}^{j}\Big{)}\\ &-\frac{v_{m}\hbar^{j+0.5}}{2\hbar Xg^{j+\frac{1}{2}}}\Big{(}b_{ N-1}^{j}+b_{1}^{j}\Big{)}\\ &-B^{{}^{\prime}j+\frac{1}{2}}-\frac{x_{i}}{X}h^{{}^{\prime}j+ \frac{1}{2}}+\Big{(}F^{{}^{\prime}j+\frac{1}{2}}+\frac{\
u}{X}h^{j+\frac{1}{2} }\Big{)}\frac{\hbar^{j+\frac{1}{2}}}{Xg^{j+\frac{1}{2}}}\end{split} \]  
We will seek the numerical solution \(\{U_{i}^{j},b_{i}^{j}\}\), \(i=1,\ldots,N-1,j=1,\ldots,M\) in the following linear combinations  
\[U_{i}^{j} = \bar{U}_{i}^{j}+v_{i}^{j}U_{1}^{j}+w_{i}^{j}U_{N-1}^{j}+y_{i}^{j} b_{1}^{j}+z_{i}^{j}b_{N-1}^{j}, \tag{44}\] \[b_{i}^{j} = \bar{b}_{i}^{j}+\bar{v}_{i}^{j}U_{1}^{j}+\bar{w}_{i}^{j}U_{N-1}^{j }+\bar{y}_{i}^{j}b_{1}^{j}+\bar{z}_{i}^{j}b_{N-1}^{j}. \tag{45}\]  
Plugging (44), (45) into (42), (43) we obtain five systems for the new unknown functions \(\Big{\{}\bar{U}_{i}^{j},\bar{b}_{i}^{j}\Big{\}}\), \(\Big{\{}v_{i}^{j},\bar{v}_{i}^{j}\Big{\}}\), \(\Big{\{}y_{i}^{j},\bar{v}_{i}^{j}\Big{\}}\), \(\Big{\{}y_{i}^{j},\bar{y}_{i}^{j}\Big{\}}\), \(\Big{\{}z_{i}^{j},\bar{z}_{i}^{j}\Big{\}}\):  
\[ \begin{split}& a_{i}\bar{U}_{i-1}^{j+1}+c_{i}\bar{U}_{i}^{j+1}+ d_{i}\bar{U}_{i-1}^{j+1}+k_{i}^{j+1}\bar{b}_{i-1}^{j+1}+l_{i}^{j+1}\bar{b}_{i+1}^{j +1}=G_{i}^{j+1}\\ &\dot{a}_{i}\bar{b}_{i}^{j+1}-\dot{c}_{i}\bar{b}_{i}^{j+1}+d_{i} \bar{b}_{i-1}^{j+1}+\dot{k}_{i}^{j+1}\bar{O}_{i-1}^{j+1}+\bar{l}_{i}^{j+1}\bar{ O}_{i+1}^{j+1}=\dot{G}_{i}^{j+1}\\ &\bar{U}_{1}^{j}=\bar{U}_{N-1}^{j}=0,\quad\bar{b}_{1}^{j}=\bar{b}_ {N-1}^{j}=0\quad j=1,2,\ldots M,\\ &\bar{U}_{i}^{0}=\dot{U}_{0}(x_{i}),\quad\bar{b}_{i}^{0}=b_{0}(x_ {i})\qquad i=1,2,\ldots,N-1,\end{split}  \tag{46}\]  
\[