**3. Numerical experiments**

In this section, we discuss the numerical experiments to be used to demonstrate the accuracy and general performance of the multi-domain pseudospectral relaxation method. In these numerical experiments, we have selected equations with known exact solutions, and to determine the accuracy of the method, we find the relative error. The relative error is defined as

$$E\_j = \frac{|\mathbf{y}\_s(\mathbf{x}\_j) - \mathbf{y}\_a(\mathbf{x}\_j)|}{|\mathbf{y}\_s(\mathbf{x}\_j)|}\tag{29}$$

where *Ej* is the relative error at a grid point *xj* , *ye*(*xj* ) and *ya*(*xj* ) are the exact and approximate solutions at a grid point *xj* , respectively.

### **Example 1**

<sup>1</sup> ( ) ( ) ( ) 1 1

() () ( ) <sup>1</sup> ( ) = ( ) ( ), *kk k Vh y i j i j jN i N*

( ) ( ) ( ) 1 1 ( ) = ( ) ( , ( )) ( ), *<sup>k</sup> k k W gx f x y h i j <sup>j</sup> j i j jN i N*

() ()

( ) () ()

() () () () ( ) = [ ( ), ( ), ( ), , ( )] , 012 1 *kk k k k T <sup>N</sup> yyy y* ttt

() () () () ( ) = [ ( ), ( ), ( ), , ( )] , 012 1 *kk k k k T <sup>N</sup> hhh h* ttt

() () () () ( ) = [ ( ), ( ), ( ), , ( )] , 012 1 *kk k k k T <sup>N</sup> vvv v* ttt

() () () () ( ) = [ ( ), ( ), ( ), , ( )] , 012 1 *kk k k k T www w <sup>N</sup>* ttt

and *T* denotes the transpose of the vector. The *N* × *N* diagonal matrix ζ is given by

1

*x*

g

= .

O

ë û

é ù ê ú

1


*N*

g

*x*

0

*x*

z

g

z

and **W**(*<sup>k</sup>* )

tt

*h hW <sup>x</sup>* g

*<sup>N</sup> k kk js i s ij i j*

( ) ( ) = ( ).

<sup>1</sup> = , *k k i i*

are respectively given by

 t**Y** L - (24)

 t**H** L - (25)

 t**V** L - (26)

 t**W** L - (27)

(28)

tt

 t

tt

å**<sup>D</sup>** + + <sup>+</sup> (19)



<sup>1</sup> = , *k k* **DY V** *i i* <sup>+</sup> (22)

**DHW** + <sup>+</sup> (23)

=0

t

, **H**(*<sup>k</sup>* )

, **V**(*<sup>k</sup>* )

Eqs. (18) and (19) can be expressed in matrix form as follows:

where

where the vectors **Y**(*<sup>k</sup>* )


148 Numerical Simulation - From Brain Imaging to Turbulent Flows

*s j*

t

We first consider the linear, homogeneous Lane-Emden equation, with variable coefficients:

$$\mathbf{y}'' + \frac{2}{\mathbf{x}} \mathbf{y}' - 2(2\mathbf{x}^2 + 3)\mathbf{y} = \mathbf{0}, \ \mathbf{x} \ge \mathbf{0}, \quad \text{subject to} \quad \mathbf{y}(0) = \mathbf{l} \quad \text{and} \quad \mathbf{y}'(0) = \mathbf{0}, \tag{30}$$

which has the exact solution:

$$y(\mathbf{x}) = e^{x^2} \mathbf{.}$$

Eq. (30) has been solved by various researchers using different techniques such as the varia‐ tional iteration method and the homotopy-pertubation method [16, 28, 29].
