# Applying Newton-Raphson method to system of two differential equations, one time independent, one time dependent

The goal is to couple system of two nonlinear differential equations by applying appropriate space and time discretization and Newton-Raphson scheme.

The equations system is \left[ \begin{array}{c} F_{1}(u,v) \\ F_{2}(u,v) \end{array}\right] = \left[ \begin{aligned} -\frac{\partial^2 u}{\partial x^2} &= v \\ \frac{\partial v}{\partial t} &=\frac{\partial J(u,v)}{\partial x} \end{aligned} \right] where $u(x,t), v(x,t)$ is function of time and space.

Notice $F_{1}$ is differential equation in space exclusively, and $F_{2}$ is partial differential equation in space and time.

The discretization in space and time are subscript $i$ and superscript $j$ respectively.

For $F_1$, discretizing in space gives $$F_{1}(u,v)\quad\rightarrow\quad \frac{u_{i+1}-2u_{i}+u_{i-1}}{\Delta x^2}+v_{i}=0$$ The next is discretizing $F_2$ in space. $$F_{2}(u,v)\quad\rightarrow\quad \frac{\partial v}{\partial t} = \frac{J_{i+1}-J_{i}}{\Delta x}$$

The assumption is made; $J_{i+1}$ is function of $u_{i}$, $u_{i+1}$, $v_{i}$ and $v_{i+1}$ and $J_{i}$ is function of $u_{i-1}$, $u_{i}$, $v_{i-1}$ and $v_{i}$.

In discretizing $F_{2}$ in time, the method TR-BDF2(Trapezoidal Rule - Second-order Backward Differentiation Formula) is applied, which is $$\frac{\partial q(z)}{\partial t} = f(z,t) \quad\rightarrow\quad \frac{q^{j+1}-q^{j}}{\Delta t}= \frac{f^{j+1}+f^{j}}{2} \quad\rightarrow\quad 2q^{j+1}-\Delta t f^{j+1} -2q^{j}-\Delta t f^{j} =0$$

Once again, superscript $j$ and $j+1$ denotes discretization in time, not power.

Applying TR-BDF2 method to space discretized $F_{2}$ gives $$F_{2}(u,v)\quad\rightarrow\quad 2v_{i}^{j+1}- \frac{\Delta t}{\Delta x}(J_{i+1}^{j+1}-J_{i}^{j+1}) -2v_{i}^{j}- \frac{\Delta t}{\Delta x}(J_{i+1}^{j}-J_{i}^{j}) =0$$

Now, there are two equations, one in only discretized in space and the other discretized in both time and space. How do these two equations be coupled in Newton-Raphson scheme?

Does applying TR-BDF2 to $F_{1}$ valid? Since $F_{1}$ has to remain invariant through time...

Anyway, $q$ is zero in $F_{1}$, so $f^{j+1}+ f^{j}=0$ (??) Then there are two equations both in time and space discretized. $$F_{1}(u,v)\quad\rightarrow\quad \frac{u_{i+1}^{j+1}-2u_{i}^{j+1}+u_{i-1}^{j+1}}{\Delta x^2}+v_{i}^{j+1} +\frac{u_{i+1}^{j+1}-2u_{i}^{j}+u_{i-1}^{j}}{\Delta x^2}+v_{i}^{j} =0$$ $$F_{2}(u,v)\quad\rightarrow\quad 2v_{i}^{j+1}- \frac{\Delta t}{\Delta x}(J_{i+1}^{j+1}-J_{i}^{j+1}) -2v_{i}^{j}- \frac{\Delta t}{\Delta x}(J_{i+1}^{j}-J_{i}^{j}) =0$$ Applying Newton-Raphson Scheme method to this system is, $$u^{k+1}=u^{k}+\delta u^{k}, \qquad\qquad \left[ \mathbf{J}(u^{k}) \right]\delta u^{k} = - \left[ \mathbf{F}(u^{k}) \right]$$

where Jacobian and $\mathbf{F}$ is

$$\left[ \begin{array}{*{8}c} U_{1D} & U_{1U} & & & V_{1D} & & & \\ U_{1L} & U_{1D} & U_{1U} & & &V_{1D}& & \\ & U_{1L} & \ddots & U_{1U}& & &\ddots& \\ & & U_{1L} & U_{1D}& & & &V_{1D}\\ U_{2D} & U_{2U} & & & V_{2D} &V_{2U}& & \\ U_{2L} & U_{2D} & U_{2U} & & V_{2L} &V_{2D}&V_{2U}& \\ & U_{2L} & \ddots & U_{2U}& &V_{2L}&\ddots&V_{2U} \\ & & U_{2L} & U_{2D}& & &V_{2L}&V_{2D}\\ \end{array} \right] \left[ \begin{array}{c} \delta u_2\\ \vdots \\ \delta u_{n-1}\\ \delta v_2\\ \vdots \\ \delta v_{n-1} \end{array} \right] = - \left[ \begin{array}{c} F_1(i=2)\\ \vdots\\ F_1(i=n-1)\\ F_2(i=2)\\ \vdots\\ F_2(i=n-1) \end{array} \right]$$

where $F_{1,2}(i)$ vector is inserting current $i$ value for $j$ terms and guess value $i$ for $j+1$ (next time) terms.

and each components are (D=main diagonal, U=first upper diagonal, L=first lower diagonal)

\begin{aligned} U_{1D} &= \frac{d}{du_i^{j+1}}F_{1}^{j+1} =-\frac{2}{\Delta x^2} & (2\leq i\leq n-1) \\ U_{1U} &= \frac{d}{du_{i+1}^{j+1}}F_{1}^{j+1} =\frac{1}{\Delta x^2} & (2\leq i\leq n-2) \\ U_{1L} &= \frac{d}{du_{i-1}^{j+1}}F_{1}^{j+1} =\frac{1}{\Delta x^2} & (3\leq i\leq n-1) \\ V_{1D} &= \frac{d}{dv_{i}^{j+1}}F_{1}^{j+1} =1 & (2\leq i\leq n-1) \\ U_{2D} &= \frac{d}{du_i^{j+1}}F_{2}^{j+1} =-\frac{\Delta t}{\Delta x^2}\left( \frac{dj_{i+1}^{j+1}}{du_{i}^{j+1}} - \frac{dj_{i}^{j+1}}{du_{i}^{j+1}} \right) & (2\leq i\leq n-1) \\ U_{2U} &= \frac{d}{du_{i+1}^{j+1}}F_{2}^{j+1} =-\frac{\Delta t}{\Delta x^2}\left( \frac{dj_{i+1}^{j+1}}{du_{i+1}^{j+1}} \right) & (2\leq i\leq n-2) \\ U_{2L} &= \frac{d}{du_{i-1}^{j+1}}F_{2}^{j+1} =\frac{\Delta t}{\Delta x^2}\left( \frac{dj_{i-1}^{j+1}}{du_{i-1}^{j+1}} \right) & (3\leq i\leq n-1) \\ V_{2D} &= \frac{d}{dv_i^{j+1}}F_{2}^{j+1} =2-\frac{\Delta t}{\Delta x^2}\left( \frac{dj_{i+1}^{j+1}}{dv_{i}^{j+1}} - \frac{dj_{i}^{j+1}}{dv_{i}^{j+1}} \right) & (2\leq i\leq n-1) \\ V_{2U} &= \frac{d}{dv_{i+1}^{j+1}}F_{2}^{j+1} =-\frac{\Delta t}{\Delta x^2}\left( \frac{dj_{i+1}^{j+1}}{dv_{i+1}^{j+1}} \right) & (2\leq i\leq n-2) \\ V_{2L} &= \frac{d}{dv_{i-1}^{j+1}}F_{2}^{j+1} =\frac{\Delta t}{\Delta x^2}\left( \frac{dj_{i-1}^{j+1}}{dv_{i-1}^{j+1}} \right) & (3\leq i\leq n-1) \end{aligned}

Again, $J_{i+1}$ is function of $u_{i}$, $u_{i+1}$, $v_{i}$ and $v_{i+1}$ and $J_{i}$ is function of $u_{i-1}$, $u_{i}$, $v_{i-1}$ and $v_{i}$.

Is this correct way?