Next Article in Journal
The Limited Validity of the Conformable Euler Finite Difference Method and an Alternate Definition of the Conformable Fractional Derivative to Justify Modification of the Method
Previous Article in Journal
A Hybrid Estimation of Distribution Algorithm for the Quay Crane Scheduling Problem
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Theory of Functional Connections Applied to Linear ODEs Subject to Integral Constraints and Linear Ordinary Integro-Differential Equations

1
Department of Systems and Industrial Engineering, The University of Arizona, 1127 E. James E. Rogers Way, Tucson, AZ 85721, USA
2
School of Aerospace Engineering, Università degli Studi di Roma “La Sapienza”, Via Salaria 851, 00138 Rome, Italy
3
Department of Aerospace Engineering, College of Engineering, Texas A&M University, 401 Joe Routt Blvd., College Station, TX 77843, USA
*
Author to whom correspondence should be addressed.
Math. Comput. Appl. 2021, 26(3), 65; https://doi.org/10.3390/mca26030065
Submission received: 29 August 2021 / Revised: 9 September 2021 / Accepted: 10 September 2021 / Published: 12 September 2021
(This article belongs to the Section Engineering)

Abstract

:
This study shows how the Theory of Functional Connections (TFC) allows us to obtain fast and highly accurate solutions to linear ODEs involving integrals. Integrals can be constraints and/or terms of the differential equations (e.g., ordinary integro-differential equations). This study first summarizes TFC, a mathematical procedure to obtain constrained expressions. These are functionals representing all functions satisfying a set of linear constraints. These functionals contain a free function, g ( x ) , representing the unknown function to optimize. Two numerical approaches are shown to numerically estimate g ( x ) . The first models g ( x ) as a linear combination of a set of basis functions, such as Chebyshev or Legendre orthogonal polynomials, while the second models g ( x ) as a neural network. Meaningful problems are provided. In all numerical problems, the proposed method produces very fast and accurate solutions.

1. Introduction

This paper shows how to solve linear Ordinary Differential Equations (ODEs) and linear Integro-Differential Equations (IDEs) using a new mathematical framework to perform functional interpolation, called Theory of Functional Connections (TFC). TFC derives functionals, called constrained expressions, containing a free function and representing all possible functions satisfying a set of linear constraints [1,2,3,4]. The most important feature of the constrained expressions is: they always satisfy all the constraints no matter what the free function is.
Although it was recently developed (2017), TFC has already found several applications, especially in solving differential equations [5,6,7,8]. The free function can be expressed by any set of linearly independent functions, such as an expansion of orthogonal polynomials (e.g., Chebyshev, Legendre, etc.) or Neural Networks (NN), such as shallow NN with random features, or Deep NNs (DNNs). When the free function is expanded by a set of orthogonal polynomials the method is here identified as “classic TFC”. When shallow NNs with random features are used, the method has been identified as Extreme-TFC (X-TFC) [9], and when DNNs are used the method is called Deep-TFC [10].
The best expansion of the free function depends on the differential equation considered. Usually, for linear/nonlinear ODEs and simple bivariate PDEs, orthogonal polynomials represent the best choice in terms of accuracy. Indeed, orthogonal polynomials are generally the best mathematical tools for approximating and for convergence properties [11,12]. Nevertheless, for multivariate and more complex PDEs, orthogonal polynomials suffer the “curse of dimensionality”. For these problems, NNs represent a better choice as they better tolerate the curse of dimensionality.
In all previous applications, the free function has been expressed as a linear combination of known basis functions and unknown constant coefficients. These coefficients are then estimated by least-squares for linear Differential Equations (DEs) [5] and by nonlinear least-squares for nonlinear DEs [6]. The problems considered in this work will be solved with classic TFC using Chebyshev orthogonal polynomials and X-TFC.
Note that X-TFC and Deep-TFC are also identified as Physics-Informed Neural Networks (PINN) frameworks [9]. PINNs are recently developed machine-learning methods that employ NNs for data-physics-driven regression, data-physics-driven solution of DEs, and data-physics-driven discovery of parameters governing DEs [13]. Since X-TFC and Deep-TFC use NNs as free function, they are considered part of the PINNs family. Thanks to the constrained expression, developed by TFC, both X-TFC and Deep-TFC are more robust and accurate than the standard PINN frameworks as introduced by Raissi et al. [13].
TFC has been developed for univariate and multivariate scenarios [2,7,8] to solve a variety of mathematical problems: a homotopy continuation algorithm for dynamics and control problems [14], domain mapping [15], data-driven parameters discovery applied to epidemiological compartmental models [16], transport theory problems such as radiative transfer [17] and rarefied-gas dynamics [18], nonlinear programming under equality constraints [19], Timoshenko–Ehrenfest beam [20], boundary-value problems in hybrid systems [21], eighth-order boundary value problems [22], and in Support Vector Machine [23]. TFC has been widely used for solving optimal control problems for space application, solved via indirect methods [24]: orbit transfer and propagation [25,26,27,28], energy-optimal in relative motion [29], energy-optimal and fuel-efficient landing on small and large planetary bodies [30,31], the minimum time-energy optimal intercept problem [32].
The aim of this paper is to show how TFC can accommodate integral constraints in linear differential equations and solve linear integro-differential equations, is organized as follows. In Section 2, a summary of the TFC framework is provided, with the explanation of how to derive constrained expressions. In Section 3, the application of TFC to solve ODEs with integral constraints is shown, and some case problems are reported as examples. In Section 4, the TFC framework is used to solve linear integro-differential equations.
In all test problems considered in this article, the results have been obtained using MATLAB R2020a software on an Intel Core i7-9700 CPU PC with 64 GB of RAM. The results’ accuracy is provided in terms of the absolute error. That is,
e r r = | y TFC y true | ,
where y TFC is the TFC approximated solution, and y true is the true analytical solution.
Since the classic TFC uses Chebyshev or Legendre orthogonal polynomials as a basis set, the final Appendix A provides a definition, orthogonality, derivatives, and integral expressions and properties for both Chebyshev and Legendre orthogonal polynomials.

2. Theory of Functional Connections Summary

A mathematical generalization of interpolation, called Theory of Functional Connections, has recently been developed and successfully applied to solve, by least-squares, initial, boundary, and multi-value problems of linear [5] and nonlinear [6] ODEs and PDEs [8,10]. The theory has been developed for univariate [1] and multivariate rectangular domains [2,8].
The generalization of interpolation consists of a mathematical procedure to obtain analytical expressions describing all possible functions subject to n linear constraints. These expressions are functionals that are called constrained expressions. Two formally equivalent approaches [1,8] can be used to derive them. These are,
y ( x , g ( x ) ) = g ( x ) + k = 1 n η k ( x , g ( x ) ) s k ( x ) ,
y ( x , g ( x ) ) = g ( x ) + k = 1 n ϕ k ( x , s ( x ) ) ρ k ( x , g ( x ) ) ,
where n is the number of the linear constraints, g ( x ) is a function that can be freely chosen, η k ( x , g ( x ) ) are functional coefficients, s ( x ) = { s 1 ( x ) , , s n ( x ) } is a set of n user-defined support functions that must be linearly independent (necessary conditions), ϕ k are switching functions, and ρ k ( x , g ( x ) ) are projection functionals.
By imposing the n constraints to Equation (1), the values of the n functional coefficients, η k ( x , g ( x ) ) , are obtained for some set of n user-assigned functions, s k ( x ) . Once the n functional coefficients, η k ( x , g ( x ) ) , are computed, by substituting them back into Equation (1) we obtain the constrained expression. To give an example, using s 1 ( x ) = x and s 2 ( x ) = x 2 , the constrained expression,
f ( x , g ( x ) ) = g ( x ) + x ( 2 x 2 x ) 2 ( x 2 x 1 ) ϕ 1 ( x ) ( f x 1 g x ( x 1 ) ) ρ 1 ( x , g ( x ) ) + x ( x 2 x 1 ) 2 ( x 2 x 1 ) ϕ 2 ( x ) ( f x 2 g x ( x 2 ) ) ρ 2 ( x , g ( x ) ) ,
where the switching functions, ϕ k ( x ) , and projection functionals, ρ k ( x , g ( x ) ) , are identified, always satisfies the two derivative constraints, f x ( x 1 ) = f x 1 and f x ( x 2 ) = f x 2 , no matter what g ( x ) is. In this article, the use of both formulations, provided by Equations (1) and (2), will be shown.
The projection functional, ρ k ( x , g ( x ) ) , projects the free function, g ( x ) , on the k-th constraint. Here is an example of projection functionals associated to a set of constraints,
f ( 3 ) = 9 3 f ( 0 ) f ( 2 ) = 0 f ¨ ( 1 ) = 1 ρ 1 = 9 g ( 3 ) ρ 2 = 3 g ( 0 ) + g ( 2 ) ρ 3 = 1 g ¨ ( 1 ) .
As for the switching functions, ϕ k ( x ) , they are expressed as a linear combination of a set of support functions, s ( x ) . These functions satisfy ϕ k ( x ) = 1 when the k-th constraint is verified and ϕ k ( x ) = 0 when any other constraint is verified. For instance, given the support functions,
s 1 ( x ) = x , s 2 ( x ) = e x , and s 3 ( x ) = sin x ,
the switching functions are computed as ϕ j ( x ) = i = 1 3 α j i s i ( x ) , where the α j i coefficients are computed by inverting the support matrix. For this example,
α 11 α 12 α 13 α 21 α 22 α 23 α 31 α 32 α 33 s 1 ( 3 ) 3 s 1 ( 0 ) s 1 ( 2 ) s ¨ 1 ( 1 ) s 2 ( 3 ) 3 s 2 ( 0 ) s 2 ( 2 ) s ¨ 2 ( 1 ) s 3 ( 3 ) 3 s 3 ( 0 ) s 3 ( 2 ) s ¨ 3 ( 1 ) = 1 0 0 0 1 0 0 0 1 .
Reference [4] presents, in detail, how to derive the TFC constrained expressions using the formalism defined by Equation (2).
Constrained expressions have been used to solve differential equations. This is done by expressing the solution using the TFC constrained expressions from Equation (1) or, equivalently, from Equation (2). These functionals allow us to reduce the whole functions space to only the functions subspace satisfying the constraints. This is particularly important when solving differential equations. In fact, when substituting these functionals into the DE, a new differential equation is obtained in terms of g ( x ) . This new DE is subject to no constraints because the constrained expression fully satisfies the constraints. The unknown free function, g ( x ) , is then expressed as a linear combination of basis functions. In the classic TFC, g ( x ) is a linear combination of orthogonal polynomials. That is,
g ( x , ξ ) = j = 0 m ξ j h j ( x ) = ξ T h ( x ) ,
where m is the number of the basis functions h j ( x ) (orthogonal polynomials). In X-TFC, g ( x , ξ ) is a shallow NN trained with Extreme Learning Machine (ELM) [33],
g ( x , ξ ) = j = 1 L ξ j σ j w j x + b j = ξ T σ ( x ) = ξ T σ 1 ( x ) σ L ( x ) ,
where L is the number of hidden neurons, w j R is the input weights vector connecting the j-th hidden neuron and the input nodes, ξ j R with j = 1 , , L is the j-th output weight connecting the j-th hidden neuron and the output node, and b j is the bias of the j-th hidden neuron, σ j ( · ) are activation functions, and σ = { σ 1 , , σ L } T . According to the ELM algorithm [33], biases and input weights are randomly selected and not tuned during the training, thus they are known hyper-parameters. The activation functions, σ j ( · ) , are also known as they are user selected. Thus, the only unknown NN hyper-parameters to compute are the output weights ξ = ξ 1 , , ξ L T . Therefore, for both classic TFC and X-TFC, the unknown vector, ξ , which actually constitutes the only unknown of our problem, is then estimated numerically, as for instance by least-squares for linear [5] and nonlinear [6] differential equation s.
In general, the independent variable of the DE (for instance, time) is defined in the t [ t 0 , t f ] range, while the selected basis functions may be defined as a different range, x [ x 0 , x f ] (for instance, Chebyshev and Legendre orthogonal polynomials are defined in the x [ 1 , + 1 ] ). Thus, a change of variable is needed. The most simple mapping between these two variables is linear,
x = x 0 + x f x 0 t f t 0 ( t t 0 ) t = t 0 + t f t 0 x f x 0 ( x x 0 ) .
By setting the range ratio, c = x f x 0 t f t 0 , the derivatives in terms of the new variable are
d k f d t k = c k d k f d x k ,
and the derivative constraints can be written as:
d k f d t k t i = f t i ( k ) = c k d k f d x k x i = c k f x i ( k ) .
The change of variable in integrals takes advantage from the fact that the mean value is independent from the independent variable. Therefore,
1 t f t 0 t 0 t f f ( t ) d t = 1 x f x 0 x 0 x f f ( x ) d x c t 0 t f f ( t ) d t = x 0 x f f ( x ) d x .
When expressing the free function as g ( x , ξ ) = ξ T h ( x ) , then, the derivatives of g ( x , ξ ) can be written as:
d k g d x k = ξ T d k h d x k and d k g d x k x i = ξ T d k h d x k x i .
This procedure can be applied to linear differential equations with non-constant coefficients. The final expression obtained is linear in terms of the unknown vector, ξ , and can be written as:
a T ( x ) ξ = b ( x ) .
To solve the problem numerically, this new equation is discretized for a set of N distinct values of x. A different discretization scheme can be used. Usually, the discretization points are either randomly selected or linearly uniformly spaced. When using Chebyshev polynomials the best discretization is to use the zeros of the Chebyshev polynomials, also called Chebyshev points or nodes or, more formally, Chebyshev–Gauss points [12]. They are defined by the cosine distribution,
x k = cos ( 2 k 1 ) π 2 N for k = 1 , , N .
By specifying Equation (6) for these x k values a system of N linear equations is obtained in m (or L) unknowns that is then solved for ξ by least-squares. Several least-squares methods can be used to solve (6). The optimal least-squares method to use for each problem depends on the problem itself and on what TFC technique is used to solve the problem (e.g., in this paper, classic TFC or X-TFC). For instance, for the classic TFC and linear DEs, our analysis identifies the QR decomposition on a scaled coefficient matrix as the best approach minimizing the condition number of the matrix to invert.

3. TFC for ODEs with Integral Constraints

In this section, we show how TFC is applied to solve linear ODEs with integral constraints. After showing how to derive the constrained expression when dealing with a general integral constraint, we will solve a couple of linear ODEs subjects to boundary conditions and integral constraints.
For the first two examples in this section, we will derive the constrained expression by following the formulation of Equation (1). For subsequent examples and problems, however, the second formulation, Equation (2), will be adopted.

3.1. Definite Integral Constraint

Let us consider the integral constraint,
a b f ( x ) d x = I .
The constrained expression has the form,
f ( x , g ( x ) ) = g ( x ) + η 1 s 1 ( x ) ,
where g ( x ) is a free function and s 1 ( x ) is a user-defined support function, and η 1 is a coefficient that is derived by imposing the constraint. By integrating Equation (8) the following equation:
I = a b g ( x ) d x + η 1 a b s 1 ( x ) d x
is obtained, which can be rearranged to obtain the expression for η 1 ,
η 1 = I a b g ( x ) d x a b s 1 ( x ) d x .
Substituting this value into Equation (8), we obtain a constrained expression for f ( x ) , that is, an expression that always satisfies the integral constraint for any expression of g ( x ) ,
f ( x , g ( x ) ) = g ( x ) + s 1 ( x ) a b s 1 ( x ) d x I a b g ( x ) d x .
This function becomes undefined when a b s 1 ( x ) d x = 0 , and thus s 1 ( x ) must be selected to avoid this condition. By simply selecting s 1 ( x ) = 1 Equation (9) becomes,
f ( x , g ( x ) ) = g ( x ) + 1 b a I a b g ( x ) d x .

3.2. Integral and Linear Constraints

In this second example, let us consider the more complex case where, in addition to the integral constraint given in Equation (7), we also consider the additional linear constraints,
α f ( x 0 ) + β f ( x f ) = 1 ,
where α , β , x 0 , and x f are all assigned. A sketch of this example is shown in Figure 1.
The constrained expression has the form,
f ( x , g ( x ) ) = g ( x ) + η 1 s 1 ( x ) + η 2 s 2 ( x ) .
Then, by applying the constraints the system of linear equations,
1 α g 0 β g f I a b g ( x ) d x = α s 1 ( x 0 ) + β s 1 ( x f ) α s 2 ( x 0 ) + β s 2 ( x f ) a b s 1 ( x ) d x a b s 2 ( x ) d x η 1 η 2
is obtained. This system tells us that s 1 ( x ) and s 2 ( x ) functions can be any functions with the exception of those making the matrix singular. The matrix singularity occurs when
α s 1 ( x 0 ) + β s 1 ( x f ) a b s 2 ( x ) d x = α s 2 ( x 0 ) + β s 2 ( x f ) a b s 1 ( x ) d x .
For instance, by selecting s 1 ( x ) = 1 and s 2 ( x ) = x , the previous condition becomes,
( α + β ) ( b + a ) = 2 ( α x 0 + β x f )
which imply that, in order to avoid singularity, the following relationship must be satisfied,
α , β b + a 2 α x 0 b + a 2 β x f 0 .
When this condition is satisfied, the matrix of Equation (11) can be inverted and the coefficients, η 1 and η , can be computed. Then, the constrained expression for this problem is obtained by substituting the expressions found for η 1 and η 2 in Equation (10).

Problem #1

Now, let us consider the following DE to be solved on the t [ 0 , π ] range, with a constraint in the form of an integral over the integration range,
f ¨ + f = 0 subject to : f ( 0 ) = 1 0 π f ( t ) d t = π ,
whose analytical solution is
f = π 2 sin t + cos t .
In this problem, we build the constrained expression according to the formulation of Equation (2), where the projection functionals  ρ k ( x , g ( x ) ) are given by
ρ 1 = 1 g 0 ρ 2 = π 0 π g ( t ) d t .
Given the support functions,
s 1 ( t ) = 1 , and s 2 ( t ) = t ,
the switching functions are computed as ϕ j ( t ) = i = 1 2 α j i s i ( t ) , where the α j i coefficients are computed just by inverting a matrix. For this problem,
α 11 α 12 α 21 α 22 s 1 ( 0 ) 0 π s 1 ( τ ) d τ s 2 ( 0 ) 0 π s 2 ( τ ) d τ = 1 0 0 1 .
Then, the constrained expression can be built as:
f ( t , g ( t ) ) = g ( t ) + ϕ 1 ( t ) ( 1 g 0 ) + ϕ 2 ( t ) π 0 + π g ( τ ) d τ ,
where the switching functions are
ϕ 1 ( t ) = π 2 t π and ϕ 2 ( t ) = 2 t π 2 .
Now, expressing the free function according to g ( t , ξ ) = ξ T h ( x ( t ) ) the terms of the DE become:
f ( x , ξ ) = h ( x ) ϕ 1 ( x ) h 0 ϕ 2 ( x ) 1 c 1 1 h ( x ) d x T ξ + ϕ 1 ( x ) + π ϕ 2 ( x ) f ¨ ( x , ξ ) = c 2 h ¨ ( x ) T ξ ,
where the boundary conditions have been mapped to x [ x 0 , x f ] . For classic TFC x [ 1 , + 1 ] , and for X-TFC x [ 0 , 1 ] according to Equations (3)–(5). The mapping coefficient is c = x f x 0 t f t 0 .
With the function now expressed in terms of ξ the differential equation can now be transformed into a function of ξ ,
c 2 h ¨ ( x ) + h ( x ) ϕ 1 ( x ) h 0 ϕ 2 ( x ) 1 c 1 1 h ( x ) d x T ξ = ϕ 1 ( x ) π ϕ 2 ( x ) .
This equation can then be specified for a discrete values of x. This discretization yields to an over-determined linear system that can be solved by least-squares.
A ξ = b ξ = A T A 1 A T b .
In this example, using n = 100 and m = 20 , the classic TFC was executed with a computational time is of O 10 4 s, the average absolute error on the discretization points is of O 10 16 , the variance of the absolute error on the discretization points is of O 10 16 . For X-TFC, we set the following hyper-parameters n = 100 , L = 100 , Gaussian activation function, input weight and bias were sampled from U [ 10 , + 10 ] . The computational time is of O 10 4 s, the average absolute error on the discretization points is of O 10 16 , the variance of the absolute error on the discretization points is of O 10 16 . Table 1 reports the absolute error with respect to the analytical solutions obtained with classic TFC and X-TFC on 11 points uniformly distributed in the [ 0 , 1 ] range.

3.3. Mixed Constraints

Consider a function subject to a value-level, relative, and integral constraint,
f ( t 1 ) = f 1 , f ( t 0 ) = f ( t f ) , and 1 t f t 0 t 0 t f f ( τ ) d τ = I .
By using Equation (2), the constrained expression has the form,
f ( t , g ( t ) ) = g ( t ) + ϕ 1 ( t ) ρ 1 ( t , g ( t ) ) + ϕ 2 ( t ) ρ 2 ( t , g ( t ) ) + ϕ 3 ( t ) ρ 3 ( t , g ( t ) )
where the projection functionals, ρ k ( t , g ( t ) ) , are given by
ρ 1 = f 1 g ( t 1 ) ρ 2 = g ( t f ) f ( t 0 ) ρ 3 = I 1 t f t 0 t 0 t f g ( τ ) d τ .
Given the support functions,
s 1 ( t ) = 1 , s 2 ( t ) = t , and s 3 ( t ) = t 2
the α j i coefficients of the switching functions, ϕ j ( t ) = i = 1 3 α j i s i ( t ) , are computed by inverting the support matrix. Specifically,
α 11 α 12 α 13 α 21 α 22 α 23 α 31 α 32 α 33 s 1 ( t 1 ) s 1 ( t 0 ) s 1 ( t f ) 1 t f t 0 π + π s 1 ( τ ) d τ s 2 ( t 1 ) s 2 ( t 0 ) s 2 ( t f ) 1 t f t 0 π + π s 2 ( τ ) d τ s 3 ( t 1 ) s 3 ( t 0 ) s 3 ( t f ) 1 t f t 0 π + π s 3 ( τ ) d τ = 1 0 0 0 1 0 0 0 1 .
Once the ϕ j ( t ) are known, the constrained expression can be obtained as:
f ( t , g ( t ) ) = g ( t ) + ϕ 1 ( t ) f 1 g ( t 1 ) + ϕ 2 ( t ) f ( t f ) g ( t 0 ) + + ϕ 3 ( t ) I 1 t f t 0 t 0 t f g ( τ ) d τ .

Problem #2

As an ultimate “stress-test” of the TFC method, a mixed-constraint case is considered where point, relative, and integral constraints are used in the solution of a differential equation, on the range t [ π , π ]
y + sin t y ¨ + ( 1 t ) y ˙ + t y = f ( t ) subject to : y ( t 0 ) = 0 y ( t f ) = y ( t 0 ) π + π y ( τ ) d τ = 2 π
where the forcing term is
f ( t ) = ( t 1 ) sin 2 t + ( 2 + 2 t t 2 2 cos t ) sin t + t ( t 1 ) cos t .
This problem admits the analytical solution,
y = ( 1 t ) sin t .
Following the procedure explained, the constrained expression for this problem is,
y ( t , g ( t ) ) = g ( t ) + ϕ 1 ( t ) ( g 0 ) + ϕ 2 ( t ) ( g f ) + ϕ 3 ( t ) 2 π π + π g ( τ ) d τ ,
where the α j i coefficients of the switching functions ϕ j ( t ) = i = 1 3 α j i s i ( t ) are computed by solving the following system:
α 11 α 12 α 13 α 21 α 22 α 23 α 31 α 32 α 33 s 1 ( t 0 ) s 1 ( t f ) π + π s 1 ( τ ) d τ s 2 ( t 0 ) s 2 ( t f ) π + π s 2 ( τ ) d τ s 3 ( t 0 ) s 3 ( t f ) π + π s 3 ( τ ) d τ = 1 0 0 0 1 0 0 0 1 .
Now, expressing the free function according to g ( t ) = ξ T h ( x ( t ) ) and rearranging terms leads us to the final constrained expression,
y ( x , ξ ) = h ( x ) ϕ 1 ( x ) h 0 ϕ 2 ( x ) h f ϕ 3 ( x ) 1 c x 0 x f h ( x ) d x T ξ 2 π ϕ 3 ( x ) ,
and by substituting this constrained expression into the differential equation (by evaluating its derivatives accordingly), we obtain a linear system that can be solved by least-squares using Equation (12).
Even in this case, the differential equation and boundary conditions must be mapped onto x [ x 0 , x f ] . For classic TFC x [ 1 , + 1 ] , and for X-TFC x [ 0 , 1 ] according to Equation (3), where the mapping coefficient is c = x f x 0 t f t 0 .
For classic TFC we set n = 35 and m = 30 . The computational time is of O 10 4 s, the average absolute error on the discretization points is of O 10 15 , the variance of the absolute error on the discretization points is of O 10 30 . For X-TFC we set the following hyper-parameters n = 40 , L = 40 , sinusoidal activation function, input weight and bias were sampled from U [ 20 , + 20 ] . The computational time is of O 10 4 s, the average absolute error on the discretization points is of O 10 15 , the variance of the absolute error on the discretization points is of O 10 30 .

3.4. Discussions

The results from these two problems emphasize the utility and convenience of using TFC. Once the constrained expression is defined, the method to solving the differential equation does not change regardless of the use of different constraints. Moreover, this makes the solution accuracy only dependent on the problem complexity. Finally, once the solution is computed (on the discretization points), we have an analytical representation of it. That is, no further manipulations are needed (e.g., interpolation) if we want to evaluate the solutions in points that are different from the discretization points. Indeed, as shown in the results of both problems we do not lose any accuracy when evaluating the solution on test points, as it would happen with some other state-of-the-art methods such as the Finite Element Method (FEM) [34].

4. TFC for Linear Ordinary Integro-Differential Equation

In this section we show how TFC is applied to solve linear ordinary Integro-Differential Equations (IDEs) using all constrained expressions derived from the formalism of Equation (1).
As first test problem, the linear Fredholm integro-differential equations is considered. Comparisons of the numerical results obtained with TFC, X-TFC, and the method published in Ref. [35] are presented.

4.1. Problem #1

Consider the following integro-differential equation:
y ˙ ( x ) = 1 1 3 x + x 0 1 τ y ( τ ) d τ
with one constraint y ( 0 ) = 0 , for x [ 0 , 1 ] . The analytical solution is y ( x ) = x . The constrained expression for this problem is simply
y ( x , ξ ) = h ( x ) h 0 T ξ ,
where h 0 is the vector of the basis function computed at x = 0 .
For classic TFC n = 100 discrete points and m = 29 basis functions were used. The computational time is of O 10 4 s, the average absolute error on the discretization points is of O 10 5 , and the variance of the absolute error on the discretization points is of O 10 9 . For X-TFC the hyper-parameters were set to n = 20 , L = 20 , the activation function was sinusoidal, and the input weight and bias were sampled from U [ 1 , + 1 ] . The computational time obtained was of O 10 4 s, the average absolute error on the discretization points of O 10 4 , the variance of the absolute error on the discretization points of O 10 8 . The absolute errors obtained with classic TFC and X-TFC on 10 test points are reported in Figure 2 and compared with those reported by Ref. [35].

4.2. Problem #2

The second test problem is on the following integro-differential equation:
y ˙ ( x ) = x e x + e x x + x 0 1 y ( τ ) d τ ,
with one constraint y ( 0 ) = 0 , for x [ 0 , 1 ] . The analytical solution is y ( x ) = x e x . Also for this this problem the constrained expression is
y ( x , ξ ) = ( h ( x ) h 0 ) T ξ .
For classic TFC n = 25 discretization points and m = 14 basis functions were adopted. The computational time obtained is of O 10 4 s, the average absolute error on the discretization points is of O 10 16 , and the variance of the absolute error on the discretization points is of O 10 32 . For X-TFC the hyper-parameters were set to n = 50 , L = 50 , the activation function was the hyperbolic tangent, and the input weight and bias were sampled from U [ 1 , + 1 ] . The computational time is of O 10 4 s, the average absolute error on the discretization points is of O 10 14 , and the variance of the absolute error on the discretization points is of O 10 27 . The absolute errors on the test points obtained with classic TFC and X-TFC, are reported in Figure 3 and compared with those reported by Ref. [35].

4.3. Problem #3

The last test problem is a second-order integro-differential equation,
y ¨ ( x ) = e x x + x 0 1 τ y ( τ ) d τ ,
subject to the initial value problem, y ( 0 ) = 1 and y ˙ ( 0 ) = 1 , where x [ 0 , 1 ] . The analytical solution is y ( x ) = e x . The constrained expression for this problem is:
y ( x , ξ ) = h ( x ) h 0 x h ˙ 0 T ξ + x + 1 .
To solve this problem, the classic TFC required n = 9000 points and m = 1000 basis functions. The computational time was of O 1 second, the average absolute error on the discretization points was of O 10 5 , and the variance of the absolute error on the discretization points was of O 10 10 . For X-TFC the setting was n = 90 and L = 94 hyper-parameters, hyperbolic sine activation function, and input weight and bias were sampled from U [ 1 , + 1 ] . The computational time was of O 10 4 s, the average absolute error on the discretization points of O 10 4 , and the variance of the absolute error on the discretization points of O 10 7 . The absolute errors on the test points obtained with classic TFC and X-TFC, are reported in Figure 4 and compared with those reported by Ref. [35].

4.4. Discussions

The discussions made for the linear ODE subjects to integral constraints are also valid for linear ordinary integro-differential equations. Nevertheless, the attentive reader will notice that there is a significant difference in terms of accuracy among problems 1 and 3 compared to problem 2. This is due to the fact that the kernels in the integral terms of the equations are different than one for problems 1 and 3 (e.g., for the both problems the kernel is t). This can have a negative impact on the solution accuracy as the function to be integrated can become very complex, and this can lead to numerical issues. For instance, when classic TFC is used in problems 1 and 3, where the kernel is simply t, the coefficients in front of the integrated polynomials become enormous as the number of basis functions (e.g., the degree of the Chebyshev polynomials) reaches above ten, causing numerical issues that impact negatively on the accuracy. Moreover, in many real world applications, such as in radiative transfer equation [17,36], the kernel can be very complex, making the analytical evaluation of the integral prohibitive.
The are several ways of mitigating these issues that are worth exploring. For instance, the integral could be evaluated with a Gauss-quadrature scheme or with a Monte Carlo method. The authors of this manuscript are investigating the possibility of evaluating the integral numerically using NNs. However, the investigation of different ways to overcome these limitations is not the focus of this work, and it will be explored by the authors in future papers.

5. Conclusions

This study presents an extension of the least-squares solution of linear differential equations studied in an earlier publication [5]. This paper aims to explore solutions using different boundary constraints including multi-valued, relative, and integral constraints for linear ordinary differential equations and for linear ordinary integro-differential equations. In all problems, a constrained expression is used to embed the constraints. This allows the integration range to be independent from the constraints location. In these expressions, the free function g ( x ) was expressed as a linear combination of known basis functions and unknown constant coefficients ξ , either using Chebyshev polynomials, or shallow NNs for the X-TFC framework. Expressing g ( x ) as a linear combination of basis functions and constant coefficients, the coefficient vector ξ remains linear and is solved by using a least-squares method. While this paper only solves linear differential equations as a test case, the proposed methodology can easily be extended to nonlinear differential equations by replacing the least-squares method with a nonlinear least-squares technique as introduced in prior research [6].
For all cases explored, the classic TFC and X-TFC methods consistently produce very fast and accurate solutions. Additionally, for all problems, the constraints are analytically satisfied since they are integrated into the constrained expression. In general, this means that the TFC methods decouple the constraints from the solution of the differential equation. Due to this, the solution range of the differential equation and, where the constraints are specified, is independent. This fact makes the TFC method a unified framework to solve differential equations with no more distinctions between the initial and boundary values problems, as well as any other constraints distribution problem.

Author Contributions

Conceptualization, D.M.; methodology, D.M., M.D.F., E.S. and A.D.; software, M.D.F., E.S., A.D. and D.M.; validation, M.D.F., E.S. and D.M.; formal analysis, D.M., M.D.F. and E.S.; writing—original draft preparation, D.M., M.D.F., E.S. and A.D.; writing—review and editing, D.M., E.S. and M.D.F.; supervision, R.F. and D.M. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Acknowledgments

The authors acknowledge Hunter Johnston for the initial investigation on integral constraints using the Theory of Functional Connections.

Conflicts of Interest

The author declares no conflict of interest.

Appendix A. Chebyshev and Legendre Orthogonal Polynomials

This appendix provides compact summaries of Chebyshev, T k ( x ) , and Legendre, L k ( x ) , orthogonal polynomials, which are defined in the x ß [ 1 , + 1 ] range. These are:

Appendix A.1. Definition

Starting with T 0 = L 0 = 1 and T 1 = L 1 = x these orthogonal polynomials can be conveniently defined recursively,
T k + 1 = 2 x T k T k 1 and L k + 1 = 2 k + 1 k + 1 x L k k k + 1 L k 1
and, specifically ( k ),
T k ( 1 ) = L k ( 1 ) = ( 1 ) k and T k ( + 1 ) = L k ( + 1 ) = 1 .

Appendix A.2. Orthogonality

The orthogonality is provided by the following integrals,
1 + 1 T i ( x ) T j ( x ) d x 1 x 2 = 0 if i j π if i = j = 0 π / 2 if i = j 0 1 + 1 L i ( x ) L j ( x ) d x = 2 2 j + 2 δ i j .

Appendix A.3. Derivatives

All derivatives of Chebyshev orthogonal polynomials can also be computed recursively. Starting from,
d T 0 d z = 0 , d T 1 d z = 1 , and d d T 0 d z d = d d T 1 d z d = 0 ( d > 1 ) ,
the subsequent derivatives can be computed by:
d d T k + 1 d z d = 2 d d d 1 T k d z d 1 + z d d T k d z d d d T k 1 d z d ( k 1 , d 1 ) .
The derivatives of Legendre orthogonal polynomials can also be computed recursively. Starting from,
d L 0 d z = 0 , d L 1 d z = 1 , and d d L 0 d z d = d d L 1 d z d = 0 ( d > 1 ) ,
the subsequent derivatives can be computed by,
d d L k + 1 d z d = 2 k + 1 k + 1 d d d 1 L k d z d 1 + z d d L k d z d k k + 1 d d L k 1 d z d ( k 1 , d 1 ) .

Appendix A.4. Integral

  • Chebyshev indefinite.
    1 x T 0 ( z ) d z = x + 1 , 1 x T 1 ( z ) d z = 1 2 x 2 1 , then 1 x T k ( z ) d z = k T k + 1 k 2 1 x T k k 1
  • Chebyshev full range.
    1 + 1 T k ( x ) d x = 0 for k odd ( 1 ) k + 1 1 k 2 for k even
  • Chebyshev internal range ( 1 a < b + 1 )
    a b T k ( x ) d x = k T k + 1 ( b ) T k + 1 ( a ) k 2 1 b T k ( b ) a T k ( a ) k 1
  • Legendre indefinite.
    1 x L 0 ( z ) d z = x + 1 , 1 x L 1 ( z ) d z = 1 2 x 2 1 , then 1 x L k ( z ) d z = L k + 1 ( x ) L k 1 ( x ) 2 k + 1
  • Legendre full range.
    1 + 1 L 0 ( x ) d x = 2 and 1 + 1 L k ( x ) d x = 0 , k 0 .
  • Legendre internal range ( 1 a < b + 1 )
    a b L k ( x ) d x = L k + 1 ( b ) L k + 1 ( a ) + L k 1 ( a ) L k 1 ( b ) 2 k + 1 .

References

  1. Mortari, D. The theory of connections: Connecting points. Mathematics 2017, 5, 57. [Google Scholar] [CrossRef] [Green Version]
  2. Mortari, D.; Leake, C. The multivariate theory of connections. Mathematics 2019, 7, 296. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  3. Johnston, H.R. The Theory of Functional Connections: A Journey from Theory to Application. Ph.D. Thesis, Texas A&M University, College Station, TX, USA, 2021. [Google Scholar]
  4. Leake, C.D. The Multivariate Theory of Functional Connections: An n-dimensional Constraint Embedding Technique Applied to Partial Differential Equations. Ph.D. Thesis, Texas A&M University, College Station, TX, USA, 2021. [Google Scholar]
  5. Mortari, D. Least-squares solution of linear differential equations. Mathematics 2017, 5, 48. [Google Scholar] [CrossRef]
  6. Mortari, D.; Johnston, H.; Smith, L. High accuracy least-squares solutions of nonlinear differential equations. J. Comput. Appl. Math. 2019, 352, 293–307. [Google Scholar] [CrossRef]
  7. Mortari, D.; Furfaro, R. Univariate theory of functional connections applied to component constraints. Math. Comput. Appl. 2021, 26, 9. [Google Scholar]
  8. Leake, C.; Johnston, H.; Mortari, D. The multivariate theory of functional connections: Theory, proofs, and application in partial differential equations. Mathematics 2020, 8, 1303. [Google Scholar] [CrossRef]
  9. Schiassi, E.; Furfaro, R.; Leake, C.; De Florio, M.; Johnston, H.; Mortari, D. Extreme theory of functional connections: A fast physics-informed neural network method for solving ordinary and partial differential equations. Neurocomputing 2021, 457, 334–356. [Google Scholar] [CrossRef]
  10. Leake, C.; Mortari, D. Deep theory of functional connections: A new method for estimating the solutions of partial differential equations. Mach. Learn. Knowl. Extr. 2020, 2, 37–55. [Google Scholar] [CrossRef] [Green Version]
  11. Gil, A.; Segura, J.; Temme, N.M. Numerical Methods for Special Functions; SIAM: Philadelphia, PA, USA, 2007. [Google Scholar]
  12. Lanczos, C. Applied Analysis; Courier Corporation: Chelmsford, MA, USA, 1988. [Google Scholar]
  13. Raissi, M.; Perdikaris, P.; Karniadakis, G.E. Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations. J. Comput. Phys. 2019, 378, 686–707. [Google Scholar] [CrossRef]
  14. Wang, Y.; Topputo, F. A TFC-based homotopy continuation algorithm with application to dynamics and control problems. J. Comput. Appl. Math. 2021, 401, 113777. [Google Scholar] [CrossRef]
  15. Mortari, D.; Arnas, D. Bijective mapping analysis to extend the theory of functional connections to non-rectangular 2-dimensional domains. Mathematics 2020, 8, 1593. [Google Scholar] [CrossRef]
  16. Schiassi, E.; De Florio, M.; D’Ambrosio, A.; Mortari, D.; Furfaro, R. Physics-informed neural networks and functional interpolation for data-driven parameters discovery of epidemiological compartmental models. Mathematics 2021, 9, 2069. [Google Scholar] [CrossRef]
  17. De Florio, M.; Schiassi, E.; Furfaro, R.; Ganapol, B.D.; Mostacci, D. Solutions of Chandrasekhar’s basic problem in radiative transfer via theory of functional connections. J. Quant. Spectrosc. Radiat. Transf. 2021, 259, 107384. [Google Scholar] [CrossRef]
  18. De Florio, M.; Schiassi, E.; Ganapol, B.D.; Furfaro, R. Physics-informed neural networks for rarefied-gas dynamics: Thermal creep flow in the Bhatnagar–Gross–Krook approximation. Phys. Fluids 2021, 33, 047110. [Google Scholar] [CrossRef]
  19. Mai, T.; Mortari, D. Theory of functional connections applied to nonlinear programming under equality constraints. arXiv 2019, arXiv:1910.04917. [Google Scholar]
  20. Yassopoulos, C.; Leake, C.; Reddy, J.; Mortari, D. Analysis of Timoshenko–Ehrenfest beam problems using the theory of functional connections. Eng. Anal. Bound. Elem. 2021, 132, 271–280. [Google Scholar] [CrossRef]
  21. Johnston, H.; Mortari, D. Least-squares solutions of boundary-value problems in hybrid systems. J. Comput. Appl. Math. 2021, 393, 113524. [Google Scholar] [CrossRef]
  22. Johnston, H.; Leake, C.; Mortari, D. Least-squares solutions of eighth-order boundary value problems using the theory of functional connections. Mathematics 2020, 8, 397. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  23. Leake, C.; Johnston, H.; Smith, L.; Mortari, D. Analytically embedding differential equation constraints into least squares support vector machines using the theory of functional connections. Mach. Learn. Knowl. Extr. 2019, 1, 1058–1083. [Google Scholar] [CrossRef] [Green Version]
  24. Rao, A.V. A survey of numerical methods for optimal control. Adv. Astronaut. Sci. 2009, 135, 497–528. [Google Scholar]
  25. De Almeida Junior, A.K.; Johnston, H.; Leake, C.; Mortari, D. Fast 2-impulse non-Keplerian orbit transfer using the theory of functional connections. Eur. Phys. J. Plus 2021, 136, 1–21. [Google Scholar] [CrossRef]
  26. Schiassi, E.; D’Ambrosio, A.; Johnston, H.; De Florio, M.; Drozd, K.; Furfaro, R.; Curti, F.; Mortari, D. Physics-informed extreme theory of functional connections applied to optimal orbit transfer. In Proceedings of the AAS/AIAA Astrodynamics Specialist Conference, Lake Tahoe, CA, USA, 9–13 August 2020; pp. 9–13. [Google Scholar]
  27. Johnston, H.; Mortari, D. Orbit propagation via the theory of functional connections. In Proceedings of the 2019 AAS/AIAA Astrodynamics Specialist Conference, Portland, ME, USA, 11–15 August 2019. [Google Scholar]
  28. De Almeida Junior, A.; Johnston, H.; Leake, C.; Mortari, D. Evaluation of transfer costs in the earth-moon system using the theory of functional connections. In Proceedings of the AAS/AIAA Astrodynamics Specialist Conference, Lake Tahoe, CA, USA, 9–13 August 2020. [Google Scholar]
  29. Drozd, K.; Furfaro, R.; Schiassi, E.; Johnston, H.; Mortari, D. Energy-optimal trajectory problems in relative motion solved via Theory of Functional Connections. Acta Astronaut. 2021, 182, 361–382. [Google Scholar] [CrossRef]
  30. Schiassi, E.; D’Ambrosio, A.; Johnston, H.; Furfaro, R.; Curti, F.; Mortari, D. Complete energy optimal landing on small and large planetary bodies via theory of functional connections. In Proceedings of the AAS/AIAA Astrodynamics Specialist Conference, Lake Tahoe, CA, USA, 9–13 August 2020; pp. 20–557. [Google Scholar]
  31. Johnston, H.; Schiassi, E.; Furfaro, R.; Mortari, D. Fuel-efficient powered descent guidance on large planetary bodies via theory of functional connections. J. Astronaut. Sci. 2020, 67, 1521–1552. [Google Scholar] [CrossRef] [PubMed]
  32. D’Ambrosio, A.; Schiassi, E.; Curti, F.; Furfaro, R. Pontryagin neural networks with functional interpolation for optimal intercept problems. Mathematics 2021, 9, 996. [Google Scholar] [CrossRef]
  33. Huang, G.B.; Zhu, Q.Y.; Siew, C.K. Extreme learning machine: Theory and applications. Neurocomputing 2006, 70, 489–501. [Google Scholar] [CrossRef]
  34. Lagaris, I.E.; Likas, A.; Fotiadis, D.I. Artificial neural networks for solving ordinary and partial differential equations. IEEE Trans. Neural Netw. 1998, 9, 987–1000. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  35. Darania, P.; Ebadian, A. A method for the numerical solution of the integro-differential equations. Appl. Math. Comput. 2007, 188, 657–668. [Google Scholar] [CrossRef]
  36. Mishra, S.; Molinaro, R. Physics informed neural networks for simulating radiative transfer. J. Quant. Spectrosc. Radiat. Transf. 2021, 270, 107705. [Google Scholar] [CrossRef]
Figure 1. Integral and linear constraints example.
Figure 1. Integral and linear constraints example.
Mca 26 00065 g001
Figure 2. Absolute error on test points for problem #1.
Figure 2. Absolute error on test points for problem #1.
Mca 26 00065 g002
Figure 3. Absolute error on test points for problem #2.
Figure 3. Absolute error on test points for problem #2.
Mca 26 00065 g003
Figure 4. Absolute error on test points for problem #3.
Figure 4. Absolute error on test points for problem #3.
Mca 26 00065 g004
Table 1. Absolute errors on uniform test points for problem #1.
Table 1. Absolute errors on uniform test points for problem #1.
t / π TFCX-TFC
0.00.00.0
0.10.0 2.22 × 10 16
0.20.0 2.22 × 10 16
0.30.0 0.0
0.40.0 0.0
0.50.0 0.0
0.6 4.44 × 10 16 4.44 × 10 16
0.7 1.11 × 10 16 2.22 × 10 16
0.8 6.66 × 10 16 0.0
0.9 1.66 × 10 16 2.77 × 10 16
1.0 2.22 × 10 16 6.66 × 10 16
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

De Florio, M.; Schiassi, E.; D’Ambrosio, A.; Mortari, D.; Furfaro, R. Theory of Functional Connections Applied to Linear ODEs Subject to Integral Constraints and Linear Ordinary Integro-Differential Equations. Math. Comput. Appl. 2021, 26, 65. https://doi.org/10.3390/mca26030065

AMA Style

De Florio M, Schiassi E, D’Ambrosio A, Mortari D, Furfaro R. Theory of Functional Connections Applied to Linear ODEs Subject to Integral Constraints and Linear Ordinary Integro-Differential Equations. Mathematical and Computational Applications. 2021; 26(3):65. https://doi.org/10.3390/mca26030065

Chicago/Turabian Style

De Florio, Mario, Enrico Schiassi, Andrea D’Ambrosio, Daniele Mortari, and Roberto Furfaro. 2021. "Theory of Functional Connections Applied to Linear ODEs Subject to Integral Constraints and Linear Ordinary Integro-Differential Equations" Mathematical and Computational Applications 26, no. 3: 65. https://doi.org/10.3390/mca26030065

Article Metrics

Back to TopTop