1. Introduction
The field of fractional differential equations (FDEs) has a long history in mathematics. After 1695, the idea of a fractional derivative (FD) emerged as an essential scholarly elaboration of an integer derivative. The order of differentiating from positive integers (the set of natural numbers) to real sets of numbers or even complex sets of numbers is generated by an FD. A detailed presentation of the old historical steps of fractional calculus can be found in the papers [
1,
2,
3]. Fractional differential equations have recently been the focus of a great deal of research and have been given an important part to play as a result of their appearance in a wide variety of applications and their ability to exactly describe nonlinear processes in physics, control systems, dynamical systems, biomathematics, statistical mechanics, visco-elastic materials, and engineering [
4,
5,
6,
7].
Recently, several issues pertaining to mathematical physics and engineering have been represented through the use of FDEs of distributed order. Research in this field has increased substantially as a result of the broad applications of FDEs. Since most of the FDEs do not have the exact analytic solution, there has been a great amount of interest in developing and investigating numerical methods specifically devised to solve fractional differential equations [
8,
9,
10]. In numerical and computational mathematics, one of the most common topics to discuss is the symmetry in numerical solutions of differential equations of integer order. This has been the case for quite some time. However, despite a large number of recently formulated applied problems, the current state of the art is far less advanced for generalized order equations. Only a few algorithms for the numerical solution of such equations have been suggested, and the majority of these numerical schemes deal with linear single-term equations of the order less than unity [
11,
12,
13,
14]. Therefore, to study the multi-order fractional differential equations, several fundamental works have been conducted by the researchers using different techniques such as the operational matrix of Chebyshev polynomials [
15,
16], pseudo-spectral method [
17,
18], Adomian decomposition method [
19], collocation method [
20], operational matrix of B-spline functions [
21], sinc-collocation method [
22,
23], variational iteration method [
24,
25], the operational matrix of Bernstein [
26], spectral Tau method [
27,
28], operational matrix of Legendre polynomials [
29,
30], differential transform method [
31], and homotopy perturbation method [
32]. J. Singh and D. Kumar [
33,
34,
35] presented a hybridized technique of homotopy perturbation method and Sumudu transform to calculate the analytical solutions for the multi-order fractional modified equal-width equation and fractional equal-width (EW) equations as well as their variants.
Many authors have implemented the fractional-order modeling of various problems in polytropic gas spheres and electric circuits, which are of great importance to the researchers due to their wide range of applications in astrophysics, and electrical engineering, such as galactic dynamics and stellar structure, a spherical cloud of gas, equivalent gas spheres, particle currents, electric motors, and computers, etc. [
36,
37]. Nonlinear fractional Lane–Emden equations generally govern the fractional models of such systems [
38,
39]. The analytical solutions for polytropic models for white dwarf stars, incompressible gas spheres, isothermal gas spheres, and electrical circuits, such as RC, LC, RL, and RLC for super-capacitors, batteries, and energy management have been calculated using series expansion [
40,
41], Adomian decomposition method [
42,
43], and the
-Laplace transform method using left generalized fractional derivative operator [
44,
45]. However, the majority of these procedures provide series expansions in the vicinity of the initial conditions that are utilized [
46]. This is despite the fact that these techniques provide reasonable approximations of the solution. In addition, rounding errors significantly impact the precision of the solutions produced by numerical techniques, which are characterized by a degree of complexity proportional to the number of sample points [
47,
48]. Compared to more conventional numerical approaches, the approximate computation provided by artificial neural networks (ANNs) appears less sensitive to the spatial dimension. The ANN can produce an adaptable mesh; however, it is not necessary to explicitly deal with the mesh; all it must do is solve the optimization problem. On the basis of these facts and benefits, the network technique for the FDEs problems was broadened by Lagaris [
49,
50]. Since then, it has been used in a significant number of approximation problems involving partial and fractional differential equations. Certain efforts are now being made to use a method based on neural networks to successfully solve fractional partial differential equations. Raissia [
51,
52] proposed the use of physics-informed neural networks (PINNs) to solve forward and inverse problems involving nonlinear partial fractional differential equations.
In recent years, artificial neural networks have gained significant attention as reliable and efficient techniques for symmetric function approximations. Some current applications of ANNs with the stochastic and intelligent computational optimization algorithm include the solution for the heat transfer and thermal conductivity of magneto micropolar fluid with the thermal non-equilibrium condition [
53], nonlinear models in ocean engineering during the chaotic behavior of ships [
54], nonlinear oscillatory systems [
55,
56], and the analysis of chaos systems of wireless communication during different bandwidths and filters [
57,
58]. These significant applications inspired the authors to employ ANNs in order to come up with an approximation of the solution to FDEs. To summarize, the use of the appropriate trained ANN approach for the solution of FDEs gives the following preferences in contrast to the traditional numerical schemes:
- •
The process of finding a solution continues without any coordinate transformations.
- •
ANNs with machine learning optimization techniques are capable of analytically solving differential equations.
- •
The increase in the number of sample points does not result in an immediate spike in the computational complexity.
- •
The ANNs are successful techniques for generating differentiable solutions and have proved their effectiveness in resolving the problem of iterative processes. They can handle complex singular and nonlinear differential equations without difficulty.
2. Proposed Neural Network-Based Approach for Solving FDEs
The concept of artificial neural networks (ANNs) was introduced by Warrent McCulloch and Walter Pitts back in 1943. The way organic neurons in an animal’s brain may communicate with one another to carry out sophisticated computations served as a source of motivation for the creators [
59]. The early success of ANN was lost at a relatively early stage, and it has subsequently been left behind in comparison to other machine learning approaches. However, things began to turn around in the 1990s as a result of a significant rise in the amount of available computer power and the vast quantities of data that could be used to train ANNs. ANNs have a wide range of applications in the acceleration of mechanism-based biological models [
60,
61], forecast prediction [
62,
63], and in microwave computer-aided designs [
64].
Preceptors, as shown in
Figure 1a, are the fundamental units and most common architectures of artificial neural networks which have been widely used for various applications. On the other hand, the term multilayer perceptron refers to the structure containing more than one concealed or hidden layer, as shown in
Figure 1b. It is demonstrated in the theory of perceptron in artificial neural networks (ANNs) that these systems are capable of approximating continuous functions. In this section, first, we review an important theorem that discusses the capability of ANNs for the function approximation, and then, our suggested ANN approach for solving FDEs is described.
Definition 1. A Sigmoid function is a mathematical function with a characteristic S-shaped curve and the property to map the entire number line into a small range between 0 and 1. Mathematically, a single variable sigmoidal function is defined as [65] Theorem 1. Let f be the continuous sigmoidal function, then the finite sum of the formis dense in the space of continuous function defined over an interval I. Now, let us consider a fractional differential equation of the form [
66]:
We assume that the approximate solution to Equation (
3) is in the form
, which is defined as:
where
and where
is an activation function (log-Sigmoid),
, and
is a vector containing values of unknown neurons (
) in an ANN architecture. In this work, the ntstool in MATLAB is utilized to construct a least square optimization problem for the differential equation with feedforward deep neural networks consisting of two layers with 60 hidden neurons. The corresponding optimization problem for Equation (
3) is given as:
For a supervised machine learning strategy,
is a dataset that is generated using the reference solution for Equation (
3). Furthermore, the optimization technique of the Levenberg–Marquardt (LM) algorithm is implemented to optimize the weights in Equation (
3). The LM algorithm is the most used technique for optimization in recent times. It outperforms the basic gradient descent and other conjugate gradient techniques. Some recent applications of the LM algorithm include the solution for modeling conventional and a still solar Earth [
67], heat transfer in micropolar fluids, and interference suppression by the element position control of phased arrays [
68]. The detailed working steps of the proposed technique are dictated in
Figure 2.
When training multilayer networks, one strategy that is commonly used is to begin by dividing the data into three distinct portions. The network’s gradient and any updates to the weights and biases are computed using the training set, which is the first subset of the dataset. The validation set is the second subset to be considered here. The error that was seen on the validation set is observed when it is time to train the model. Both the training set error and the validation error often decrease during the first stage of training. On the other hand, as the network starts to “overfit” the data, the error on the validation set will often start to rise. The network weights and biases are preserved when the validation set error is at its lowest. In this work, the target vectors are randomly divided into the three following sets:
70% of the candidate solutions are used for training purposes;
30% of the candidate solutions are equally divided to validate and test the model to prevent overfitting.
4. Conclusions
This study investigates the fractional models of polytropic gas spheres and electric circuits that are of significant importance in various domains of astrophysics and electrical engineering. The fractional models are usually difficult to solve; therefore, in this work, we employed the supervised learning strategy of neural networks in a machine learning environment. The deep neural networks were utilized with the optimization technique, namely the Levenberg–Marquardt algorithm, to study the impact of the fractional parameter on the differential equations of the physical models. The study reveals that the solution of the proposed DNN-LM algorithm is in good agreement with state-of-the-art-techniques such as the multi-step approach of reproducing the kernel method (MS-RKM), Laplace transform method (LTM), and Padé approximation. The approximate solutions by the proposed algorithm overlap with the analytical solutions with minimum absolute errors that approximately lie between and ; and ; and ; and and for different cases of the studied problems.
Extensive graphical and statistical analyses based on regression, training, testing, validation, and computational complexity were conducted to assess the performance of the designed scheme. The outcomes of the performance matrices were close to zero and the regression value is exactly 1 for each case, which demonstrates that the proposed technique successfully achieved the solution to nonlinear fractional differential equations.
The solution, ease of implementation, and accuracy of the machine learning techniques motivated the authors to extend the use of the neural network to the solution to fractional partial differential equations modeling real-world phenomena.