# Neural Network Method for Solving Time-Fractional Telegraph Equation

Authors: Wubshet Ibrahim; Lelisa Kebena Bijiga
Journal: Mathematical Problems in Engineering
 (2021)

---

## Abstract

Recently, the development of neural network method for solving differential equations has made a remarkable progress for solving fractional differential equations. In this paper, a neural network method is employed to solve time-fractional telegraph equation. The loss function containing initial/boundary conditions with adjustable parameters (weights and biases) is constructed. Also, in this paper, a time-fractional telegraph equation was formulated as an optimization problem. Numerical examples with known analytic solutions including numerical results, their graphs, weights, and biases were also discussed to confirm the accuracy of the method used. Also, the graphical and tabular results were analyzed thoroughly. The mean square errors for different choices of neurons and epochs have been presented in tables along with graphical presentations.


---

## Body

## 1. Introduction

Fractional differential equations can be used to model many real-life problems. Recently, fractional partial differential equations have received much attention of the researchers due to their wide applications in the area of biological sciences and medicine [1–3]. Moreover, the study conducted in [4, 5] has emphasized on the property of the solution of fractional differential equations like its stability and existence. Particularly, fractional telegraph equations arise in many science and engineering fields such as signal analysis, random walks, wave propagation, electrical transmission line, and so on [6, 7], but they are hard to solve. Accordingly, many methods have been utilized to find solutions of fractional differential equations, for instance, spectral methods [8–10], finite-element method [11, 12], differential transform method [13], and other methods [14, 15]. Moreover, Hosseini et al. [16] had discussed fractional telegraph equation using radial basis function approach. Furthermore, Zhang and Meerschaert and Tadjeran [17, 18] employed a finite-difference approach for a solution of fractional partial differential equation. Recently, solving fractional differential equations by the neural network method has become an active research area.A neural network is a type of machine learning algorithm which has amazing ability to solve large-scale problems. It is based on the idea of minimizing the loss function that best approximates the solution to mathematical problems. Nowadays, neural networks are becoming the best solution method to most challenging mathematical problems. The continuously rising success of neural network techniques applied to differential equations (ODEs and PDEs) [19, 20] has stimulated research in solving fractional differential equations with the neural network method. Here, this study focuses on solving fractional telegraph equation with the neural network method. As neural network technology is rising rapidly both in terms of methodological and algorithmic developments, we believe that this is a timely contribution that can benefit researchers across a wide range of scientific domains.Lagaris et al. [21] solved both ordinary and partial differential equations with neural network approaches. The trial solutions have been given which are fixed to satisfy the boundary conditions. Later on, Piscopo et al. [22] have extended this trial solution by adding the boundary conditions into a loss function. This paper extends this idea to solving time-fractional telegraph equation. To the researchers’ knowledge, there has been a little study on solving fractional partial differential equations with the neural network approach. In [23], fractional diffusion equation with Legendre’s polynomial-based neural network algorithm has been discussed. Pang et al. [24] proposed fractional physics informed neural networks to solve fractional differential equations. The main contribution of this paper is to discuss the artificial neural network algorithm for solving time-fractional telegraph equations. In this paper, we consider a time-fractional telegraph equation [25]:(1)Dt2αCux,t+DtαCux,t=kuxxx,t+fx,t,ux,0=ϕ1x,utx,0=ϕ2x,u0,t+λ1ux0,t=μ1t,uL,t+λ2uxL,t=μ2t,0<t≤T,0<x<L,12<α≤1.The rest of this paper is organized as follows. InSection 2, a short review of fractional calculus is presented. In Section 3, the algorithms for solving equation (1) are given. In Section 4, numerical examples are solved to illustrate the effectiveness of the neural network method. Section 5 gives the conclusion.


## 2. Preliminaries

Definition 1 (see [26]).
The functionΓ:0,∞⟶ℝ, defined by(2)Γx≔∫0∞t1−xe−tdt,is called Euler’s gamma function (Euler’s integral of the second kind).Definition 2 (see [27]).
Let1≤p.(3)Lpa,b≔f:a,b⟶ℝ;fis measurable ona,band∫abfxpdx<∞,L∞a,b≔f:a,b⟶ℝ;fis measurable and essentially bounded ona,b.In other words,Lpa,b is (for 1≤p≤∞) the usual Lebesgue space.Definition 3 (see [27]).
Letux∈L1a,b, and the left-sided and right-sided Riemann–Liouville fractional integrals of order α>0 for a function ux on a,b are defined as(4)Ia+αux≔1Γα∫axx−tα−1utdt,Ib−αux≔1Γα∫xbt−xα−1utdt,respectively. Here Γ⋅ denotes Euler’s gamma function.Definition 4 (see [27]).
The left-sided and right-sided Riemann–Liouville fractional derivatives of orderα>0, for a function ux on a,b, are defined by(5)Da+αux≔ddxnIa+n−αux=1Γn−αddxn∫axx−tn−α−1utdt,Db−αux≔ddxnIb−n−αux=1Γn−αddxn∫xbt−xn−α−1utdt,respectively, where n=⌈α⌉+1 and a<x<b.Definition 5 (see [26]).
The Caputo fractional derivativeDtαCut of order α of a function ut on 0,T is defined by(6)DtαCut=I0+n−αddtnut=1Γn−α∫0tt−sn−α−1unsds,n−1<α<n,ddtnut,n=α.
In particular, when0<α<1, we have(7)DtαCut=1Γ1−α∫0tt−s−αu′sds.Definition 6 (see [24]).
Grünwald–Letnikov finite-difference schemes: based on the stationary grid xj=j−1Δx, for j=1,2,…,N, the shifted GL finite-difference operator for approximating the 1D fractional Laplacian is defined as(8)−Δα/2uxj≈δΔx,pαuxj≔Δx−α∑k=0j−1kαkuxj−k−pΔx+Δx−α∑k=0N−j−1kαkuxj−k−pΔx,where p step size (s) is shifted to guarantee the stability of the schemes.With the notationβ=1−α/2, the first-order, second-order, and third-order GL formulas for approximating the 1D fractional Laplacian are as follows [28]:(9)−Δα/2uxj=δΔx,1αuxj+OΔx,−Δα/2uxj=1−βδΔx,1αuxj+βδΔx,0αuxj+OΔx2,−Δα/2uxj=11−6β1−β12δΔx,1αuxj+−6β2+11β+16δΔx,0αuxj+6β+1β−112δΔx,−1αuxj+OΔx3.


## 3. Solution Method

We constructed an artificial neural network (NN) with one hidden layer andn neurons which is shown in Figure 1. The output of the network, u^x,t, is written as(10)u^x,t=∑kgx∗wkx+t∗wkt+bkh∗wkh+b1f,where g:ℝn⟶ℝn is the activation function, w=wkx,wkt,wkh and b=bkh,b1f, k=1,2,…,n are the weights and biases of the network, and a symbol “∗∗” represents normal scalar multiplication, respectively. h and f denote hidden and final layers, respectively. Initially, we randomly generated the weights and biases of the network and then we adjusted them in the training processes to minimize the loss function. In short, we find the weights and biases of the neural network that best approximates the solution, ux,t, of problem equation (1).Figure 1
One hidden layer neural network for solving equation (1).Equation (1) can be written as(11)Dt2αCux,t+DtαCux,t−kuxxx,t−fx,t=0,ux,0−ϕ1x=0,utx,0−ϕ2x=0,u0,t+λ1ux0,t−μ1t=0,uL,t+λ2uxL,t−μ2t=0,0<t≤T,0<x<L,12<α≤1.A numerical solutionu^x,t to problem (1) is the one which approximately reduces the sum of the mean square of the left-hand side of equation (11), which is similar to the mean square error (MSE) loss function of a neural network. In references [21, 22], the trial solution to ordinary and partial differential equations was presented. Now, we have constructed the trial solution, u^x,t, for fractional telegraph equation which is the output of the neural network.If we discretize the domain of the inputs,x,t∈0,1×0,1, into a finite number of training points, say m, which is chosen from equally spaced Nm×Nm grid, then u^x,t can be obtained by determining the weights and biases that minimize the loss function of the network on the training points.Let(12)φx,t=Dt2αCux,t+DtαCux,t−kuxxx,t−fx,t.The following loss function is used:(13)ξw,b,x,t=1m∑iφxi,ti2+1Nm∑uxi,0−ϕ1xi2+1Nm∑utxi,0−ϕ2xi2+1Nm∑u0,ti+λ1ux0,ti−μ1ti2+1Nm∑uL,ti+λ2uxL,ti−μ2ti2.The problem is then reduced to minimizingξw,b,x,t by adjusting the weights and biases in the network, for the given choice of hyperparameters (number of neurons, number of hidden layers, learning rate, momentum, and activation function), i.e.,(14)minw,bξw,b,x,t.To compute the error, we need to calculate the derivatives of the network output,u^x,t, with respect to its input. Lagaris et al. [21] have presented how to obtain the automatic differentiation of partial derivatives. To obtain the fractional derivatives, the Grünwald–Letnikov (GL) method given in [28–30] is used. Then, a simple hybrid of the two derivatives is used.The optimization can then made via backpropagation by the gradient descent method to find the weights and biases of the network by calculating the gradient of the loss function. The algorithm is implemented in Python 3 all examples were done on Google Colab connected to “Google Compute Engine Backend (GPU),” RAM: 0.80/12.72 GB, Disc: 38.40/68.40 GB).


## 4. Application

In this section, the neural network method for solving time-fractional telegraph equation is tested using examples.Example 1.
Consider the time-fractional telegraph equation [16](15)Dt1+αCux,t+DtαCux,t+ux,t=πuxxx,t+fx,t,0<t≤1,0<x<1,0≤α≤1,ux,0=0,utx,0=0,u0,t=0,u1,t=t3sin12.where fx,t=6sinx2t3−α/Γ4−α+t4−α/Γ5−α+t3/6−2πt3cos2x. The exact solution is ux,t=t3sinx2. The neural network is trained for 10000, 30000, and 50000 epochs, respectively, with the following hyperparameters: learning rate = 0.001, momentum = 0.99, and domain grid Nm×Nm=15×15. The exact and approximated solutions, respectively, are shown in Figure 2, and the network’s weights and biases with α=0.5, neurons = 50, and epochs=5×104 are given below:(16)w_x=0.227099550.484705420.30106887−0.5710319−0.282635450.3730778−0.62165207−0.063251740.6000664−0.58033070.754557670.0209149−0.3475611−0.105257931.13466620.055488330.08919823−1.16223860.8179567−0.1868935−0.12351528−0.294775070.31532037−0.14484051−0.77425826−0.05583666−0.70853186−0.150463310.39233088−0.22020972−0.426098080.32109123−1.08035421.08209860.482317121.1275666−0.174224080.77835166−0.338276−0.48429860.6304897−0.22598706−0.1556276−0.74421215−1.0273035−0.39799082−0.06088707−0.10041072−0.10655779−0.87650526,(17)w_t=−0.85084010.34184146−1.6948189−0.69514495−0.095261170.101459960.675274970.30133040.134603991.253331−0.428570540.056570790.13219093−0.49240350.5570062−0.34572813−0.335851640.139197530.98318714−0.46117327−0.5684453−0.67042255−0.261904570.24914835−0.45094573−0.14183266−0.983921650.41158986−0.6243741−0.46813807−0.31825843−0.663525040.38143885−1.19046370.68411690.18293405−0.016706980.09148049−0.277907−0.125444440.01953477−0.05040276−0.649198830.13167143−0.5969736−0.06241253−0.225301340.34802237−0.46937960.78824145,(18)w_h=−0.27188507−0.39588678−1.3488795−0.11360911−0.491850530.108522740.28967920.220245780.248460040.435636551.40586460.311451260.7254508−0.148805321.1028032−0.205357−0.2936519−0.9101087−0.37215596−0.253808530.26887977−0.07968626−0.116931050.154523790.38469067−0.7722171.83166750.27511346−0.040766890.067234110.06209861−0.39242387−1.1358680.7484505−0.09107573−0.6481716−0.024000280.045166980.11897138−0.46179143−0.6552162−0.05483521−0.02160627−0.097922620.7942127−0.20355819−0.130581680.33987236−0.130590960.66211694,(19)b_h=−0.817806−0.163664391.7479048−0.032899430.5446239−0.77737450.09653217−0.27597392−0.59627736−0.484293550.358293680.733026860.9513404−0.4224985−1.9109377−0.415550680.341911320.78947910.856203−0.6832685−0.89504695−0.96519065−1.01051020.08612484−0.37744412−0.66712581.3613127−0.46127853−0.1396212−1.072931−0.242338880.6321648−0.022847091.35868440.321237830.20076160.335746940.8309613−0.30238890.386185261.01488760.17742322−0.78868747−0.101767670.59882980.00963082−0.00688106−0.4881537−0.544853150.24851702,(20)b_f=0.3600201.Figure 2
The exact and approximate solutions of Example1 for α=0.9 with epoch = 50000.Table1 presents the variations of mean square error of Example 1 with different epochs, neurons, and α. The result indicates that as the values of epochs, neurons, and α increase, the mean square error diminishes. Similarly, the approximate and exact solutions are shown in Figure 3 with values of α=0.7, neurons = 50, and epochs=5×104. Also, Figure 4 shows the scatter plot of error function for the same parameters of α=0.7, neurons = 50, and epochs=5×104.Example 2.
Consider the time-fractional telegraph equation [25](21)Dt2αCut+DtαCut=uxxx,t+fx,t,0<t≤1,0<x<1,12≤α<1,ux,0=sinx+1,utx,0=0,u0,t=sin1t3+1,u1,t+3ux1,t=t3+1sin2+3cos2,where fx,t=6sinx+1t3−2α/Γ4−2α+t3−α/Γ4−α+sinx+1t3+1. The exact solution is ux,t=t3+1sinx+1. The neural network is trained for 50000 epochs, with the following hyperparameters: learning rate = 0.001, momentum = 0.99, and domain grid Nm×Nm=15×15. The approximated solution is shown in Figure 5, and the network’s weights and biases with α=0.5 and neurons = 30 are given below:(22)w_x=0.398326131.03887260.40763474−0.026639390.929637730.87321490.022450520.087689170.32706422−0.46646506−0.07493997−0.14409448−0.30227590.016720590.424789340.7624677−1.28802610.273227190.02753602−0.08018653−0.40032297−0.210764770.060818680.078851410.25435236−1.14956550.9316741−1.9513986−0.7625092−0.6898152,(23)w_t=1.1917269−0.24062987−0.32680830.56428460.477486−0.71872110.026278440.199740990.0064544−0.5323977−0.13844271−1.09505741.5210402−0.183066920.19848405−0.94518507−2.3407142−0.33137983−2.5880466−0.242424821.2827591−0.09771743−1.28638281.0360979−0.137016480.35354376−0.39987222.8061397−0.8332252−1.9516511,(24)w_h=1.32497260.7116116−1.45194051.07811930.90997136−1.00589720.31220737−1.64325141.7020102−0.70553730.18836688−0.750971852.5867120.25445261.0796609−1.54099481.23299−1.11045410.8619889−0.48276564−1.50105512.34425662.3573098−0.67585474−0.745436670.6313507−0.76804924−0.47706455−2.21064−0.7420342,(25)b_h=0.399664430.46180362−0.281702370.30222654−0.46586838−0.4193143−0.173286380.129997390.7433989−1.3253186−0.010926940.7957754−2.553217−0.910442050.27992980.5104434−2.30468230.17728463−0.189141230.0158242−0.11061913−0.268410650.8413445−0.027560480.238039081.841479−1.3463446−3.6403851.4425491−0.7643006,(26)b_f=1.9012741.Table 1
The comparison of mean square error (MSE) of Example1 with different epochs and neurons.
EpochNeuronsα=0.5α=0.7α=0.910000300.0008330.0009700.001802500.0003290.0005040.000229800.0004010.0003230.00028320000300.0004810.0007320.000858500.0001050.0002690.000161800.0001890.0001870.00016950000300.0002570.0003670.000166500.0000340.0001170.000107800.0000900.0000940.000092Figure 3
The exact and approximate solutions of Example1 for α=0.5 with epoch = 50000.Figure 4
The scatter plot of error function for Example1 for α=0.7 and epoch = 50000.Figure 5
The exact and approximate solutions of Example1 for α=0.5 with epoch = 50000.In Figure6, the left graph shows the scatter plot of the error function and the right graph shows the scatter plot of the exact solution. This graph is plotted for 50×50 mesh grid points. The graph reflects that the error between the exact and approximate solutions is exactly similar.Figure 6
The scatter plot of error function for Example1 for α=0.5 and epoch = 50000.


## 5. Conclusion

The novel way to solve time-fractional telegraph equation is proposed. The method extends the existing approach for differential equations (both ODEs and PDEs) [22] to fractional differential equations. This approach is applied to finding time-fractional telegraph equations for which exact solutions are known. Compared to traditional fractional differential equation (FDE) solvers, such as the finite-difference method and spectral method, which can only obtain the approximate solutions on the grid points, the proposed method can approximate the solutions of all points in the interval by training only few sample points. However, a lot of training is needed to get higher accuracy, especially when 1<α<2. This would be interesting work for future direction.



---

*Source: 7167801-2021-05-27.xml*