Next Article in Journal
Multi-Weighted Partial Domain Adaptation for Sucker Rod Pump Fault Diagnosis Using Motor Power Data
Previous Article in Journal
Bayes Synthesis of Linear Nonstationary Stochastic Systems by Wavelet Canonical Expansions
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

An Algorithm for Numerical Integration of ODE with Sampled Unknown Functional Factors

by
Y. Villacampa
and
F. J. Navarro-González
*
Department of Applied Mathematics, University of Alicante, 03690 San Vicente del Raspeig, Spain
*
Author to whom correspondence should be addressed.
Mathematics 2022, 10(9), 1516; https://doi.org/10.3390/math10091516
Submission received: 31 March 2022 / Revised: 18 April 2022 / Accepted: 26 April 2022 / Published: 2 May 2022
(This article belongs to the Section Difference and Differential Equations)

Abstract

:
The problem of having ordinary differential equations (ODE) whose coefficients are unknown functions is frequent in several fields. Sometimes, it is possible to obtain samples of the values of these functions in different instants or spatial points. The present paper presents a methodology for the numeric solving of these ODE. There are approximations to the problem for specific cases of equations, especially in the case where the parameters correspond to constants. Other studies focus on the case in which the functions under consideration are linear or meet a certain condition. There are two main advantages of the proposed algorithm. First, it does not impose any condition over the data or the subsequent function from where these sample data are derived. Additionally, the methodology used in the functions modeling can control the possibility of overfitting in the function modeling. This is a crucial point in order to limit the influence of model biases in the numerical solution of the ordinary differential equation under study.

1. Introduction

In the study and modeling of systems, differential equations can be obtained with parameters that depend on observations. That is, they are parameters that can vary throughout the domain of definition and for which experimental data are known. Differential equations can be either ordinary differential equations or partial differential equations. Problems modeled by this type of differential equations are, for example, (see [1,2,3,4,5]): (a) the heat equation with unknown specific heat and heat sources; (b) the diffusion equation of products with non-constant and unknown innovation and imitation coefficients; (c) the study of hydraulic transients; and (d) water flows such as groundwater seepage in anisotropic media. In this sense, it is important to obtain hybrid-modeling methodologies that allow combining parameter estimation methods with algorithms of numerical resolution of differential equations.
When the dynamics of the processes underlying the system under study are known, differential equations can model their behavior, especially in the case of complex dynamic processes. In many cases, these differential equations contain constant parameters or functional dependencies with the independent variable that determine the characteristics of the corresponding solutions. The exact knowledge of its parameters is crucial for predicting the behavior of the solutions. Some concrete examples of the study of the problem considered in specific fields could be, for example, in biology and ecology [6,7,8], chemistry [9,10], electronics [11] and engineering [12,13].
The problem of determining the constant coefficients present in a differential equation from the study of the solutions of the system has been the subject of different studies, presenting a variety of methods of resolution. First approaches were based on least squares techniques. However, due to the absence of an analytical solution, the need to solve the ODEs numerically makes this approach computationally expensive. An alternative is the generalized profiling estimation method, where the solution is approximated using a linear combination of basis functions and adjusting the coefficients of the corresponding expansion equation by comparing them with the differential equation (see [14,15]). This method is applied even in the case in which the model is stochastic [16]. A study on the properties of this type of algorithm can be found in [17]. Other investigations are based on the use of non-deterministic methods (for example genetic algorithms [18], particle swarm optimization [10]) or Machine Learning (ML) techniques. Some studies focus on methods applicable to specific types of equations. For example [19], where the problem corresponds to a differential equation associated with the time evolution of a system, and is solved by making a large number of observations of the evolution of the system over short intervals.
However, the application of the techniques discussed in real problems presents a series of difficulties due to the characteristics of the numerical data available in such cases, as discussed in [20]. In addition, the presence of outliers makes it necessary to design and use robust algorithms, see, for example, [21]. There are also some considerations that complicate the efficient use of some of the methods. For example, in stiff problems, the presence of nonlinearity in the solution space [10] or high dimensionality of the parameters space, in partial differential equations (PDE) [12].
The approach taken in the present investigation is in a certain way the inverse of that of the cases previously considered. It is proposed to obtain a solution of the differential equations by previously determining the values of the parameters that best fit the observations made. However, the approach used in [10] has a certain similarity in its first stages to the one presented in this paper.
When the function to model corresponds to a spatial-distributed variable, kriging is usually used as the best linear estimator of the function from a set of random measurements. This can be found in the work of [22,23] for the calculation of unknown coefficients in linear PDE [24,25].
The proposal presented in this research work performs a modeling of the parameters of the differential equation in the case of functional dependence, by means of a local regression method based on the finite element method. Therefore, a brief introduction to the modeling methods will be given below.
The number of techniques available to model a relationship between variables is large. Selecting one or another depends on a variety of factors, from the data itself to the knowledge of the underlying equation involving the variables. The toolbox goes from classical statistical methods as linear or multilinear regression to machine-learning oriented methods as neural networks and related techniques, random trees, support vector regression and others.
The problem under consideration consists of obtaining a model of the relationship between a set of variables that is assumed to be determined by a function f : Ω d
y = f x 1 , , x d .
All the considered methods start from an experimental dataset Υ of P tuples sampled from the relation (1):
Υ = x k 1 , x k 2 , x k 3 , .. , x k d , y k k = 1 , 2 , . , P ,
where, for every k = 1 , 2 , . , P is verified x k 1 , x k 2 , x k 3 , .. , x k d , y k Ω × .
The literature developing the different methods can be easily accessed and they are widely applied to a variety of problems. From these data, each methodology allows us to obtain estimates of the values of f x 1 , , x d at each point of Ω using an algorithm:
F : Ω d × J x 1 , , x d ; θ 1 , , θ J F x 1 , , x d ; θ 1 , , θ J ,
where θ 1 , , θ J represents a set of parameters specific to each methodology and which determines the output value of the model. These estimated values will be denoted by:
y ^ = F x 1 , , x d ; θ 1 , , θ J .
The methods for numeric model estimation are usually stated as a minimization problem over some kind of global error E obtained as a function H : P of individual errors ε k defined over the sampled and estimated values:
E = H ε 1 , ε 2 , . , ε P
with ε k = y k y ^ k = y k F x k 1 , .. , x k d ; θ 1 , , θ J .
Thus considered, the function H allows the approach of an optimization problem (see Equation (6)). Then, the optimal values θ * 1 , , θ * J that minimize the value of H for the available dataset are sought.
H y 1 F x 1 1 , , x 1 d ; θ 1 , , θ J , , y P F x P 1 , , x P d ; θ 1 , , θ J .
These optimum parameters define the final model F * as:
F * x 1 , , x d ; θ * 1 , , θ * J .
The present work follows the previous line of research developed by the authors with methodologies based on the finite elements method (FEM), a method for finding numerical solutions to differential equations with boundary conditions, developed initially to be applied in civil and aeronautical engineering [26,27,28,29,30,31].
In the following, in order to simplify notation, the criterion of writing the d-dimension points as a single variable will be used. Let us consider a given differential equation defined by a differential operator D , acting on a domain Ω d :
D f = v ,
where f , v     V Ω , V being a function space defined over Ω .
The finite element method replaces the domain Ω of V by a collection of N e closed sets Ω 1 , , Ω N e called elements, that verify:
U j = 1 N e Ω j = Ω Ω j 1 Ω j 2 = Γ j 1 Γ j 2 ,
where Γ j is the frontier of the closed Ω j .
This process is called meshing and it is usually done using sets of specific geometries, for example, in two dimensional triangles or rectangles. The generated mesh has an associated number that is related to the size of the elements. This parameter is usually denoted by h and relates to the order of the error in the interpolations that will be defined in the next paragraph:
h = min ρ ϵ B x j , ρ Ω j     x j Ω j ,   j = 1 ,   , N e ,
where B x j , ρ is the open ball centred in x j with radius ρ .
Meshing on a domain also defines a set of Q points called nodes ζ 1 ,   ζ 2 , , ζ Q that are used as support for the interpolation of any function defined on Ω through a related set of functions called shape functions φ 1 x , φ 2 x , , φ Q x verifying the following conditions at the nodes:
φ i ζ j = δ i j ,
for every i , j = 1 , , Q .
The linear span defined from the set of functions φ 1 x , φ 2 x , , φ Q x forms a finite dimensional subspace which is composed by continuous piecewise polynomial functions of degree K (Sobolev space). This vector space is associated with a given division of the domain where the problem is set in and it will be denoted by V h . That is:
V h = s p a n φ 1 x , φ 2 x ,   , φ Q x .
On the space V h , a derivative operator D h that generalizes the usual derivative to the functions of V h that are not derivable at all points of Ω can be defined.
The original problem can now be posed by searching the function f h   ϵ   V h :
f h x = i = 1 Q u i · φ i x
that best approximates the equation:
D h f h = v h ,
where v h   ϵ   V h is the function of V h that corresponds with the interpolation of v x defined in Equation (8).
The application of the FEM to the modelling of systems developed by the authors is based on the principle of projection through interpolation of any function f     V Ω in the space V h as:
f x = i = 1 Q α i · φ i x F : Ω d × J x 1 , , x d ; θ 1 , , θ J F x 1 , , x d ; θ 1 , , θ J ,
where α i = f ζ i .
The numerical regression model for the relation Equation (1) will consist of the determination of the values α 1 , , α Q that minimize an error function defined in a similar way to that in Equation (5).
The authors have been developing regression techniques based on Equation (15) as a method of approximation [32,33,34,35]. The last proposal is given by the octahedric regression methodology that will be presented in the next section.
The rest of the paper is organized as follows: Section 2 presents the basics of the modelling technique used in the proposed methodology, the octahedric regression and a study on the overfitting control and the computational algorithm. Section 3 presents four application examples. The first three correspond to the static heat equation and the last one to the Bass equation. Finally, Section 4 presents an analysis of the results obtained and a description of the computational characteristics of the methodology, together with a reflection on future lines of research.

2. Materials and Methods

The problem under consideration can be divided into two different phases: first, a model for the coefficients of the equation is determined. After this model has been obtained, it can be used to solve the differential equation using a typical numerical method, as those based on Runge–Kutta or multistep approaches.
In this section, we will proceed to the explanation of the modeling method to be used to estimate the coefficient functions at the nodes where the approximate numerical function is calculated. The following section presents the proposed solution to deal with the problem of overfitting, which is common to the techniques of modeling from experimental data. The last subsection develops the algorithm in the form of pseudocode, commenting on its main features.

2.1. Octahedric Regression

The problem of obtaining a model for the functional coefficients will be solved using the technique developed by the authors, called octahedric regression, and is presented in the research paper [36]. This algorithm presents good properties with respect to the following points: easy detection and control of the overfitting problem, efficient parallelization based on its embarrassing parallelism and fast numerical estimation for out of sample points.
Octahedral regression is an evolution of the previous numerical methodologies developed by the authors and corresponds to the fastest and most efficient of them. The next paragraphs provide a brief presentation of the basis of this methodology.
The basis is the use of parameterized radial functions, defined in the following point.
Definition 1. 
A radial function is a function Φ : + x + + that accomplishes the conditions
ω 0   lim r Φ r , ω = 0 r 0     lim ω 0 Φ r , ω = 0 .
The next definition introduces the averaged value estimator for a function at any point. In the following points, it is assumed that a radial function Φ r , ω is selected and that the conditions on the functions for the existence of the corresponding integrals are satisfied.
Definition 2. 
Given a function f : Ω d , the weighted average regression c * x o of f at x o Ω is defined using the implicit definition:
c * x o · W 0 x o Ω f x · Φ x x o , ω   d x = 0 ω 0    lim r Φ r , ω = 0 r 0    lim ω 0 Φ r , ω = 0 ,
where W 0 x o = Ω Φ x x o , ω   d x and Φ x x o , ω are a function as presented in Definition 1.
In order to reduce the bias that may exist when calculating the previous weighted average, a set of points is introduced that will be used in the final estimation of the model.
Definition 3. 
Given a point x o ϵ   Ω and a parameter h (in the model is called pseudocomplexity), the octahedric support of size h around x o is the set of 2 · d points:
x o + h 2 · e 1 , x o + h 2 · e 2 , .. , x o + h 2 · e d , x o h 2 · e 1 , x o h 2 · e 2 , .. , x o h 2 · e d ,
where e j j = 1 d are the vectors of the canonical basis of d .
Definition 4. 
The octahedric regression model of f x at x o is defined as the average of the weighted average regressions c * x o ± h 2 e j calculated at the points of the octahedric support introduced in Definition 3. This estimated value will be denoted by f ^ x o and is given by:
f ^ x o = 1 2 d · j = 1 d   c * x o + h 2 · e j + c * x o h 2 · e j .
The following proposition shows the nature of the proposed estimator.
Proposition 1. 
The octahedric estimation f ^ x o of f x at x o is a correction of order two with respect to the weighted average regression c * x o at the same point.
Demonstration. Developing the c * x o ± h 2 · e j functions in Equation (19) and Φ x x o ± h 2 · e j , ω through the implicit definition given in Equation (17) in powers of h, the first order term cancels and the following expression holds:
f ^ x o = c * x o + O h 2 .
Equation (20) shows that octahedric regression is a correction of order h 2 to the weigthed average for central objective points. Consequently, when h 0 , both values tend to coincide f ^ x o c * x o , causing overfitting on the points of the sample with respect to the points nearest to x o . The way to study the existence and importance of this effect is through a second estimation called restricted model, where in the calculation of the model at a point, the corresponding values are removed from the sample in the case of being part of it. The results will be discussed in the next subsection.
When the problem is modelling a function from a discrete sample of size P (see Equation (2)) of points and values of f x , the integrals must be calculated using finite sums, so:
W 0 x o = Ω   Φ x x o , ω   d x 1 P · k = 1 P Φ x k x o , ω
Ω   f x · Φ x x o , ω   d x 1 P · k = 1 P y k · Φ x k x o , ω .
Then, the discrete version of Equation (17) is:
k = 1 P c * x o x k · Φ x k x o , ω = 0 .

2.2. Control of Model Overfitting

From the result of Proposition 1, the trend to overfitting has been discussed. In this point, the question will be considered further.
Let us study the problem of estimating the value of an objective function f x at the first point of the sample x 1 Υ , and suppose that the rest of the points on the sample are ordered depending on the distance to x 1 . Taking Equation (21) at the support points x 1 ± h 2 · e j ,
W 0 x 1 ± h 2 · e j Φ h 2 , ω · 1 + Φ x 2 x 1 h 2 · e j , ω Φ h 2 , ω + .. + Φ x P x 1 h 2 · e j , ω Φ h 2 , ω
The term on brackets represents the relative weight of each sample point in the weighted average. Summing up the contributions on each support point, the result can be written as:
1 + Ψ x 2 x 1 , ω + .. + Ψ x P x 1 , ω ,
where
Ψ x k x l , ω = j = 1 d Φ x k x l h 2 · e j , ω + Φ x k x l + h 2 · e j , ω 2 · d · Φ h 2 , ω .
The value of
Π x r = 1 + k r P Ψ x k x r , ω
represents the weight of all the points in the estimation of the model calculated at x r . At zero order in h, Equation (27) is approximately:
Π x r 1 + k r P Φ x k x r , ω Φ h 2 , ω .
By Equation (16), the fractions converge very fast to zero as the distance to x r grows, and the only contribution depends on the points that are at a distance similar to the nearest point, that is, when Φ x k x r , ω Φ h 2 , ω . The number q ω of points involved is determined by the value of the parameter ω , and c * x r is a weighted mean of the q-nearest points. Therefore, the octahedric regression presented in the present paper corresponds to a mean of a simpler estimator calculated on the support of size h defined around x r . These simple estimators correspond to the weighted average of the q x r , ω -nearest neighbors. In the limit ω 0 , c * x r ± h · e j are obtained from the nearest point. In the case of considering all the experimental points, the model is called full. In that case, when h 1 , the nearest to the support points will very frequently be x r , and then: c * x r ± h · e j y r , and according to Equation (20), f ^ x r y r , confirming the trend to overfitting.
The overfitting is caused by the incorporation of noise to the model. If the point that is being calculated is not included in the estimation, the points that are used to obtain the values of c i * x r ± h · e j have a greater probability of presenting independent noise influence, diminishing the overfitting in that form. The new model calculated in this form is called restricted and corresponds to having a cross-validation for each experimental point where the test set is formed by itself.
It has been commented previously that the methodology trends to overfitting when the size of the parameter h is small. Now, a real case of the application of octahedric regression will be shown in order to illustrate how this problem can be treated. Different statistical coefficients can be used to quantify the goodness of fit of a model. For example, the mean absolute error or REC curves. The example is a resume of the results presented in [36]. The first step is to calculate the so-called full and restricted models for different values of the parameter h.
As Figure 1a shows, the mixed model, calculated as the average of the errors of the restricted and full models, presents a minimum that can be used to fix the best value of the parameter h in the estimation process.

2.3. Computational Algorithm

The second step of the global algorithm corresponds with the numeric integration of the ordinary differential equation. As is well known, there is a variety of general algorithms and methods and, depending on the concrete ODE under study, some specific methodologies can be considered.
In the present research, the numerical method of integration used in the calculations corresponds to the predictor-corrector method based on the fourth-order multi-step Adams–Bashforth and Adams–Moulton algorithms. In these methods, it is necessary to calculate the unknown functional parameters at the nodes, so the regression model is used to estimate these values.
The exact form for the algorithm depends on the ODE under study. Algorithm 1 corresponds to the differential equation solved presented in Section 3.1:
d d x α x · d u d x = f x .
Following Equations (21)–(23), the algorithm can be condensed in the next schema (Algorithm 1), where Euler’s method has been used in the numerical solution of the equation:
Algorithm 1. Sampled factors ODE numerical integrator
Input:
N : Number of intervals,
a : Left interval extreme,
b : Right interval extreme,
w : Parameter of radial function,
x 1 s , .. , x P s : Sample of independent variable,
α 1 s , .. , α P s : Sample of alpha function,
f 1 s , .. , f P s : Sample of f function,
Output:
x 0 , .. , x N : Coordinates of nodes,
u 0 0 , .. , u N 0 : Estimated numerical function,
u 0 1 , .. , u N 1 : Estimated numerical derivative
Procedure IntegratingODE
   h b a / N
  /* Modeling unknown functions at nodes*/
  for i 0 ,   N do
    x i x i + i · h
    W 0 0     See Equation (21)
    S α 0     See Equation (22)
    S f 0     See Equation (22)
   for k 0 ,   P do
     ρ Φ x i , x k s , w
     W 0 W 0 + ρ
     S α S α + ρ · α k s
     S f S f + ρ · f k s
    α i ^ S α / W 0     See Equation (23)
    f i ^ S f / W 0     See Equation (23)
  /* Initial conditions */
   u 0 1 y 0 · α 0 ^
   u 0 0 y 0
  /* Calculating numerical solution (Euler’s method)*/
  for i 0 ,   N 1 do
    u i + 1 1 u i 1 + f i ^ · h
    u i + 1 0 u i 0 + u i 1 · h / α i ^
  return x 0 , , x N , u 0 0 , , u N 0 , u 0 1 , , u N 1

3. Results

To test the behavior of the proposed methodology, several examples are solved. First, two cases of the one-dimensional static inhomogeneous heat equation will be studied. Later, the Bass equation is analyzed to consider a different example.
Let us denote the solution to the differential equations on an interval I = a , b by u(x).
For a given selection of standard deviation ( σ ) and sample size (P), the functional parameters are sampled and generate the corresponding numerical solutions for the equations. Denoting the set of samples by S P , σ and each individual sample by s S P , σ , the solution can be represented as u s x . In the examples, 200 iterations with different samples of the characteristic functions of the equation are run. From this set of solutions, the following statistical indexes are considered:
U ¯ x , P , σ = max s S P , σ u s x
U _ x , P , σ = min s S P , σ u s x
U P , σ = u b u s b s S P , σ
U M P , σ = u b median s S P , σ u s b .
U ¯ x , P , σ and U _ x , P , σ represent the extreme values of the solutions at each point x for a given sample size n and standard deviation σ . The amplitude of the difference δ P , σ = max x a , b U ¯ x , P , σ U _ x , P , σ , shows the size of variations in the solutions related to a given value of P and σ .
These indexes can be greatly influenced by low frequent extreme values, so additional parameters must be considered. For example, in the case that the exact solution is known, something frequent when studying the behavior of the algorithm, the average (Equation (32)) and median (Equation (33)) of the error calculated over the samples s S P , σ can be a more convenient approach when studying the behavior of the solutions and their dependence on the magnitude of the perturbation.
The testing process followed these steps:
  • Selection of the different standard deviation values σ j j = 1 N σ for the perturbation (see next point) with which the study is to be carried out. The following steps should be performed once for each value of σ σ j j = 1 N σ in the above set and as many times as indicated by the number of iterations (see Table 1, Table 2, Table 3 and Table 4);
  • Generation of function samples from the uniform distribution X U a , b for the points coordinates and a random normal distribution for the perturbation ϵ N 0 , σ as follows:
    Y i = f i X + ϵ ,
    where f i x represents the i-th functional parameter of the ODE under study and Y i is the corresponding sample. The size of each sample is specified in Table 1, Table 2, Table 3 and Table 4;
  • Once the number of intervals N has been selected, the model is obtained at the N +1 nodes obtained by dividing the interval I = a , b into N sub-intervals;
  • Numerical resolution of the equation using the values of the functional parameters at the nodes obtained in the previous step, by means of an ordinary ODE resolution method, in the present case predictor-corrector;
  • Calculation of statistical values U ¯ x , P , σ , U _ x , P , σ , U P , σ and U M P , σ from the results obtained in each iteration and their use (in the form of tables or graphs).

3.1. Static Heat Equation for Inhomogeneous Media

The application is based on the one-dimensional case of the second order heat equation, given by:
c · ρ · u t x α x · u x = f x .
In steady state, the dependence with time vanishes, obtaining the static heat equation in the form:
d d x α x · d u d x = f x .

3.1.1. Example 1

The first example corresponds to the equation:
d d x c o s x · d u d x = c o s 2 x ,
with u x defined over the interval x 0 , π 4 and constrained by the initial conditions u 0 = 1 and u 0 = 0 .
The functions α x and f x are perturbed using a random variable following a normal distribution with average zero and standard deviation σ ranging from zero to 0.5. Different samples of these perturbed functions are considered with sizes between 5 and 100.
The equation is solved numerically using a predictor–corrector method (fourth order Adams–Bashforth and Adams–Moulton) in the interval 0 , π 4 using a step size of h = π 400 .
The analytical solution for the Equation (37) is u x = 2 c o s x , and is used to compare with the numerical solution u s x .
First, we can study the influence of the standard deviation parameter of the perturbation with respect to the differences between the extreme values δ 100 , σ . It is also interesting to compare the evolution of U M 100 , σ with respect to the standard deviation. Those results can be seen in Figure 2a,b:
Figure 3 shows the exact u x and the maximum U ¯ x , n , σ and minimum U _ x , n , σ of the numerical solutions at each point on for the iterations corresponding to different values of the standard deviation on the normal perturbation term:
The dependence of the numerical solutions on the sample size can also be considered in order to study the algorithm efficiency. Figure 4 shows the same information that has been presented in Figure 2b for different sample sizes, from 5 to 100.
Table 1. Model parameters for the Example 1.
Table 1. Model parameters for the Example 1.
Sample SizeStd. Dev.Iterations
1000–0.5200
5–100 10–0.5200
1 Results in Figure 4.
In general, the behavior is as expected, obtaining better accuracies as the number of points in the sample increases. However, it can be seen in Figure 4 how, for very small values of P, the result does not present a completely determinate behavior.

3.1.2. Example 2a

Another case of Equation (36) is:
d d x J n x · d u d x = J m x ,
where:
J m x = x m · e x .
The exact solution of this ODE can be obtained as:
u x = I m x J n x d x = x m n m · I m 1 x J n x d x ,
where:
I m x = J m x   d x .
The next two examples will allow comparing the results corresponding to the solutions of the different members of the family of parametric functions J n x .
The first case corresponds with the values of the parameters given by m = 2 and n = 4 . Let us study the solution u x on the interval 1 , 2 for the initial conditions u 1 = 2 / 3 and u 1 = 1 . The exact solution for the last equation is u x = 1 x + 1 x 2 2 3 · 1 x 3 .
Table 2. Model parameters for the Example 2a.
Table 2. Model parameters for the Example 2a.
Sample SizeStd. Dev.Iterations
1000–0.5200
Figure 5 shows the result for the equation given by m = 2 and n = 4 .
In Figure 6 x , U ¯ x , 100 , σ and U _ x , 100 , σ are shown.

3.1.3. Example 2b

Example 2b corresponds to m = 3 and n = 6 on the interval 1 , 2 , with initial conditions u 1 = 1 / 5 and u 1 = 2 . In this case, the exact solution is given by the function u x = 1 2 x 2 + 1 x 3 3 2 x 4 + 6 5 x 5 . Figure 7 shows the difference δ 100 , σ and the median U M 100 , σ .
Figure 8 shows the exact and the maximum and minimum numerical solutions for the iterations corresponding to different values of the standard deviation on the normal perturbation term.
Figure 9 presents the effect of sample size on the solution error for sample sizes between 5 and 100 points.
Table 3. Model parameters for theExample 2b.
Table 3. Model parameters for theExample 2b.
Sample SizeStd. Dev.Iterations
1000–0.5200
5–100 10–0.5200
1 Results in Figure 9.

3.2. Bass Equation. Example 3

The third example is a variation of a normalized Bass equation [37] with non-constant coefficients of innovation and imitation:
y t 1 y t = p t + q t · y t ,
defined over an interval 0 , 5 with the initial condition given by y 0 = 0 . Typical values for the constants in Equation (42), are p 0.2 ± 0.1 and q 0.4 ± 0.1 [38]. In the studied example, two expressions are proposed. For the innovation coefficient:
p t = 0.2 · e t 2 ,
and for the imitation coefficient:
q t = 0.5 · t t 2 2 .
Table 4. Model parameters for the Example 3.
Table 4. Model parameters for the Example 3.
Sample SizeStd. Dev.Iterations
1000–0.5200
Figure 10 represents the parameters δ 100 , σ calculated with 200 different samples of the normal perturbation depending on the values of σ .
Figure 11 shows the difference between the exact and the maximum and minimum numerical solutions for the iterations corresponding to different values of the standard deviation on the normal perturbation term.
In order to facilitate the comparison between the different results, Figure 12 shows together some of the curves represented in Figure 11 for a different execution and function samples.

4. Discussion

In this research, the authors present a methodology for the modeling of differential equations and their resolution in systems where the functional expression of the functional parameters present in these equations is unknown and only an experimental sample of data is available. In the scientific literature, there are references to the determination of parameters of the differential equations governing a system by means of nonlinear regression on experimental data of the solution of the equation under study. Likewise, the field of study of differential equations for which the parameters follow a given distribution constitutes a fertile field of research.
The proposal developed focuses on considering equations whose parameters are unknown functions and whose values are deterministically determined, although affected by some type of error or perturbation. The algorithm allows obtaining numerical solutions for these equations by performing a previous numerical model of the functions involved from the experimental data.
Three different examples have been considered, two of them with known analytical solutions and another one considering only the numerical solution. From the study of the results obtained, it can be verified that the result of the algorithm shows behavior in accordance with what is expected with respect to the magnitude of the perturbation and the size of the experimental sample used to perform the modeling. On the other hand, the results show how the proposed methodology obtains solutions with a stable response to the corresponding perturbations.
From the present work, the main lines of future research would be two. On the one hand, the modification of the algorithm for the treatment of partial differential equations (PDE). On the other hand, it is worth investigating how to modify the design of the resolution algorithm to make it more computationally efficient. The way to do this would be to study how to combine the modeling algorithm with the resolution algorithm, minimizing the number of operations and the need for storage of the total program.

Author Contributions

Conceptualization, F.J.N.-G. and Y.V.; methodology, F.J.N.-G.; software, F.J.N.-G.; validation, F.J.N.-G. and Y.V.; formal analysis, Y.V.; investigation, F.J.N.-G. and Y.V.; resources, Y.V.; writing—original draft preparation, F.J.N.-G. and Y.V.; writing—review and editing, F.J.N.-G. and Y.V.; visualization, F.J.N.-G.; supervision, Y.V. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Manteca, I.A., Jr.; Meca, A.S.; Alhama, F. Mathematical characterization of scenarios of fluid flow and solute transport in porous media by discriminated non-dimensionalization. Int. J. Eng. Sci. 2012, 50, 1–9. [Google Scholar] [CrossRef]
  2. Atkinson, J. The Mechanics of Soils and Foundations; Taylor and Francis: New York, NY, USA, 2007. [Google Scholar]
  3. Zienkiewicz, O.C.; Taylor, R.L.; Zhu, J.Z. The Finite Element Method: Its Basis and Fundamentals; Elsevier: Amsterdam, The Netherlands, 2005. [Google Scholar]
  4. Graebel, W. Advanced Fluid Mechanics; Academic Press: Cambridge, MA, USA, 2007. [Google Scholar]
  5. Cannon, J. The One-Dimensional Heat Equation, Encyclopedia of Mathematics and Its Applications; Addison-Wesley: Boston, MA, USA, 1984; ISBN 0-521-30243-9. [Google Scholar]
  6. Rosenbaum, B.; Rall, B.C. Fitting functional responses: Direct parameter estimation by simulating differential equations. Methods Ecol. Evol. 2018, 9, 2076–2090. [Google Scholar] [CrossRef] [Green Version]
  7. Kalyaev, D.; Zuev, S.M. Algorithms for statistical estimation of coefficients of ordinary differential equations using observational data. Investig. Antivir. Drug Eff. 1991, 6, 1–23. [Google Scholar] [CrossRef]
  8. Wu, H.; Xue, H.; Kumar, A. Numerical discretization-based estimation methods for ordinary differential equation models via penalized spline smoothing with applications in biomedical research. Biometrics 2012, 68, 344–352. [Google Scholar] [CrossRef] [Green Version]
  9. Van der Linde, S.C.; Nijhuis, T.A.; Dekker FH, M.; Kapteijn, F.; Moulijn, J.A. Mathematical treatment of transient kinetic data: Combination of parameter estimation with solving the related partial differential equations. Appl. Catal. A Gen. 1997, 151, 27–57. [Google Scholar] [CrossRef]
  10. Arloff, W.; Schmitt, K.R.; Venstrom, L.J. A parameter estimation method for stiff ordinary differential equations using particle swarm optimization. Int. J. Comput. Sci. Math. 2018, 9, 419–432. [Google Scholar] [CrossRef]
  11. Abd-Elrady, E.; Schoukens, J. Least squares periodic signal modeling using orbits of nonlinear ODEs and fully automated spectral analysis. Automatica 2005, 41, 857–862. [Google Scholar] [CrossRef]
  12. Xun, X.; Cao, J.; Mallick, B.; Maity, A.; Carroll, R.J. Parameter estimation of partial differential equation models. J. Am. Stat. Assoc. 2013, 108, 1009–1020. [Google Scholar] [CrossRef] [Green Version]
  13. Le Cointe, P. Kriging with Partial Differential Equations in Hydrogeology. Master’s Thesis, Université Pierre et Marie Curie, Ecole des Mines de Paris & Ecole Nationale du Génie Rural des Eaux et Forêts, Paris, France, 2006. [Google Scholar]
  14. Bochmann, M.; Kämmerer, L.; Potts, D. A sparse FFT approach for ODE with random coefficients. Adv. Comput. Math. 2020, 46, 1–21. [Google Scholar] [CrossRef]
  15. Poyton, A.A.; Varziri, M.S.; McAuley, K.B.; McLellan, P.J.; Ramsay, J.O. Parameter estimation in continuous-time dynamic models using principal differential analysis. Comput. Chem. Eng. 2006, 30, 698–708. [Google Scholar] [CrossRef] [Green Version]
  16. Zuev, S.M. Statistical estimation of the coefficients of ordinary differential equations using observational data. Sov. J. Numer. Anal. Math. Model. 1986, 1, 235–244. [Google Scholar] [CrossRef]
  17. Qi, X.; Zhao, H. Asymptotic efficiency and finite-sample properties of the generalized profiling estimation of parameters in ordinary differential equations. Ann. Stat. 2010, 38, 435–481. [Google Scholar] [CrossRef]
  18. Tutkun, N. Parameter estimation in mathematical models using the real coded genetic algorithms. Expert Syst. Appl. 2009, 36, 3342–3345. [Google Scholar] [CrossRef]
  19. Tsitsiashvili, G.; Osipova, M.; Kharchenko, Y. Estimating the coefficients of a system of ordinary differential equations based on inaccurate observations. Mathematics 2022, 10, 502. [Google Scholar] [CrossRef]
  20. Biegler, L.T.; Damiano, J.J.; Blau, G.E. Nonlinear parameter estimation: A case study comparison. AIChE J. 1986, 32, 29–45. [Google Scholar] [CrossRef]
  21. Cao, J.; Wang, L.; Xu, J. Robust estimation for ordinary differential equation models. Biometrics 2011, 67, 1305–1313. [Google Scholar] [CrossRef]
  22. Gulian, M.; Raissi, M.; Perdikaris, P.; Karniadakis, G. Machine learning of space-fractional differential equations. SIAM J. Sci. Comput. 2019, 41, A2485–A2509. [Google Scholar] [CrossRef]
  23. Raissi, M.; Perdikaris, P.; Karniadakis, G.E. Machine learning of linear differential equations using Gaussian processes. J. Comput. Phys. 2017, 348, 683–693. [Google Scholar] [CrossRef] [Green Version]
  24. Van den Boogaart, K.G. Kriging for processes solving partial differential equations. In Proceedings of the 2001 Annual Conference of the International Association for Mathematical Geology, Cancun, Mexico, 6–12 September 2001. [Google Scholar]
  25. Chen, J.; Chen, Z.; Zhang, C.; Wu, C.F. APIK: Active physics-informed kriging model with partial differential equations. arXiv 2020, arXiv:2012.11798. [Google Scholar] [CrossRef]
  26. Reddy, J.N. Introduction to the Finite Element Method; Mechanical Engineering, 4th ed.; McGraw Hill Education: New York, NY, USA, 2019; ISBN 9781259861918 1259861910. [Google Scholar]
  27. Brenner, S.; Scott, R. The Mathematical Theory of Finite Element Methods; Springer Science & Business Media: Berlin, Germany, 2007; Volume 15, ISBN 0387759336. [Google Scholar]
  28. Aziz, A.K. The Mathematical Foundations of the Finite Element Method with Applications to Partial Differential Equations; Academic Press: Cambridge, MA, USA, 2014; ISBN 1483267989. [Google Scholar]
  29. Babuška, I.; Banerjee, U.; Osborn, J.E. Generalized finite element methods—Main ideas, results and perspective. Int. J. Comput. Methods 2004, 1, 67–103. [Google Scholar] [CrossRef] [Green Version]
  30. Whiteman, J.R. The Mathematics of Finite Elements and Applications: Proceedings of the Brunel University Conference of the Institute of Mathematics and Its Applications Held in April 1972; Academic Press: London, UK, 1973; ISBN 978-0-12-747250-8. Available online: https://ua.on.worldcat.org/oclc/764065 (accessed on 15 December 2021).
  31. Zienkiewicz, O.C.; Taylor, R.L.; Taylor, R.L. The Finite Element Method for Solid and Structural Mechanics; Elsevier: Amsterdam, The Netherlands, 2005; ISBN 0750663219. [Google Scholar]
  32. Villacampa, Y.; Navarro-González, F.J.; Llorens, J. A geometric model for the generation of models defined in Complex Systems. WIT Trans. Ecol. Environ. 2009, 122, 71–82. [Google Scholar]
  33. Navarro-González, F.J.; Villacampa, Y. A new methodology for complex systems using n-dimensional finite elements. Adv. Eng. Softw. 2012, 48, 52–57. [Google Scholar] [CrossRef]
  34. Navarro-González, F.J.; Villacampa, Y. Generation of representation models for complex systems using Lagrangian functions. Adv. Eng. Softw. 2013, 64, 33–37. [Google Scholar] [CrossRef]
  35. Navarro-González, F.J.; Villacampa, Y. A finite element numerical algorithm for modelling and data fitting in complex systems. Int. J. Comput. Methods Exp. Meas. 2016, 4, 100. [Google Scholar] [CrossRef] [Green Version]
  36. Navarro-Gonzalez, F.J.; Villacampa, Y. An octahedric regression model of energy efficiency on residential buildings. Appl. Sci. 2019, 9, 4978. [Google Scholar] [CrossRef] [Green Version]
  37. Bass, F.M. A dynamic model of market share and sales behavior. In Proceedings of the Winter Conference American Marketing Association, Chicago, IL, USA, 27–28 December 1963; pp. 269–275. [Google Scholar]
  38. Massiani, J.; Gohs, A. The choice of Bass model coefficients to forecast diffusion for innovative products: An empirical investigation for new automotive technologies. Res. Transp. Econ. 2015, 50, 17–28. [Google Scholar] [CrossRef] [Green Version]
Figure 1. Effect of overfitting and determination of optimum level for parameter h: (a) Typical behavior of MAE (Mean Absolute Error) for the full, restricted and mixed models in terms of h; (b) Typical REC curve for the null, full and restricted models.
Figure 1. Effect of overfitting and determination of optimum level for parameter h: (a) Typical behavior of MAE (Mean Absolute Error) for the full, restricted and mixed models in terms of h; (b) Typical REC curve for the null, full and restricted models.
Mathematics 10 01516 g001
Figure 2. Effect on the solution of different standard deviations for 200 samples of the normal perturbation term: (a) Range of the differences δ 100 , σ ; (b) Median of the difference between the numerical solutions and the exact solutions at right extreme of the interval U M 100 , σ .
Figure 2. Effect on the solution of different standard deviations for 200 samples of the normal perturbation term: (a) Range of the differences δ 100 , σ ; (b) Median of the difference between the numerical solutions and the exact solutions at right extreme of the interval U M 100 , σ .
Mathematics 10 01516 g002
Figure 3. u x (blue line), U ¯ x , 100 , σ (upper red line) and U _ x , 100 , σ (lower red line) after 200 iterations for different values of the standard deviation: (a) σ = 0 ; (b) σ = 0.1010 ; (c) σ = 0.2525 ; (d) σ = 0.2980 ; (e) σ = 0.3485 ; (f) σ = 0.3990 ; (g) σ = 0.4495 ; (h) σ = 0.500 .
Figure 3. u x (blue line), U ¯ x , 100 , σ (upper red line) and U _ x , 100 , σ (lower red line) after 200 iterations for different values of the standard deviation: (a) σ = 0 ; (b) σ = 0.1010 ; (c) σ = 0.2525 ; (d) σ = 0.2980 ; (e) σ = 0.3485 ; (f) σ = 0.3990 ; (g) σ = 0.4495 ; (h) σ = 0.500 .
Mathematics 10 01516 g003aMathematics 10 01516 g003b
Figure 4. Effect on the parameter U M P , σ of different sample sizes for normal perturbation terms with standard deviations from 0 to 0.5: (a) P = 5; (b) P = 10; (c) P = 20; (d) P = 50; (e) P = 70; (f) P = 100.
Figure 4. Effect on the parameter U M P , σ of different sample sizes for normal perturbation terms with standard deviations from 0 to 0.5: (a) P = 5; (b) P = 10; (c) P = 20; (d) P = 50; (e) P = 70; (f) P = 100.
Mathematics 10 01516 g004aMathematics 10 01516 g004b
Figure 5. Effect on the solution of different standard deviation for 200 samples of the normal perturbation term: (a) Range of the differences δ 100 , σ ; (b) Median of the difference between the numerical solutions and the exact solutions at right extreme of the interval U M 100 , σ .
Figure 5. Effect on the solution of different standard deviation for 200 samples of the normal perturbation term: (a) Range of the differences δ 100 , σ ; (b) Median of the difference between the numerical solutions and the exact solutions at right extreme of the interval U M 100 , σ .
Mathematics 10 01516 g005
Figure 6. u x (blue line), U ¯ x , 100 , σ (upper red line) and U _ x , 100 , σ (lower red line) after 200 iterations for different values of the standard deviation: (a) σ = 0 ; (b) σ = 0.1010 ; (c) σ = 0.2525 ; (d) σ = 0.2980 ; (e) σ = 0.3485 ; (f) σ = 0.3990 ; (g) σ = 0.4495 ; (h) σ = 0.500 .
Figure 6. u x (blue line), U ¯ x , 100 , σ (upper red line) and U _ x , 100 , σ (lower red line) after 200 iterations for different values of the standard deviation: (a) σ = 0 ; (b) σ = 0.1010 ; (c) σ = 0.2525 ; (d) σ = 0.2980 ; (e) σ = 0.3485 ; (f) σ = 0.3990 ; (g) σ = 0.4495 ; (h) σ = 0.500 .
Mathematics 10 01516 g006aMathematics 10 01516 g006b
Figure 7. Effect on the solution of different standard deviation for 200 samples of the normal perturbation term: (a) Range of the differences δ 100 , σ ; (b) Median of the difference between the numerical solutions and the exact solutions at right extreme of the interval U M 100 , σ .
Figure 7. Effect on the solution of different standard deviation for 200 samples of the normal perturbation term: (a) Range of the differences δ 100 , σ ; (b) Median of the difference between the numerical solutions and the exact solutions at right extreme of the interval U M 100 , σ .
Mathematics 10 01516 g007
Figure 8. u x (blue line), U ¯ x , 100 , σ (upper red line) and U _ x , 100 , σ (lower red line) after 200 iterations for different values of the standard deviation: (a) σ = 0 ; (b) σ = 0.1010 ; (c) σ = 0.2525 ; (d) σ = 0.2980 ; (e) σ = 0.3485 ; (f) σ = 0.3990 ; (g) σ = 0.4495 ; (h) σ = 0.500 .
Figure 8. u x (blue line), U ¯ x , 100 , σ (upper red line) and U _ x , 100 , σ (lower red line) after 200 iterations for different values of the standard deviation: (a) σ = 0 ; (b) σ = 0.1010 ; (c) σ = 0.2525 ; (d) σ = 0.2980 ; (e) σ = 0.3485 ; (f) σ = 0.3990 ; (g) σ = 0.4495 ; (h) σ = 0.500 .
Mathematics 10 01516 g008aMathematics 10 01516 g008b
Figure 9. Effect on the parameter U M P , σ of different sample sizes for normal perturbation terms with standard deviations from 0 to 0.5: (a) P = 5; (b) P = 10; (c) P = 20; (d) P = 50; (e) P = 70; (f) P = 100.
Figure 9. Effect on the parameter U M P , σ of different sample sizes for normal perturbation terms with standard deviations from 0 to 0.5: (a) P = 5; (b) P = 10; (c) P = 20; (d) P = 50; (e) P = 70; (f) P = 100.
Mathematics 10 01516 g009aMathematics 10 01516 g009b
Figure 10. Effect on the solution of different standard deviation for 200 samples of the normal perturbation term for the parameters δ 100 , σ .
Figure 10. Effect on the solution of different standard deviation for 200 samples of the normal perturbation term for the parameters δ 100 , σ .
Mathematics 10 01516 g010
Figure 11. U ¯ x , 100 , σ and U _ x , 100 , σ after 200 iterations for different values of the standard deviation: (a) σ = 0 ; (b) σ = 0.1010 ; (c) σ = 0.2525 ; (d) σ = 0.2980 ; (e) σ = 0.3485 ; (f) σ = 0.3990 ; (g) σ = 0.4495 ; (h) σ = 0.500 .
Figure 11. U ¯ x , 100 , σ and U _ x , 100 , σ after 200 iterations for different values of the standard deviation: (a) σ = 0 ; (b) σ = 0.1010 ; (c) σ = 0.2525 ; (d) σ = 0.2980 ; (e) σ = 0.3485 ; (f) σ = 0.3990 ; (g) σ = 0.4495 ; (h) σ = 0.500 .
Mathematics 10 01516 g011aMathematics 10 01516 g011b
Figure 12. Comparative of U ¯ x , 100 , σ and U _ x , 100 , σ after 200 iterations for different values of the standard deviation: σ = 0.0 (black solid), σ = 0.125 (blue discontinued); σ = 0.25 (dark green dashed); σ = 0.375 (light green points) and σ = 0.5 (red solid).
Figure 12. Comparative of U ¯ x , 100 , σ and U _ x , 100 , σ after 200 iterations for different values of the standard deviation: σ = 0.0 (black solid), σ = 0.125 (blue discontinued); σ = 0.25 (dark green dashed); σ = 0.375 (light green points) and σ = 0.5 (red solid).
Mathematics 10 01516 g012
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Villacampa, Y.; Navarro-González, F.J. An Algorithm for Numerical Integration of ODE with Sampled Unknown Functional Factors. Mathematics 2022, 10, 1516. https://doi.org/10.3390/math10091516

AMA Style

Villacampa Y, Navarro-González FJ. An Algorithm for Numerical Integration of ODE with Sampled Unknown Functional Factors. Mathematics. 2022; 10(9):1516. https://doi.org/10.3390/math10091516

Chicago/Turabian Style

Villacampa, Y., and F. J. Navarro-González. 2022. "An Algorithm for Numerical Integration of ODE with Sampled Unknown Functional Factors" Mathematics 10, no. 9: 1516. https://doi.org/10.3390/math10091516

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop