1 Introduction

Artificial intelligence techniques based on neural networks optimized with efficient global and local search methodologies have been extensively used to solve variety of the linear and nonlinear systems based on ordinary and partial differential equations [15]. For example, stochastic solvers based on neural networks optimized with evolutionary computing and swarm intelligence algorithms have been employed to solve the nonlinear oscillatory systems with both stiff and non-stiff scenarios [6, 7], nonlinear magnetohydrodynamics (MHD) problems [8], fluid dynamics problems based on nonlinear Jaffery–Hamel flow equations [9], the nonlinear Schrodinger equations [10], one-dimensional Bratu’s problems arise in fuel ignition model [11, 12], Troesch’s problem arising in the study of confinement of a plasma column by radiation pressure [13, 14] and nonlinear singular systems based on Lane Emden flower equations [15]. A good a survey article is referred for interested readers [16] that summarized the importance, history, recent development and future progress of research in this area. Applicability domain of these methods has been extended to solve effectively the differential equations of fractional order as well [17, 18]. For instance, the fractional Riccati differential equation and the Bagley–Torvik fractional system [19, 20] are other significant applications of such solvers. Recently, the evolutionary computing approach based on genetic algorithms (GAs) and interior-point method (IPM) is applied to 2-dimensional (2D) Bratu’s problems by transforming into equivalent one-dimensional ordinary differential equation [21]. This study presents the extension of previous works by applying the hybrid or memetic computing technique based on artificial neural networks (ANN), particle swarm optimization (PSO) and sequential quadratic programming (SQP) algorithms to solve the transformed boundary value problem (BVP) of 2D Bratu’s type equation.

The PSO algorithms since their introduction by Kennedy and Eberhart [22] have been used extensively in diverse fields as an alternate to genetic algorithms to get better optimal results. PSO techniques belong to a class of global optimization techniques which were developed on the basis of mathematical modeling of bird and fish behavior. Discrete and continuous versions of the algorithms have been developed along with many variants, and these are broadly used as expert systems for constrained and unconstrained optimization problems. A few examples in which PSO methods have performed exceedingly well include mobile communication, sensor networks, inventory control, multiprocessor scheduling, controls, stock market prediction [2326]. These optimizers are good candidate to explore for finding the optimal design parameter of neural networks model to difficult nonlinear singular BVPs of differential equation.

In the present study, alternate stochastic numerical solution is developed for the transformed form of 2D Bratu’s equation, whose generic n-dimensional form is given as:

$$ \left\{ \begin{aligned} &\Delta u + \mu {\text{e}}^{u} = 0,\quad {\text{in}}\;\varOmega \\ & u = 0,\quad {\text{on }}\varOmega \\ \end{aligned} \right. $$
(1)

Here ∆ is the Laplacian operator, u represents the solution to the equation, and μ is a real number. Usually the domain Ω is taken to be the unit interval [0, 1] in ℜ, or the unit square [0, 1]·[0, 1] in ℜ2, or the unit cube [0, 1]·[0, 1]·[0, 1] in ℜ3. In case Ω = B 1 is the unit ball in ℜn, n > 1, the n-dimensional Bratu equation (1) is transformed into an equivalent one-dimensional nonlinear BVP with singularity at origin as follows [21, 2729]:

$$ \left\{ \begin{aligned} & u^{{\prime \prime }} (r) + \frac{n - 1}{r}u^{{\prime }} (r) + \mu {\text{e}}^{u(r)} = 0,\quad 0 \le r \le 1 \\ & u(1) = u^{{\prime }} (0) = 0, \\ \end{aligned} \right. $$
(2)

Detailed derivation of this transformation is given in [29]. 2D Bratu’s problem are derived from (2) by taking n = 2 as:

$$ \left\{ \begin{aligned} & u^{{\prime \prime }} (r) + \frac{1}{r}u^{{\prime }} (r) + \mu {\text{e}}^{u(r)} = 0,\quad 0 \le r \le 1 \\ & u(1) = u^{{\prime }} (0) = 0. \\ \end{aligned} \right. $$
(3)

Bratu problem (13) arises in the simplification of solid fuel ignition models in the field of thermal combustion theory. These problems have a long history, few famous generalization are the “Liouville–Gelfand” or “Liouville–Gelgand–Bratu” problem in recognition of the great French mathematicians Liouville and Gelfand [3032]. The problem comes up extensively in various physical problems in applied science and engineering, such as chemical reactor theory, nanotechnology, radiative heat transfer, and the Chandrasekhar model for the expansion of the universe [3135]. Recent articles in which solutions of Bratu-type equations have been given include the non-polynomial spline method of Jalilian [36], the one-point pseudospectral collocation method [37] of Boyd and the Lie-group shooting method (LGSM) by Abbasbandy et al. [38.]

In this study, the strength of ANNs has been exploited once again to develop an approximate mathematical model for the Bratu-type BVP. The accuracy of the model is subject to the tuning of the adjustable parameters, i.e., the weights of the ANNs. A swarm intelligence technique based on the PSO algorithm, the SQP method and a hybrid scheme PSO-SQP are used for the training of the weights of the ANNs. The viability and reliability of this method has been validated by a large number of independent runs of the algorithms along with their detailed statistical analysis. Comparison of the results is made with the reported exact and numerical solution.

2 Neural network modeling

In this section, a detailed description of modeling of BVPs of Bratu-type equations using ANNs is presented. We also formulate an unsupervised fitness function for the network.

2.1 Mathematical model

An approximate mathematical model for the Bratu equations is developed with the help of feed-forward ANNs by exploiting its strength of universal function approximation capability. It is well known that the solution u(r) to the equation and its kth derivative u (k) can be modeled by the following continuous neural network mapping [1, 5, 21]:

$$ \left\{ \begin{aligned} &\hat{u}(r) = \sum\limits_{i = 1}^{m} {\alpha_{i} f(w_{i} r + \beta_{i} ),} \\ &u^{(k)} (r) = \sum\limits_{i = 1}^{m} {\alpha_{i} f^{(k)} (w_{i} r + \beta_{i} ),} \\ \end{aligned} \right. $$
(4)

Here α i , w i and β i are the adaptive (real-valued) network parameters, and m is the number of neurons in the network. f is the activation function normally taken as log-sigmoid function for hidden layers and linear function is used for the output layers:

$$ \left\{ \begin{aligned} & u(t) = \frac{1}{{1 + {\text{e}}^{ - t} }},{\text{ for the hidden layers}} \\ & u(t) = t,\quad {\text{ for the output layer}} \\ \end{aligned} \right. $$
(5)

Using the log-sigmoid function as given above in Eq. (4), the updated form of the solution u(r) to Eq. (3), and its first (u′) and second (u″) derivatives, respectively, are written as:

$$ \left\{ \begin{aligned} \hat{u}(r) & = \sum\limits_{i = 1}^{m} {\alpha_{i} \left( {\frac{1}{{1 + {\text{e}}^{{ - \left( {w_{i} r + \beta_{i} } \right)}} }}} \right)} \\ \hat{u}^{{\prime }} (r) & = \sum\limits_{i = 1}^{m} {\alpha_{i} w_{i} \left( {\frac{{{\text{e}}^{{ - \left( {w_{i} r + \beta_{i} } \right)}} }}{{\left( {1 + {\text{e}}^{{ - \left( {w_{i} r + \beta_{i} } \right)}} } \right)^{2} }}} \right)} \\ \hat{u}^{{\prime \prime }} (r) & = \sum\limits_{i = 1}^{m} {\alpha_{i} w_{i}^{2} \left( {\frac{{2{\text{e}}^{{ - 2\left( {w_{i} r + \beta_{i} } \right)}} }}{{\left( {1 + {\text{e}}^{{ - \left( {w_{i} r + \beta_{i} } \right)}} } \right)^{2} }} - \frac{{{\text{e}}^{{ - \left( {w_{i} r + \beta_{i} } \right)}} }}{{\left( {1 + {\text{e}}^{{ - \left( {w_{i} r + \beta_{i} } \right)}} } \right)^{2} }}} \right)} \\ \end{aligned} \right. $$
(6)

The arbitrary combination of the networks given in above set of equations is used to develop the approximate model of the second-order differential equations, in-particularly, Eq. (3).

2.2 Fitness function

The fitness function for the Bratu equations in terms of the unsupervised error function ε is defined as the sum of the mean squared errors:

$$ \varepsilon = \varepsilon_{1} + \varepsilon_{2} , $$
(7)

and the error ε 1 associated with the differential equations is formulated as:

$$ \left\{ \begin{aligned} \varepsilon_{1} & = \frac{1}{K + 1}\sum\limits_{{k{\kern 1pt} = 0}}^{K} {\left( {\hat{u}_{k}^{{\prime \prime }} + \frac{1}{r}\hat{u}_{k}^{{\prime }} + \mu {\text{e}}^{{\hat{u}_{k} }} } \right)^{2} ,\quad r \in (0,\;1)} \\ k & = 1/h,\quad \hat{u}_{k} = \hat{u}(r_{k} ),\quad r_{k} = kh \\ \end{aligned} \right. $$
(8)

Here the interval r ∈ (0, 1) is divided into K steps r ∈ (r 0 = 0, r 1, r 2, …, r k  = 1) with step size h, and \( \hat{u}(r),\;\hat{u}^{{\prime }} \;{\text{and }}\hat{u}^{{\prime \prime }} \) are the outputs of the neural networks as given by the set of Eq. (6).

Similarly, the error ε 2 due to the boundary conditions can be written as:

$$ \varepsilon_{2} = \frac{1}{2}\left( {\left( {\hat{u}_{K} } \right)^{2} + \left( {\hat{u}_{0}^{{\prime }} } \right)^{2} } \right) $$
(9)

It can be seen that for weights α i , w i and β i for which the functions ε 1 and ε 2 approach zero, the value of the unsupervised error ε also approaches 0. The ANN thus approximates the solution u(r) of Eq. (3) with û(r) as given by (6). The architecture of the network is presented graphically in Fig. 1 and will be referred to as a differential equation artificial neural network (DE-ANN).

Fig. 1
figure 1

Neural networks architecture for nonlinear singular system given in (3). a For error function ɛ 1 associated with differential equation, b for error function ɛ 1 associated with differential equation

3 Learning procedures

In this section, we give a brief introduction to the PSO and SQP algorithms, which are used to train the weights of the DE-ANN. The procedure for execution of the algorithms along with their parameter settings is described stepwise.

Swarm intelligence techniques often referred to as particle swarm optimization (PSO) algorithms were originated from the work of Kennedy and Eberhart [22]. In the standard working of PSO method, each candidate solution to an optimization problem is taken as a particle in the search space. The exploration exploitation of the entire search space is made with a population of particles referred to as a “swarm.” All particles of the swarm have their own values of fitness according to the problem specific objectives. The particles of the swarm are initialized randomly; the position and velocity of every particle are updated in each flight, according to the previous best local p LB (t − 1) and global p GB (t − 1) positions of that particle. The generic updating formulae for particle velocity and position in the standard continuous PSO are written as:

$$ \left\{ \begin{aligned} {\mathbf{v}}(t) & = \omega {\mathbf{v}}(t - 1) + c_{1} {\mathbf{rd}}_{1} \left( {{\mathbf{p}}_{\text{LB}} \left( {t - 1} \right) - {\mathbf{x}}\left( {t - 1} \right)} \right) + c_{2} {\mathbf{rd}}_{2} \left( {{\mathbf{p}}_{\text{GB}} \left( {t - 1} \right) - {\mathbf{x}}\left( {t - 1} \right)} \right), \\ {\mathbf{x}}(t) & = {\mathbf{x}}(t - 1) + {\mathbf{v}}(t), \\ \end{aligned} \right. $$
(10)

where the vector x represents a particle of the swarm X, consist of sufficient number of particles, v is the velocity vector for the particle, ω is the inertia weight (linearly decreasing over the course of the search between 0 and 1), c 1 and c 2 are the local and global social acceleration constants, respectively, and rd 1 and rd 2 are random vectors with values between 0 and 1. The elements of velocity are bounded as v i ∈ [−v max, v max], where v max is the maximum velocity. If the velocity exceeds the limits, it will be reset to the respective lower or upper bound. The global learning capabilities of the PSO is exploited for finding the optimal results along with the combination with local search techniques based of efficient sequential quadratic programming (SQP) technique for further fine-tuning of results.

The SQP methods belong to a class of nonlinear programming techniques suited well for constrained optimization problems. Their importance and significance is well established on the basis of efficiency, accuracy and percentage of successful solutions to a large number of test problems. A broad introduction and review of mathematical programming techniques for large-scale numerical optimization is given by Nocedal and Wright [39]. A good source of reference material on SQL algorithms can be found in [40, 41]. The SQP methods have been used by many researchers in diverse areas of applied science and engineering. A few recently published articles can be seen in [42, 43].

Keeping in view the strengths of the PSO and SQP algorithms, our intention is to use these schemes along with their hybrid approach referred to as PSO-SQP, for training the weights of the DE-ANN. The generic flow diagram of the process of the hybrid PSO-SQP technique is shown graphically in Fig. 2, while the necessary detailed procedural steps are given as follows:

Fig. 2
figure 2

Generic flow diagram of the hybrid PSO-SQP algorithm

Step 1:

Initialization: Initialize the swarm consists of particles generated randomly using bounded real values. Each particle has as many elements as the number of unknown adaptive parameters of the DE-ANN. The parameters are initialized as per settings given in Table 1, and then the execution of the algorithm is started.

Table 1 Parameter settings for PSO and SQP techniques
Step 2:

Fitness evaluation: Calculate fitness values for each particle using the fitness function given in (7) and subsequently the Eqs. (8) and (9).

Step 3:

Termination criteria: Terminate the algorithm if any of following criterion is satisfied:

  • Fitness value less than a pre-specified tolerance is achieved, e.g., ε ≤ 10−16.

  • Maximum number of cycles is executed.

    If any of the above criteria is met, then go to step 5.

Step 4:

Renewal: Update the velocity and position of the particles using the Eq. (10), and go to step 2 for the next execution cycle, i.e., flight.

Step 5:

Refinement: MATLAB built-in function (FMINCON with algorithm SQP) is used for running the SQP method for fine-tuning of the results. Following procedural is adapted for SQP algorithm:

  1. (a)

    Initialization: The best fitted particle from the PSO technique is taken as the start point or initial weight vector for the SQP algorithm: bounds and other declarations for program and tool initialization are given in Table 1.

  2. (b)

    Evaluation of fitness: Calculate the value of fitness function, ε, as given in (7) and subsequently the Eqs. (8) and (9).

  3. (c)

    Termination criteria: Terminate the iterative process of updating the weights of ANNs, if any of the following criteria fulfilled

    • Predefined total number of iterations completed.

    • Any value for function tolerance (TolFun), maximum function evaluation (MaxFunEvals), X-tolerance (TolX), or constraints tolerance (TolCon) is achieved as defined in Table 2.

      Table 2 Comparison of the results for μ = 0.5

      If termination criterion fulfilled, then go to step 6.

  4. (d)

    Updating of weights: Step increment in SQP procedure is made and go to step 5(c).

Step 6:

Storage: Store the values of the best global individual along with its fitness and time taken for this runs of the algorithm.

Step 7:

Statistical analysis: Repeat steps 1–6 for a sufficiently large number of independent runs of the algorithm in order to have reliable results for subsequent statistical analysis.

4 Simulation and results

In this section, we present the results of simulations of the designed methodology applied to the nonlinear Bratu problem with singularity at origin for the three variants corresponding to different values of μ. The Bratu equation (3) has either zero, one or two solutions depending on whether μ > μ c, μ = μ c, or μ < μ c, respectively, where μ c represents the critical value of the coefficient μ (μ c = 2 [2729]). Results for the three cases μ = 0.5, 1 and 2 are given here and compared with the exact solution. A statistical analysis is also provided in each case.

4.1 Bratu equation for μ = 0.5

Consider the BVP of the form (3), given in this case as: [21]

$$ \left\{ \begin{aligned} & u^{\prime \prime } (r) + \frac{1}{r}u^{\prime } (r) + 0.5{\text{e}}^{u(r)} = 0,\quad 0 \le r \le 1 \\ & u(1) = u^{\prime } (0) = 0 \\ \end{aligned} \right. $$
(11)

The exact solution of the above problem is given as: [21]

$$ u(r) = \log \left( {\frac{{16\left( {7 + 4\sqrt 3 } \right)}}{{\left( {7 + 4\sqrt 3 + r^{2} } \right)^{2} }}} \right) $$
(12)

To solve this case of the Bratu equation using the proposed DE-ANN algorithm, we take 10 neurons in each hidden layer of the ANN, which results in 30 weights (α i , w i and β i ). The training set is taken from inputs r ∈ (0, 1) with a step of h = 0.1, i.e., a total of 11 grid points in the entire domain. The fitness function ε for this problem is formulated using Eqs. (7), (8) and (9) as:

$$ \varepsilon = \frac{1}{11}\sum\limits_{{k{\kern 1pt} = 0}}^{10} {\left( {\hat{u}_{k}^{{\prime \prime }} + \frac{1}{r}\hat{u}_{k}^{{\prime }} + 0.5{\text{e}}^{{\hat{u}_{k} }} } \right)^{2} + \frac{1}{2}\left( {\left( {\hat{u}_{10} } \right)^{2} + \left( {\hat{u}_{0}^{{\prime }} } \right)^{2} } \right)\quad } $$
(13)

The optimization of weights of the DE-ANN is carried out using the PSO, SQP and PSO-SQP algorithms for one hundred independent runs using the parameter settings as given in Table 1. One set of weights learned by the PSO, the SQP and the hybrid PSO-SQP methods with fitness values of 1.2417 × 10−08, 1.3753 × 10−13, and 2.6895 × 10−12, respectively, are tabulated in Appendix Table 10. The solution obtained using first equation of set (6) and weights given in Table 10 for the 11 input points in r ∈ (0, 1) with a step size of 0.1 is given in Table 2. The exact solution and reported results [21] of GA, IPA and GA-IPA to the problem are also tabulated in Table 2 for the same inputs. The maximum value of the absolute error (AE) is defined as absolute deviation from the exact solution and its values for PSO, SQP and PSO-SQP techniques are 4.37 × 10−06, 2.53 × 10−07 and 2.31 × 10−07, respectively, while for reported GA, IPA and GA-IPA, these are 6.15 × 10−05, 7.56 × 10−07 and 5.55 × 10−07, respectively. It is seen that the generally the accuracy of the present methods is superior to the reported results.

The accuracy and convergence of the proposed algorithms is examined by calculating the values of mean absolute error (MAE) and fitness achieved (FA) based on one hundred independent runs. Results are shown graphically in Fig. 3 on a semi-log scale in order to elaborate small differences in values. In Fig. 3a, c, the values of the fitness function ε and MAE are plotted, respectively, for each algorithm against the number of independent runs of the algorithms. The runs are renumbered so that FA and MAE are plotted in ascending order in Fig. 3b, d. The values of fitness function ε as given in (13) for the PSO algorithm lie in the range 10−05–10−08, while for both SQP and PSO-SQP it lies in the range 10−08–10−13. Similarly, the values of MAE are of the order of 10−03–10−06 for the PSO technique, while for both SQP and PSO-SQP schemes it lies in the range 10−05–10−08. It is seen that there is no noticeable difference between SQP and PSO-SQP for this variant of BVP (3) and relatively better than that of PSO algorithm.

Fig. 3
figure 3

The results for 100 independent runs of the algorithms for the Bratu equation for μ = 0.5, a, c unarranged values of FA and MAE, respectively, b, d rearranged in ascending order of FA and MA values, respectively

The statistical analysis of the results for each solver is now performed using the mean and standard deviation (STD) along with the minimum (MIN) and maximum (MAX) values of the absolute error. The results are tabulated in Table 3 along with reported results of GA-IPA for inputs between 0 and 1 with a step size of 0.2. It is seen that the mean value lies in the range 10−04–10−05 for the PSO technique, while for both SQP and PSO-SQP algorithms it lies between 10−05 and 10−08. It is also observed that there is no noticeable difference in the values of the statistical parameters for the SQP and PSO-SQP present and reported GA-IPA methods; however, the results of the hybrid PSO-SQP scheme are generally more accurate than those of the SQP technique. Also these are much better than the solutions given by the PSO algorithm. Moreover, the reported results of GA given in [21] are generally inferior to the result proposed PSO algorithm.

Table 3 Results of statistical analysis for Bratu equation for the case μ = 0.5

4.2 Bratu equation for μ = 1.0

The nonlinear BVP of the form (3) for μ = 1.0 is given as: [21]

$$ \left\{ \begin{aligned} & u^{{\prime \prime }} (r) + \frac{1}{r}u^{{\prime }} (r) + {\text{e}}^{u(r)} = 0,\quad 0 \le r \le 1 \\ & u(1) = u^{{\prime }} (0) = 0 \\ \end{aligned} \right. $$
(14)

The exact solution of the above equation is given as: [21]

$$ u(r) = \log \left( {\frac{{8\left( {3 + 2\sqrt 2 } \right)}}{{\left( {3 + 2\sqrt 2 + r^{2} } \right)^{2} }}} \right) $$
(15)

The given problem (14) is solved using the same methodology as applied for the case μ = 0.5; however, the fitness function ε formulated in this case is:

$$ \varepsilon = \frac{1}{11}\sum\limits_{{k{\kern 1pt} = 0}}^{10} {\left( {\hat{u}_{k}^{{\prime \prime }} + \frac{1}{r}\hat{u}_{k}^{{\prime }} + {\text{e}}^{{\hat{u}_{k} }} } \right)^{2} + \frac{1}{2}\left( {\left( {\hat{u}_{10} } \right)^{2} + \left( {\hat{u}_{0}^{{\prime }} } \right)^{2} } \right)\quad } $$
(16)

Again optimization of the weights of the DE-ANN is carried out with PSO, SQP, and PSO-SQP algorithms for a hundred independent runs. A set of trained weights is given in Appendix Table 11 for the three techniques with fitness values of 2.8207 × 10−09, 1.2113 × 10−11 and 3.1141 × 10−11, respectively. The solution to problem (14) is now determined using these weights for inputs r ∈ (0, 1) with a step size of 0.1, and results are presented in Table 4 along with reported and exact solution. The maximum values of the AE for proposed PSO, SQP and PSO-SQP methods are 1.34 × 10−05, 4.91 × 10−08 and 2.43 × 10−07, respectively, while for reported GA, IPA and GA-IPA [21], these values are 1.94 × 10−04, 6.38 × 10−07 and 2.03 × 10−07, respectively. Generally the proposed results are relatively better than that of the reported results.

Table 4 Comparison of the results for μ = 1.0

The values of the MAE and fitness function ε as given in Eq. (16) are computed for the 100 independent runs for the three techniques, and results are plotted in Fig. 4. The value of ε lies in the range 10−05–10−08, 10−02–10−13 and 10−09–10−13 for the PSO, SQP and PSO-SQP methods, respectively. Similarly, the value of MAE for the three respective algorithms lies in the range 10−03–10−05, 1000–10−08 and 10−04–10−08. It is observed that for some independent runs the results of the SQP algorithm are not convergent, while the PSO and PSO-SQP methods remained convergent for all runs. As far as accuracy is concerned, the values of MAE for the convergent cases of the SQP and PSO-SQP algorithms are better than those of the PSO algorithm. Generally, the hybrid approach PSO-SQP provides the most accurate and convergent results for this case of the Bratu equation.

Fig. 4
figure 4

The results for 100 independent runs of the algorithms for the Bratu equation for the case μ = 1.0, a, c unarranged values of FA and MAE, respectively, b, d rearranged in ascending order of FA and MAE values, respectively

The accuracy of the proposed algorithms is analyzed further on the basis of the statistical parameters calculated for 100 independent runs of each solver. The results are presented in Table 5 for inputs 0–1 with a step size of 0.2. The reported results [21] of statistical analysis for hybrid approach GA-IPA are also tabulated in Table 5 for the same results. It can be seen that the values for MIN, MAX, mean and STD of the AE are lowest for the hybrid approach PSO-SQP. The mean values of the AE calculated for PSO, SQP and PSO-SQP algorithms lie in the range 10−04–10−05, 10−02–10−03 and 10−05–10−08, respectively. The results of the SQP method get deteriorated due to convergence problems observed in a few runs, this is because the SQP technique is a local search method and therefore more probable to getting stuck in some local minimum. The PSO-SQP technique stands out as the most accurate and convergent of the three proposed schemes, and generally its results are in good agreement with reported GA-IPA technique.

Table 5 Results of statistical analysis for Bratu equation for the case μ = 1.0

4.3 Bratu equation for μ = 2.0

The singular BVP of nonlinear Bratu equation (3) is given for this case as: [21]

$$ \left\{ \begin{aligned} & u^{\prime \prime } (r) + \frac{1}{r}u^{\prime } (r) + 2{\text{e}}^{u(r)} = 0,\quad 0 \le r \le 1 \\ & u(1) = u^{\prime } (0) = 0 \\ \end{aligned} \right. $$
(17)

The exact solution to the above equation is given as: [21]

$$ u(r) = \ln \left( {\frac{4}{{\left( {1 + r^{2} } \right)^{2} }}} \right) $$
(18)

Equation (17) is solved following the procedure outlined above for the two cases; however, the fitness function ε in this case is formulated as:

$$ \varepsilon = \frac{1}{11}\sum\limits_{{k{\kern 1pt} = 0}}^{10} {\left( {\hat{u}_{k}^{{\prime \prime }} + \frac{1}{r}\hat{u}_{k}^{{\prime }} + 2{\text{e}}^{{\hat{u}_{k} }} } \right)^{2} + \frac{1}{2}\left( {\left( {\hat{u}_{10} } \right)^{2} + \left( {\hat{u}_{0}^{{\prime }} } \right)^{2} } \right)\quad } $$
(19)

Optimal weights for the DE-ANN are learned using the PSO, SQP and PSO-SQP algorithms for one hundred independent runs. One set of weights is tabulated in Appendix Table 12 for the three algorithms. The values of the unsupervised error (19) are 1.8234 × 10−06, 1.8791 × 10−10 and 1.5703 × 10−10, respectively, for the three proposed methods. The solution to equation (17) is approximated using weights in Table 12 for inputs r ∈ (0, 1) with a step size of 0.1, and results are presented in Table 6 along with the reported results. The maximum values of the AE for the proposed PSO, SQP and PSO-SQP algorithms are 3.16 × 10−02, 7.90 × 10−05 and 3.18 × 10−04, respectively, while the reported GA, IPA and GA-IPA methods, these results are 1.19 × 10−01, 5.89 × 10−04 and 2.82 × 10−04, respectively.

Table 6 Comparison of the results for μ = 2.0

The values of MAE and FA as given in expression (19) are also computed for 100 independent runs for the three proposed algorithms, and results shown graphically in Fig. 5. It can be seen that the value of ε achieved lies in the range 10−04–10−06, 10−00–10−12 and 10−08–10−12 for the PSO, SQP and PSO-SQP methods, respectively, while the values of MAE lies in the range 10−04–10−06, 10−00–10−12 and 10−08–10−12, for the three respective algorithms. A few runs of the SQP method diverge in this case also, while both the PSO and PSO-SQP algorithms remain consistently convergent, the hybrid scheme being the most accurate.

Fig. 5
figure 5

The results for 100 independent runs of the algorithms for the Bratu equation for the case μ = 2.0, a, c unarranged values of FA and MAE, respectively, b, d rearranged in ascending order of FA and MAE values, respectively

The accuracy of the PSO, SQP and PSO-SQP solvers is further investigated based on statistical analysis for the 100 independent runs. The results of mean, STD, MIN and MAX values of the AE are given in Table 7 for inputs 0–1 with a step size of 0.2. The reported result for hybrid approach GA-IPA is also given in the table for the same inputs. It is seen that the values of MIN, MAX, mean and STD of the AE are generally lowest for the PSO-SQP hybrid technique. Mean values of the AE for PSO, SQP and PSO-SQP algorithms lie in the range 10−01–10−03, 10−01–10−02 and 10−03–10−06, respectively. The MIN values of the AE for SQP and PSO-SQP methods are better than that of the PSO algorithm. Moreover, the values of statistical parameters of the proposed scheme PSO-SQP match closed with the reported results of GA-IPA.

Table 7 Results of statistical analysis for the Bratu equation for the case μ = 2

5 Comparative analyses of the solvers

In this section, a comparative analysis is presented for the numerical computations carried out in the last section based on values of the MAE, global mean absolute error (GMAE), mean fitness achieved (MFA), convergence rate and computational time taken for each algorithm.

The reliability and effectiveness of the proposed solvers have been analyzed by computing the values of MAE and FA for 100 independent runs of each algorithm. The accuracy and convergence of the results based on values of MAE ≤ 10−03, 10−04, 10−05 and 10−06 are provided in Table 8. Percentage acceptability of the solution û(r) for the three cases: μ = 0.5, 1.0 and 2.0 are also given in the table. It is seen that acceptability of the results based on MAE ≤ 10−04 for the case of μ = 1.0 is >90 % for all the proposed schemes. It is also observed that with increase in the value of the coefficient μ the problem becomes stiffer and the accuracy decreases. Reliable solutions are still provided by SQP and PSO-SQP methods even for the case μ = 2.0, i.e., when μ is close to its critical value; the accuracy of the solution, however, degrades close to the critical value.

Table 8 The accuracy and convergence of the results

The values of the fitness function ε as given in Eqs. (13), (16) and (19) are also calculated for 100 independent runs using weights optimized by the PSO, SQP and PSO-SQP algorithms. Results for the solvers are given in Table 8 based on values of FA or the unsupervised error ε ≤ 10−03, 10−05, 10−07 and 10−09. It is seen that the PSO-SQP algorithm gives consistently better and convergent results as compared to the other techniques. The rate of convergence decreases with increase in the value of the coefficient μ, especially when it is near its critical value.

Two additional performance factors GMAE and MFA are introduced here in order to better compare the results of the proposed solvers:

$$ \left\{ \begin{aligned} &{\text{GMAE}} = \frac{1}{R}\left( {\sum\limits_{j = 1}^{R} {\left( {\frac{1}{p}\left( {\sum\limits_{i = 1}^{P} {|u_{i} - \hat{u}_{i}^{j} } } \right)} \right)} } \right) \\ &{\text{MFA}} = \frac{1}{R}\left( {\sum\limits_{j = 1}^{R} {\varepsilon^{j} } } \right) \\ \end{aligned} \right. $$
(20)

Here P and R are integers, representing the total number of grid points, and the total number of independent runs of the solver, respectively. u i denotes the exact solution of the Bratu equation for the ith input, \( \hat{u}_{i}^{j} \) is the approximate solution for the ith input and the jth independent run, and ɛ j represents the fitness achieved for the jth run of the algorithm. In-depth evaluation of the performance of the algorithms is analyzed by these operators because smaller the values of GMAE and MF obtained by the algorithms mean that consistently accurate and convergent results are determined by the algorithm.

In our experimentation, we have taken 11 inputs or grid point, i.e., P = 11 and 100 independent runs, i.e., R = 100. The values of the GMAE and MFA are computed for the Bratu Problems for μ = 0.5, 1.0 and 2.0 for the three proposed methods. The proposed results are provided in Table 9 along with the values of the respective standard deviations (STD). The reported results of GA, IPA and GA-IPA are also embedded in the same table for both global performance operators. It is evident that results of the PSO-SQP hybrid approach are the best when compared to the PSO and SQP methods. Divergence is observed for a few runs of the SQP technique, and this has a significant impact on values of GMAE and MFA. The solution û(r) by the PSO-SQP hybrid approach matches with the exact solution u(r) with an accuracy of up to 9, 8, and 5 places of decimal for the μ = 0.5, 1.0 and 2.0 cases, respectively. Whereas comparing with the reported results, it is observed that proposed PSO results are consistently better than that of GAs for all three variants of Bratu problem, while the results for both hybrid approaches matched closed and better than other single algorithms used for optimization.

Table 9 The comparative analysis of the results

The computational complexity of the proposed algorithms is examined on the basis of average time taken for their execution, along with the values of STD. We have made the computational time analysis based on 100 independent runs of each solver, and results are given in Table 9 for the mean execution time (MET) and its STD. It is observed that the computational time taken by the PSO-SQP method is a bit longer than that taken by the PSO and SQP techniques, but on the other hand it has an invariable performance advantage in terms of accuracy and reliability. The computational time taken by proposed PSO, SQP and PSO-SQP is relatively less than that of reported results [21] for GA, IPA and GA-IPA, while obtaining the results with almost same level of accuracy and convergence. This analysis is carried out on a Dell Precision 390 Workstation, with Intel(R) Core(TM) 2 CPU 6000@2.40 GHz, 2.00 GB RAM, and running MATLAB version 2011a.

6 Conclusions

The nonlinear 2-dimensional Bratu equation has been solved alternately and effectively using DE-ANNs optimized with PSO, SQP and PSO-SQP algorithms, after the original problem is transformed into an equivalent one-dimensional nonlinear BVP with singularity at origin.

Comparison of the results with exact solutions shows that the PSO-SQP method gives an absolute error in the range 10−07–10−10, 10−07–10−10 and 10−04–10−06 for the cases μ = 0.5, 1.0 and 2.0, respectively. In general the PSO-SQP hybrid scheme gave not only the most accurate from PSO and SQP but also relatively better than that of reported numerical results of GA, IPA and GA-IPAs.

The reliability and effectiveness of the proposed artificial intelligence techniques were validated by a large number of independent runs of the algorithms and their statistical analysis. The PSO-SQP method provided convergence in all independent runs for all three cases.

Comparative analysis of the three proposed algorithms showed that the PSO-SQP technique invariably provided the best mean fitness values and also the minimum value of the global mean absolute error for all problem cases, but it had a slightly longer computational time. The SQP technique provides results with comparative accuracy, but convergence is a problem. The results of the PSO algorithm converge for all problem cases, and the accuracy attained is lower than of the other two approaches.

Comparison of the given solution based on global performance operators shows the results due to PSO is relatively better than GA, while the hybrid approach PSO-SQP achieve same level of accuracy and convergence as GA-IPA but with relatively lower in computational complexity.

Other optimization techniques, such as ant/bee colony optimization, genetic programming, differential evolution can also be applied in order to solve the BVPs for Bratu-type equations; this can be a topic of further research on the subject.