First of all, we consider forward problem (1)–(4) with all initial and boundary conditions, then we calculate solution using the CN-FDM scheme in this section.

### Theorem 4

*Let* \(\alpha (t)\), \(\xi (r)\), \(\zeta (r)\), \(P_{1}(t)\), \(P_{2}(t)\), \(s(r,t)\) *be known functions*, *and the CN*-*FDM scheme is utilized for time discretization*. *Then the numerical solution* \(z(r,t)\) *is given in equations* (19) *and* (21).

### Proof

We denote \(z(r_{i},t_{j})=z_{i,j}\), \(P_{1}(t)=P_{1}^{j}\), \(P_{2}(t)=P_{2}^{j}\), \(s(r_{i},t_{j})=s_{i,j}\), and \(\alpha (t_{j})=\alpha _{j}\), where \(r_{i}=i\Delta r\), \(t_{j}=j\Delta t\), \(\Delta r=\frac{1}{M}\), and \(\Delta t=\frac{T}{N}\), \(i=0(1)M\) and \(j=0(1)N\). Then the \((\Delta r^{2},\Delta t^{2})\) CN-FDM [26] discretizes (1) as follows:

$$\begin{aligned}& \frac{z_{i,j+1}-2z_{i,j}+z_{i,j-1}}{(\Delta t)^{2}}- \biggl( \frac{z_{i+1,j+1}-2z_{i,j+1}+z_{i-1,j+1}+z_{i+1,j}-2z_{i,j}+z_{i-1,j}}{2(\Delta r)^{2}} \biggr) \\& \quad = \frac{\alpha _{j+1}}{2} z_{i,j+1} + \frac{\alpha _{j}}{2} z_{i,j}+ \frac{1}{2} (s_{i,j+1}+s_{i,j} ),\quad i=1(1)M, j=1(1)N. \end{aligned}$$

(11)

Equation (11) yields

$$\begin{aligned}& -A z_{i-1,j+1}+ (1+2A-B_{j+1} ) z_{i,j+1}-A z_{i+1,j+1} \\& \quad = A z_{i-1,j}+ (2+2A+B_{j} ) z_{i,j} +A z_{i+1,j}-z_{i,j-1} \\& \qquad {}+\frac{(\Delta t)^{2}}{2} (s_{i,j+1}+s_{i,j} ), \quad i=1(1)M, j=1(1)N, \end{aligned}$$

(12)

where

$$ A=\frac{(\Delta t)^{2}}{2 (\Delta r)^{2}}, \qquad B_{j}= \frac{(\Delta t)^{2}}{2} \alpha _{j}. $$

The discretization of nonlocal ICs (2) is

$$\begin{aligned}& z_{i,0}=\frac{\Delta t}{3} \Biggl( {P_{1}^{0} z_{i,0} + P_{1}^{N} z_{i,N} + \sum _{l = 1,3}^{N - 1} {P_{1}^{l} z_{i,l} } + \sum_{l = 2,4}^{N - 2} {P_{1}^{l} z_{i,l} } } \Biggr)+ \xi (r_{i}),\quad i=0(1)M, \end{aligned}$$

(13)

$$\begin{aligned}& \frac{z_{i,1}-z_{i,-1}}{2 (\Delta t)}=\frac{\Delta t}{3} \Biggl( {P_{2}^{0} z_{i,0} + P_{2}^{N} z_{i,N} + \sum_{l = 1,3}^{N - 1} {P_{2}^{l} z_{i,l} } + \sum _{l = 2,4}^{N - 2} {P_{2}^{l} z_{i,l} } } \Biggr)+ \zeta (r_{i}),\quad i=0(1)M, \end{aligned}$$

(14)

and the periodic BC (3) is

$$ z(0,t)=z_{0,j}=z(1,t)=z_{M,j}. $$

(15)

Finally, discretization of integral BC (4) is given as follows:

$$ \int _{0}^{1} z(r,t_{j})\,dr = \frac{\Delta r}{3} \Biggl( {z_{0,j} + z_{M,j} + \sum _{l = 1,3}^{M - 1} {z_{l,j} } + \sum _{l = 2,4}^{M - 2} {z_{l,j} } } \Biggr)= 0, \quad j=0(1)N. $$

(16)

For \(i=0\) and *M*, from equations (15) and (16), we get

$$ 2z_{0,j} + 4 \sum_{l = 1,3}^{M - 1} {z_{l,j} } +2 \sum_{l = 2,4}^{M - 2} {z_{l,j} } = 0,\quad i=0, j=0(1)N, $$

(17)

and

$$ 4 \sum_{l = 1,3}^{M - 1} {z_{l,j} } + 2 \sum_{l = 2,4}^{M - 2} {z_{l,j} } +2z_{M,j}= 0,\quad i=M, j=0(1)N. $$

(18)

The above equations (12), (17), and (18) can be reformulated and converted at time \(t_{j+1}\) into the \((M+1)\times (M+1)\) system:

\left[\begin{array}{cccccccc}2& 4& 2& 4& 2& \cdots & 4& 0\\ -A& \overline{B}& -A& 0& 0& \cdots & 0& 0\\ 0& -A& \overline{B}& -A& 0& \cdots & 0& 0\\ \vdots & \ddots & \ddots & \ddots & \vdots & \cdots & \vdots & \vdots \\ 0& 0& \cdots & -A& \overline{B}& -A& 0& 0\\ 0& 0& \cdots & 0& -A& \overline{B}& -A& 0\\ 0& 0& \cdots & 0& 0& -A& \overline{B}& -A\\ 0& 4& \cdots & 4& 2& \dots & 4& 2\end{array}\right]\left[\begin{array}{c}{z}_{0,j+1}\\ {z}_{1,j+1}\\ {z}_{2,j+1}\\ {z}_{3,j+1}\\ \vdots \\ {z}_{M-2,j+1}\\ {z}_{M-1,j+1}\\ {z}_{M,j+1}\end{array}\right]=\left[\begin{array}{c}{R}_{0,j}\\ {R}_{1,j}\\ {R}_{2,j}\\ {R}_{3,j}\\ \vdots \\ {R}_{M-2,j}\\ {R}_{M-1,j}\\ {R}_{M,j}\end{array}\right],

(19)

where

$$\begin{aligned}& \hat{B}=1+2A-B_{j+1},\qquad R_{0,j}=R_{M,j}=0, \\& R_{i,j}=A z_{i-1,j}+ (2+2A+B_{j} ) z_{i,j} +A z_{i+1,j}-z_{i,j-1} \\& \hphantom{R_{i,j}={}}{}+\frac{(\Delta t)^{2}}{2} (s_{i,j+1}+s_{i,j} ),\quad i=1(1)M-1, j=1(1)N. \end{aligned}$$

At time \(t_{1}\), using (14) in (12), we get

$$\begin{aligned}& -A z_{i-1,1} + (2+2A-B_{1} ) z_{i,1}-A z_{i+1,1} \\& \quad =A z_{i-1,0} + (2+2A+B_{0} ) z_{i,0} +A z_{i+1,0} +2 (\Delta t) \zeta (r_{i}) \\& \qquad {}+ \frac{k^{2}}{3} \Biggl( {P_{2}^{0} z_{i,0} + P_{2}^{N} z_{i,N} + \sum _{l = 1,3}^{N - 1} {P_{2}^{l} z_{i,l} } + \sum_{l = 2,4}^{N - 2} {P_{2}^{l} z_{i,l} } } \Biggr) \\& \qquad {}+\frac{(\Delta t)^{2}}{2} (s_{i,1}+s_{i,0} ), \quad i=1(1)M-1. \end{aligned}$$

(20)

Now, at time \(t_{1}\), equations (17), (18), and (20) can be reformulated into the \((M+1)\times (M+1)\) system:

\left[\begin{array}{cccccccc}2& 4& 2& 4& 2& \cdots & 4& 0\\ -A& \stackrel{\u02c6}{B}& -A& 0& 0& \cdots & 0& 0\\ 0& -A& \stackrel{\u02c6}{B}& -A& 0& \cdots & 0& 0\\ \vdots & \ddots & \ddots & \ddots & \vdots & \cdots & \vdots & \vdots \\ 0& 0& \cdots & -A& \stackrel{\u02c6}{B}& -A& 0& 0\\ 0& 0& \cdots & 0& -A& \stackrel{\u02c6}{B}& -A& 0\\ 0& 0& \cdots & 0& 0& -A& \stackrel{\u02c6}{B}& -A\\ 0& 4& \cdots & 4& 2& \dots & 4& 2\end{array}\right]\left[\begin{array}{c}{z}_{0,1}\\ {z}_{1,1}\\ {z}_{2,1}\\ {z}_{3,1}\\ \vdots \\ {z}_{M-2,1}\\ {z}_{M-1,1}\\ {z}_{M,1}\end{array}\right]=\left[\begin{array}{c}{R}_{0,0}\\ {R}_{1,0}\\ {R}_{2,0}\\ {R}_{3,0}\\ \vdots \\ {R}_{M-2,0}\\ {R}_{M-1,0}\\ {R}_{M,0}\end{array}\right],

(21)

where

$$\begin{aligned}& \hat{B}=2+2A-B_{1},\qquad R_{0,0}=R_{M,0}=0, \\& R_{i,0}=A z_{i-1,0} + (2+2A+B_{0} ) z_{i,0} +A z_{i+1,0} +2 (\Delta t) \zeta (r_{i}) \\& \hphantom{R_{i,0}={}}{}+ \frac{(\Delta t)^{2}}{3} \Biggl( {P_{2}^{0} z_{i,0} + P_{2}^{N} z_{i,N} + \sum _{l = 1,3}^{N - 1} {P_{2}^{l} z_{i,l} } + \sum_{l = 2,4}^{N - 2} {P_{2}^{l} z_{i,l} } } \Biggr) \\& \hphantom{R_{i,0}={}}{}+\frac{(\Delta t)^{2}}{2} (s_{i,1}+s_{i,0} ), \quad i=1(1)M-1. \end{aligned}$$

□