Question 10.2: PRADI METHOD For the Dirichlet problem described in Figure 1...
PRADI METHOD
For the Dirichlet problem described in Figure 10.4,
1. Perform one complete step of the PRADI method with h=1 and starting values of 0.5 for all interior mesh points.
2. Solve the Dirichlet problem using the user-defined function PRADI with default parameter values.

Learn more on how do we answer questions.
1. First half. There are two rows and two columns in the grid, and a total of four interior mesh points. Equation 10.6
j \text { th row }(j=1,2, \ldots, M) \quad u_{i-1, j}^{(1 / 2)}-4 u_{i j}^{(1 / 2)}+u_{i+1, j}^{(1 / 2)}=-u_{i, j-1}^{(0)}-u_{i, j+1}^{(0)}, \quad i=1,2, \ldots, N (10.6)
is first applied in the first row (j=1). Since there are two mesh points in this row, Equation 10.6 is applied twice:
j=1 \quad \begin{array}{lll} (i=1) & u_{01}-4 u_{11}^{(1 / 2)}+u_{21}^{(1 / 2)}=-u_{10}-u_{12}^{(0)} \\ (i=2) &u_{11}^{(1 / 2)}-4 u_{21}^{(1 / 2)}+u_{31}=-u_{20}-u_{22}^{(0)} \end{array} (10.8)
Note that we have omitted superscripts for boundary values because they remain unchanged. We next apply Equation 10.6 at the two mesh points along the second row (j=2) :
j=2 \quad \begin{aligned} (i=1)\quad & u_{02}-4 u_{12}^{(1 / 2)}+u_{22}^{(1 / 2)}=-u_{11}^{(0)}-u_{13} \\ (i=2)\quad & u_{12}^{(1 / 2)}-4 u_{22}^{(1 / 2)}+u_{32}=-u_{21}^{(0)}-u_{23} \end{aligned} (10.9)
Combining Equations 10.8 and 10.9, and using the available boundary values as well as the starting values, we arrive at
\left[\begin{array}{cccc} -4 & 1 & 0 & 0 \\ 1 & -4 & 0 & 0 \\ 0 & 0 & -4 & 1 \\ 0 & 0 & 1 & -4 \end{array}\right]\left\{\begin{array}{l} u_{11}^{(1 / 2)} \\ u_{21}^{(1 / 2)} \\ u_{12}^{(1 / 2)} \\ u_{22}^{(1 / 2)} \end{array}\right\}=\left\{\begin{array}{c} -1.3660 \\ -1.3660 \\ -0.5 \\ -0.5 \end{array}\right\} \begin{array}{cl} {}_{\qquad \Rightarrow}^{\text{Thomas method }} & u_{11}^{(1 / 2)}=0.4553=u_{21}^{(1 / 2)} \\ &u_{12}^{(1 / 2)}=0.1667=u_{22}^{(1 / 2)} \end{array}
Second half. Equation 10.7 is applied in the first column (i=1). Since there are two mesh points in this column, it is applied twice:
i=1 \begin{array}{lll} & (j=1) & u_{10}-4 u_{11}^{(1)}+u_{12}^{(1)}=-u_{01}-u_{21}^{(1 / 2)} \\ & (j=2) & u_{11}^{(1)}-4 u_{12}^{(1)}+u_{13}=-u_{02}-u_{22}^{(1 / 2)} \end{array} (10.10)
We next apply Equation 10.7 at the two mesh points along the second column (i=2) :
i=2 \begin{array}{lll} & (j=1) & u_{20}-4 u_{21}^{(1)}+u_{22}^{(1)}=-u_{11}^{(1 / 2)}-u_{31} \\ & (j=2) & u_{21}^{(1)}-4 u_{22}^{(1)}+u_{23}=-u_{12}^{(1 / 2)}-u_{32} \end{array} (10.11)
Combining Equations 10.10 and 10.11, and using the available boundary values as well as the updated values from the previous half iteration, we arrive at
\left[\begin{array}{cccc} -4 & 1 & 0 & 0 \\ 1 & -4 & 0 & 0 \\ 0 & 0 & -4 & 1 \\ 0 & 0 & 1 & -4 \end{array}\right]\left\{\begin{array}{l} u_{11}^{(1)} \\ u_{12}^{(1)} \\ u_{21}^{(1)} \\ u_{22}^{(1)} \end{array}\right\}=\left\{\begin{array}{c} -1.3213 \\ -0.1667 \\ -1.3213 \\ -0.1667 \end{array}\right\} \quad \begin{aligned} & \text { Thomas method } \\ & \qquad \Rightarrow \end{aligned} \begin{aligned} & u_{11}^{(1)}=0.3635=u_{21}^{(1)} \\ & u_{12}^{(1)}=0.1325=u_{22}^{(1)} \end{aligned}
2. Executing the user-defined function PRADI (with default parameters) yields the solution estimates at the interior mesh points. Note that the plot has been suppressed.
>> x = 0:1:3; y = 0:1:3; f = @(x,y)(0);
>> ubottom = @(x)(sin(pi*x/3)); utop = @(x)(0); uleft = @(y)(0);
uright = @(y)(0);
>> [U, k] = PRADI(x,y,f,uleft,uright,ubottom,utop)
U =
0 0 0 0
0 0.1083 0.1083 0
0 0.3248 0.3248 0
0 0.8660 0.8660 0
k =
5
Therefore, convergence occurs after five iterations. The numerical results obtained in (1) can be verified by letting the function PRADI perform one iteration only. Setting k m a x=1 and executing the function results in
>> [U] = PRADI(x,y,f,uleft,uright,ubottom,utop,[],1)
U =
0 0 0 0
0 0.1325 0.1325 0
0 0.3635 0.3635 0
0 0.8660 0.8660 0
The numerical values for u_{11}^{(1)}, u_{21}^{(1)}, u_{12}^{(1)}, u_{22}^{(1)} agree with those in (1).