Next Article in Journal
Interpretable Multivariate Process Monitoring Using MEWMA and Explainable Machine Learning
Previous Article in Journal
An Interpretable Semi-Parametric Framework for CMM Export Prediction via Symbolic Regression and Multi-Objective Optimization
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Neural Residual Correction of the Explicit Euler Method via Learned Truncation Error Operators: A Lotka–Volterra Case Study

by
Daniel de Jesús Sierra Ramírez
*,
Rubén Darío Ortiz Ortiz
and
Ana Magnolia Marín Ramírez
Grupo de Investigación ONDAS, Programa de Matemáticas, Facultad de Ciencias Exactas y Naturales, Universidad de Cartagena, Campus San Pablo, Cartagena de Indias 130015, Colombia
*
Author to whom correspondence should be addressed.
Mathematics 2026, 14(13), 2327; https://doi.org/10.3390/math14132327
Submission received: 23 April 2026 / Revised: 16 June 2026 / Accepted: 18 June 2026 / Published: 1 July 2026

Abstract

The explicit Euler method is widely used for the numerical integration of ordinary differential equations due to its simplicity and low computational cost; however, its accuracy and long-term qualitative behavior deteriorate for nonlinear oscillatory systems when moderate or large time steps are employed. This work proposes a neural residual correction framework for the Lotka–Volterra system, where a neural network learns a data-driven approximation of the local truncation error of the Euler scheme relative to a sixth-order Taylor reference solution (Taylor6). The learned correction is incorporated into the Euler update, yielding a hybrid integrator that preserves the simplicity of the base method while improving accuracy and long-term boundedness. Separate neural networks are trained for fixed time-step sizes, with emphasis on an intermediate regime ( Δ t 0.8 1.1 ) where the standard Euler method exhibits pronounced qualitative distortions. Numerical experiments show that the corrected method reduces phase and amplitude errors, preserves the qualitative structure of phase portraits, and generalizes to previously unseen parameter configurations. Comparisons with the classical fourth-order Runge–Kutta method further illustrate the robustness of the proposed approach in this regime. Unlike previous neural correction approaches focused on small time steps, high-order solvers, or global solution operators, the proposed framework specifically targets the intermediate regime where Euler’s truncation error becomes qualitatively dominant while remaining sufficiently structured to be learned through residual correction. Throughout this work, the term “stability” is used exclusively in a qualitative sense, referring to long-term boundedness and phase-portrait preservation.

1. Introduction

Numerical integration of ordinary differential equations (ODEs) is fundamental for modeling and simulating dynamical systems in biology, physics, and engineering [1,2]. Among available numerical schemes, the explicit Euler method is widely used for its simplicity and low computational cost, but suffers from accuracy and long-term qualitative limitations, especially in nonlinear oscillatory systems or for moderate to large time steps [3].
The Lotka–Volterra system [4,5] is a classical benchmark for such limitations. Small time steps allow Euler to produce reasonable approximations, but intermediate or large steps result in phase distortion, amplitude errors, and potentially spurious divergence. High-order methods such as Taylor expansions or Runge–Kutta alleviate these issues but increase computational cost per step [2].
Hybrid approaches combining classical numerical integration with machine learning have recently emerged, aiming to improve accuracy, long-term qualitative behavior, or efficiency by learning problem-dependent corrections from data. Representative examples include residual correction frameworks, solver-informed neural networks, and physics-informed architectures that learn discrepancies between low-fidelity approximations and high-order references [6,7,8,9].
Motivated by this perspective, we propose a neural residual correction framework to augment the explicit Euler method. The network learns the local truncation error relative to a high-order Taylor reference, which is then added to the Euler step. This yields a hybrid integrator that retains the simplicity of Euler while substantially improving accuracy and long-term boundedness in intermediate time-step regimes where Euler alone fails.
Unlike prior neural correction strategies focused on high-order solvers or global solution operators, [10,11] our framework targets the explicit Euler method in a regime where it becomes qualitatively unreliable but remains numerically bounded. Rather than learning the full dynamics, the neural network approximates the dominant truncation-error operator, providing a numerically interpretable correction connected to modified equation theory and backward error analysis.
Recent advances in scientific machine learning emphasize using neural networks to approximate structured discrepancies in physical or numerical models rather than replacing the underlying equations [7,12,13]. In this context, our work is a specific and interpretable instance of this paradigm, where the network learns the local truncation error of Euler relative to a high-order reference, situating the approach within a broader class of data-driven model-correction methods. Recent studies have also investigated computational aspects of explicit numerical methods, including parallel implementations that improve efficiency while preserving the simplicity of low-order schemes. For example, Koics et al. [14] analyzed OpenCL-based parallelization strategies for explicit methods applied to the heat equation, demonstrating that computational performance remains an important consideration when evaluating enhanced numerical integrators. This perspective is particularly relevant in the present work, where neural correction improves accuracy while introducing an additional computational overhead compared with the standard Euler method.
The main contributions of this work are:
  • We introduce a neural residual correction framework that augments the explicit Euler method by learning its local truncation error relative to a high-order Taylor reference.
  • We demonstrate substantial improvements in accuracy and long-term boundedness in an intermediate time-step regime where classical Euler integration degrades.
  • We show that the neural-corrected method generalizes across unseen parameter configurations while producing trajectories comparable to higher-order integrators.
  • We provide a detailed analysis of computational cost, qualitative behavior, and practical trade-offs, situating the approach within the broader context of data-driven hybrid numerical methods.

2. The Lotka–Volterra System

The Lotka–Volterra equations describe the interaction between two species: a prey population N ( t ) and a predator population P ( t ) , where t represents time. This system of ordinary differential equations was independently proposed by Alfred J. Lotka (1925) and Vito Volterra (1926) [4,5] and remains one of the cornerstone models for studying predator–prey dynamics.
The classical form of the model is given by
d N d t = a N b N P , d P d t = c P + d N P ,
where the positive parameters have the following biological interpretation:
  • a > 0 : intrinsic growth rate of the prey population,
  • b > 0 : predation (interaction) rate,
  • c > 0 : natural mortality rate of the predator population,
  • d > 0 : conversion efficiency of consumed prey into predator population growth.
System (1) admits two equilibrium points:
( N 1 * , P 1 * ) = ( 0 , 0 ) , ( N 2 * , P 2 * ) = c d , a b .
The origin is unstable, whereas the second equilibrium is a center that generates closed periodic orbits around it. These persistent oscillations constitute one of the most distinctive features of the model and make it a standard benchmark for evaluating numerical integration methods and modern approximation techniques.
In the present work, multiple configurations of the system are considered by varying both the parameters ( a , b , c , d ) and the initial conditions ( N 0 , P 0 ) . This strategy produces a rich and diverse set of dynamical behaviors ranging from weakly damped to large-amplitude limit cycles. The resulting simulations form the synthetic dataset used to train a residual neural network whose objective is to learn a correction to the explicit Euler method, thereby dramatically improving its accuracy by predicting the residual between the Euler step and a high-precision integrator (Taylor series method of order 6).
The Lotka–Volterra system is not chosen for biological realism, but as a canonical conservative oscillatory system with a known invariant structure, making it ideal for assessing long-term qualitative degradation induced by numerical schemes.

3. Numerical Time Integration Methods

To benchmark the performance of the proposed neural corrector against classical numerical integration schemes, the Lotka–Volterra system is solved using three fixed-step methods: the explicit Euler method, a high-order Taylor series method, and the classical fourth-order Runge–Kutta method (RK4).
A sixth-order Taylor method (Taylor6) is used as a numerical surrogate reference, not as an exact solution, and is assumed sufficiently accurate within the considered admissible time-step regime [2]. Owing to its high order of accuracy, this method provides a reliable approximation of the true trajectory within this regime. In this work, Taylor6 serves two purposes: (i) the generation of synthetic datasets used to train and validate the neural corrector, and (ii) the quantitative evaluation of numerical errors produced by both the explicit Euler method and its neural-corrected counterpart. Importantly, Taylor6 is used as a numerical reference rather than an exact ground-truth solution.

3.1. Explicit Euler Method

The explicit Euler method is the simplest first-order time integration scheme and is defined by the recurrence
y n + 1 = y n + h f ( t n , y n ) ,
where h denotes the time step, y n = [ N n , P n ] is the state vector, and f represents the Lotka–Volterra dynamics.
Due to its low computational cost and straightforward implementation, the explicit Euler method is frequently used as a baseline integrator. However, its limited accuracy and poor long-term qualitative behavior make it unsuitable for long-time integration of nonlinear oscillatory systems unless very small time steps are employed.

3.1.1. Error Structure and Dependence on the Time Step

The explicit Euler method has a local truncation error of order O ( h 2 ) and a global accumulated error of order O ( h ) [2]. Consequently, the numerical error grows linearly with the time step size, making the method highly sensitive to moderate and large values of h.
For nonlinear dynamical systems such as the Lotka–Volterra equations, this error manifests not only as a loss of pointwise accuracy, but also as systematic distortions in the qualitative behavior of the solution. In particular, Euler’s method tends to introduce phase lag and amplitude drift in oscillatory trajectories, which accumulate over time and alter the long-term dynamics.

3.1.2. Boundedness Considerations for Oscillatory Dynamics

From the perspective of classical linear analysis, the explicit Euler method possesses a limited boundedness region. For the linear test equation y = λ y , bounded trajectories require
| 1 + h λ | < 1 ,
which severely restricts the admissible time step when λ has a non-negligible imaginary component [2,15].
Although the Lotka–Volterra system is nonlinear, its linearization around equilibrium points exhibits oscillatory behavior with complex eigenvalues. As a result, explicit Euler integration with moderate or large time steps often produces numerical artifacts such as artificial damping, spurious growth, or distortion of the phase portrait, even when pointwise errors remain moderate over short time intervals.

3.1.3. Impact of the Sampling Interval Δ t

In this work, the numerical solution is sampled at a larger interval Δ t , which may differ from the internal integration step used to generate reference solutions. As Δ t increases, the discrepancy between the explicit Euler approximation and higher-order reference methods becomes more pronounced.
For small values of Δ t , the error introduced by Euler’s method remains comparable to that of higher-order schemes, and the benefit of correction is limited. However, for moderate to large Δ t , the accumulated truncation error becomes structured and systematic, rather than purely stochastic. This regime is particularly suitable for data-driven correction strategies, as the error depends smoothly on the state, system parameters, and time step.

3.1.4. Motivation for Neural Error Correction

The deterministic nature of Euler’s truncation error suggests that it can be approximated as a function of the current state, model parameters, and time step size. This observation motivates the use of data-driven correction strategies, in which a learned model compensates for systematic discretization errors [8]. Instead of replacing the Euler method with a higher-order integrator, we propose to augment it with a neural correction term that compensates for its local truncation error, following a residual learning paradigm [16].

3.2. High-Order Taylor Methods

Taylor series methods approximate the solution by expanding it as a truncated Taylor series in time. A Taylor method of order p requires the computation of time derivatives of the vector field up to order p and exhibits a local truncation error of O ( h p + 1 ) .
In this study, the sixth-order Taylor method serves as a numerical surrogate reference. Its accuracy is verified in Appendix A against an independent RK4 solver using a significantly smaller time step. With a local truncation error of O ( h 7 ) , this method produces highly accurate trajectories for sufficiently small to moderate time steps. Despite this accuracy, the computational cost associated with evaluating higher-order derivatives renders Taylor methods impractical for routine simulations, particularly in high-dimensional or stiff systems. These characteristics justify the use of Taylor6 as a high-order numerical benchmark rather than as a baseline method for practical integration.

3.3. Runge–Kutta Methods

The classical fourth-order Runge–Kutta method (RK4) is a widely used fixed-step integrator with a local truncation error of O ( h 5 ) and a global error of O ( h 4 ) . It is defined by the update
k 1 = h f ( t n , f y n ) ,
k 2 = h f t n + h 2 , y n + k 1 2 ,
k 3 = h f t n + h 2 , y n + k 2 2 ,
k 4 = h f t n + 1 , y n + k 3 ,
y n + 1 = y n + 1 6 k 1 + 2 k 2 + 2 k 3 + k 4 .
Due to its higher order, RK4 generally yields more accurate results than the explicit Euler method for the same time step. However, its fixed-step formulation still limits its effectiveness in oscillatory systems when the time step is not sufficiently small. In this work, RK4 is not used as a training reference but rather as an additional benchmark to assess the generalization capability of the neural-corrected Euler scheme.

3.4. Summary

The explicit Euler method serves as a low-cost baseline, Taylor6 provides a high-order numerical reference, and RK4 offers an intermediate benchmark commonly used in practice. This combination enables a comprehensive evaluation of the proposed neural corrector across methods with different accuracy–cost trade-offs.

4. Methodology: Neural Corrector Framework

This section describes the proposed neural correction strategy for improving the explicit Euler method when applied to the Lotka–Volterra system in an intermediate large time-step regime. The approach is based on learning the local truncation error of Euler’s method with respect to a high-order Taylor reference solution.

Neural Correction of the Euler Step

Let ( N ( t ) , P ( t ) ) denote the exact (or high-fidelity reference) solution of the Lotka–Volterra system and let
( N Euler ( t + Δ t ) , P Euler ( t + Δ t ) )
be the approximation obtained with the explicit Euler method. We define the correction or residual as
Δ ( t ) = N Taylor 6 ( t + Δ t ) N Euler ( t + Δ t ) P Taylor 6 ( t + Δ t ) P Euler ( t + Δ t ) .
The neural network is trained to approximate this residual, i.e.,
Δ ^ ( t ) = NN ( x ( t ) ) Δ ( t ) ,
where x ( t ) denotes a feature vector constructed from the current system state, model parameters, and time-step information, as detailed in the following sections. The corrected solution is given by
N corr ( t + Δ t ) P corr ( t + Δ t ) = N Euler ( t + Δ t ) P Euler ( t + Δ t ) + Δ ^ ( t ) .
When the network accurately predicts the residual, we obtain
( N corr , P corr ) ( t + Δ t ) ( N Taylor 6 , P Taylor 6 ) ( t + Δ t ) ,
meaning that the Euler method, once corrected, behaves like a high-order integrator. This approach constitutes a residual learning scheme, analogous in spirit to ResNet architectures [16], where the network learns exclusively the component that the base explicit integrator fails to capture.

5. Dataset Generation

A synthetic dataset was constructed from numerical simulations of the Lotka–Volterra system to train and evaluate the proposed neural correction framework. The objective was to generate a diverse and representative set of local numerical errors produced by the explicit Euler method under different biological configurations and time-step sizes, enabling the neural networks to learn systematic correction patterns.

5.1. Parameter and Initial Condition Sampling

A total of 100 distinct combinations of model parameters and initial conditions were generated via uniform sampling within the following biologically plausible ranges:
  • Model parameters:
    a [ 0.01 , 0.05 ] ( prey growth rate ) , b [ 0.0005 , 0.002 ] ( predation rate ) , c [ 0.0005 , 0.002 ] ( predator mortality rate ) , d [ 0.01 , 0.03 ] ( conversion efficiency ) .
  • Initial conditions:
    N 0 [ 50 , 150 ] , P 0 [ 10 , 60 ] .
All parameters were sampled independently, producing a wide variety of dynamical behaviors ranging from mild oscillations around equilibrium to large-amplitude predator–prey cycles. This diversity is essential to prevent the neural networks from overfitting to specific trajectories and to promote generalization across the system’s parameter space.

5.2. Time-Step Selection and Dataset Partitioning

The dataset generation process explicitly accounts for the dependence of numerical errors on the time-step size Δ t . Rather than fixing a single step size, four distinct values were considered:
Δ t { 0.5 , 0.8 , 1.0 , 1.1 } .
For each value of Δ t , an independent dataset was generated using the same 100 parameter combinations, and a separate neural network was trained for each time-step size. This strategy avoids forcing a single model to learn corrections across disparate numerical regimes and allows each network to specialize in a specific stability–accuracy trade-off.

5.3. Numerical Integration for Data Generation

For each parameter combination ( a , b , c , d , N 0 , P 0 ) and each selected value of Δ t , the Lotka–Volterra system was integrated over a fixed time horizon using a uniform time step. At each time instant t i , the following quantities were computed:
  • The reference solution obtained using a sixth-order Taylor method (Taylor6),
  • The predictor step obtained using the explicit Euler method.

6. Neural Network Architecture

The neural corrector is implemented as a fully connected residual neural network designed to approximate the local truncation error of the explicit Euler method applied to the Lotka–Volterra system. Rather than learning the system dynamics directly, the network predicts corrective terms that are added to the Euler update, yielding an enhanced numerical integrator.

6.1. Input Features

The input to the network is a 14-dimensional feature vector composed of model parameters, system state variables, and time-step-related quantities. Specifically, the input features are
x = ( a , b , c , d , N 0 , P 0 , t , N Euler , P Euler , Δ t , Δ t 1 , Δ t 2 , Δ t 3 , log ( Δ t ) ) .
This selection enables the network to capture both local and global properties of the dynamical system. Including ( N 0 , P 0 ) allows the network to implicitly identify the orbit scale and long-term energy level of the trajectory.

6.2. Remark on the Inclusion of Initial Conditions

Although the Lotka–Volterra system is autonomous and the current state ( N , P ) uniquely determines the future exact solution, the local truncation error of the Euler method is not a function of the current state alone. It also depends on the global orbit scale (e.g., the amplitude of oscillations), which is determined by the conserved quantity associated with the initial conditions. Two different initial conditions can lead to the same current state ( N , P ) at different phases of their respective orbits, yet the Euler truncation error differs because the curvature of the trajectory and the higher-order derivatives of the flow depend on the orbit’s energy. Including ( N 0 , P 0 ) as global trajectory-level features provides the network with the necessary context to distinguish among orbits and correctly estimate the local error. Ablation experiments confirmed that omitting ( N 0 , P 0 ) degrades correction accuracy, especially for unseen parameter combinations. The inclusion of higher-order transformations of the time step is motivated by the theoretical dependence of the local truncation error of the Euler method on powers of Δ t .

6.3. Output Definition

The network outputs a two-dimensional vector corresponding to the correction terms for the prey and predator populations:
Δ ^ = Δ ^ N Δ ^ P = N Taylor N Euler P Taylor P Euler .
These predicted residuals are added to the Euler solution at each time step, resulting in a corrected numerical approximation of the system state.

6.4. Network Architecture

The network consists of an input layer followed by three residual blocks and a linear output layer. The input layer maps the 14-dimensional feature vector to a latent space of 256 neurons. Each residual block contains two fully connected layers with 256 neurons and identity skip connections. Layer normalization is applied after each residual addition to improve training stability. In total, the architecture comprises eight fully connected layers.

6.5. Architecture Design Considerations

The neural corrector is implemented as a fully connected residual network inspired by ResNet-type architectures [17]. The choice of a residual architecture is motivated by the nature of the learning task itself: rather than approximating the full solution of the dynamical system, the network is trained to learn only the residual error introduced by the explicit Euler method. This formulation transforms the problem into a structured residual learning task, where the target function corresponds to the local truncation error operator of the numerical integrator.
The architecture consists of an input projection layer followed by three residual blocks and a final linear output layer. Each residual block contains two fully connected layers with 256 neurons and identity skip connections. The hidden layers employ the SiLU activation function, selected for its smoothness and stable optimization behavior in continuous dynamical systems. Layer normalization is applied after each residual addition to improve gradient flow and training stability, particularly for large time-step regimes where the truncation error becomes strongly nonlinear.
Importantly, the proposed architecture should not be interpreted as a universal neural solver for arbitrary dynamical systems. The network learns corrections associated with the specific truncation-error structure generated by the explicit Euler method for the considered family of Lotka–Volterra trajectories. Nevertheless, the correction framework itself is not restricted to predator–prey systems. In principle, the same residual-learning strategy could be applied to other nonlinear ordinary differential equations, provided that suitable training data are generated from a reliable high-order reference integrator.
For different systems, however, the neural network would generally require retraining, since the structure of the local truncation error depends strongly on the underlying vector field, the qualitative dynamics, and the numerical stability properties of the system. Chaotic systems, stiff systems, or systems exhibiting sharp transitions may require modified architectures, additional features, or different training strategies.

6.6. Activation Functions and Initialization

All hidden layers employ the SiLU (Sigmoid Linear Unit) activation function, chosen for its smoothness and suitability for learning continuous corrections in dynamical systems. The weights of the input layer are initialized using Kaiming uniform initialization, while the remaining layers use default PyTorch version 2.6.0. initialization. The network is trained to minimize the mean squared error between the predicted and true correction terms, with both inputs and targets normalized to zero mean and unit variance.

6.7. Training Procedure

6.7.1. Parameter Space and Data Generation

Training data are generated using multiple combinations of the Lotka–Volterra parameters ( a , b , c , d ) and initial conditions ( N 0 , P 0 ) , sampled uniformly within predefined admissible ranges. In total, 100 distinct parameter configurations are considered, each corresponding to a unique realization of ( a , b , c , d , N 0 , P 0 ) . These configurations are split into disjoint training, validation, and test sets to ensure genuine parametric generalization.
For each parameter configuration, the system is integrated over a fixed time horizon, producing 1000 consecutive time steps. At each time step, two numerical solutions are computed: (i) a high-order reference solution obtained using a sixth-order Taylor method (Taylor6), and (ii) a first-order predictor obtained using the explicit Euler method with the same time step Δ t .
This procedure yields
100 parameter configurations × 1000 time steps = 100 , 000 training samples .
Separate datasets are generated independently for each time-step size Δ t { 0.5 , 0.8 , 1.0 , 1.1 } , and a distinct neural corrector is trained for each value of Δ t to ensure long-term boundedness and specialization.

6.7.2. Data Splitting

The dataset is randomly divided into training (70%), validation (15%), and test (15%) subsets, ensuring that parameter combinations in the test set are not seen during training.

6.7.3. Loss Function and Optimization

The network is trained by minimizing the mean squared error (MSE) loss between predicted and true normalized residuals:
L = 1 M i = 1 M r ^ i r i 2 2 .
Optimization is performed using the Adam optimizer with an initial learning rate of 5 × 10 4 . A cosine annealing learning rate scheduler is employed, and early stopping is applied based on the validation loss with a patience of 40 epochs.
Figure 1 shows the evolution of training and validation loss for different values of Δ t .

6.8. Neural-Corrected Euler Scheme

Algorithm 1 summarizes the proposed neural-corrected Euler scheme. At each time step, a standard explicit Euler update is first computed. A feature vector is then constructed using the current system state, the Euler prediction, the model parameters, and the time-step size. The trained neural network predicts a correction term that approximates the local truncation error of the Euler method. This correction is subsequently added to the Euler update, yielding an enhanced numerical approximation of the system trajectory.
Algorithm 1: Neural-Corrected Explicit Euler Method
Mathematics 14 02327 i001
The neural corrector operates on a feature vector Φ that encodes the local state of the system, model parameters, and time-step information. Specifically, the input features include the Lotka–Volterra parameters ( a , b , c , d ) , global initial conditions ( N 0 , P 0 ) associated with the trajectory, the current time t n , the explicit Euler prediction ( N n E , P n E ) , and several functions of the time step Δ t , namely Δ t , Δ t 1 , Δ t 2 , Δ t 3 , and log ( Δ t ) .
The quantities ( N 0 , P 0 ) are treated as global trajectory-level features and remain constant throughout the integration process, while t n provides temporal context for the local correction. Although the Lotka–Volterra system is autonomous and the current state theoretically determines the local dynamics, preliminary experiments indicated that including trajectory-level information through the initial conditions improved the robustness and generalization of the neural corrector across trajectories with different oscillation amplitudes and parameter regimes. From this perspective, ( N 0 , P 0 ) should be interpreted as auxiliary contextual features rather than essential dynamical variables.
Here, the feature mapping Φ ( · ) aggregates both local state information and global trajectory-level parameters. This design allows the neural corrector to exploit contextual information while operating locally at each integration step.
Figure 2 illustrates the proposed neural-corrected Euler framework. At each time step, the current state of the system is first advanced using the explicit Euler method. This provisional update is not used as the final solution, but rather serves as the basis for constructing a feature vector that encodes the system parameters, the current state variables, and the time-step information.
The feature vector is then passed to a neural network trained to predict the local truncation error of the Euler method with respect to a high-order reference solution. The network output corresponds to a residual correction, which is added to the Euler update to obtain the corrected state. By learning only the structured numerical error, the neural model preserves the interpretability and simplicity of the underlying integrator while significantly improving its accuracy.
This formulation ensures that the correction operates locally at each time step and remains tightly coupled to the numerical structure of the explicit Euler method, rather than acting as a black-box surrogate for the full dynamical system.

6.9. Simplicity and Computational Cost

Although the proposed method augments the explicit Euler scheme with a neural correction term, the resulting integrator remains conceptually simple. At each time step, the algorithm performs two operations:
  • A standard explicit Euler update,
  • A forward pass through a pre-trained neural network.
No implicit equations, nonlinear solvers, or iterative optimization procedures are required during time integration. Once the neural network has been trained offline, the corrected method retains the fully explicit character of the original Euler scheme.
The per-step computational cost can be written as
C NNE = C Euler + C NN ,
where C Euler denotes the cost of one evaluation of the vector field and C NN represents the cost of a single neural-network inference.
For the low-dimensional Lotka–Volterra system considered in this work, the neural-corrected Euler method is more expensive per step than both the standard Euler and classical RK4 methods. However, the corrected integrator achieves substantially improved accuracy for moderate time-step sizes, which may reduce the total number of time steps required to reach a prescribed error tolerance. Therefore, the main contribution of the proposed framework is not to reduce the cost of a single time step, but rather to enhance the accuracy and qualitative behavior of a simple explicit integrator while preserving its straightforward implementation.

6.10. Interpretation as a Data-Driven Truncation Error Operator

Let x ˙ = f ( x ) be an autonomous smooth dynamical system and let Φ Δ t ( x ) denote its exact flow map at time step Δ t . The explicit Euler method generates the numerical update
x n + 1 E = x n + Δ t f ( x n ) ,
which satisfies the well-known local truncation error expansion
Φ Δ t ( x n ) = x n + Δ t f ( x n ) + O ( Δ t 2 ) .
In this work, the neural corrector is designed to approximate the residual
R Δ t ( x n ) : = Φ Δ t ( x n ) x n + Δ t f ( x n ) ,
which corresponds to the local truncation error operator of the Euler method. Rather than learning the dynamics f itself, the neural network learns a data-driven approximation R ^ Δ t of this residual, leading to the corrected update rule
x n + 1 = x n + Δ t f ( x n ) + R ^ Δ t ( x n ) .
For smooth systems, the residual operator admits a Taylor-type expansion
R Δ t ( x n ) = Δ t 2 2 f ( x n ) f ( x n ) + O ( Δ t 3 ) ,
which provides a formal justification for interpreting the neural corrector as a learned approximation of higher-order terms in the local flow expansion.

6.11. Extension to Multistable Systems

Although the present study focuses on the Lotka–Volterra system, the proposed neural residual correction framework is not restricted to conservative oscillatory dynamics. The method can be applied to nonlinear systems exhibiting multiple coexisting attractors, provided that the training dataset includes representative trajectories from all relevant basins of attraction. Since the network learns the local truncation error of the explicit Euler method rather than the full system dynamics, the approach remains applicable as long as this residual depends smoothly on the state, parameters, and time-step size.
The following proposition provides a heuristic consistency argument illustrating how the learned correction approximates the local truncation error of the explicit Euler method. It is intended to convey the underlying intuition rather than to constitute a complete convergence proof. A rigorous finite-time convergence and stability result, under explicit regularity and Lipschitz assumptions, is presented in Theorem 1.
Proposition 1 (Heuristic consistency interpretation of the neural-corrected scheme).
Assume that the learned corrector R ^ Δ t satisfies
R ^ Δ t ( x ) = O ( Δ t 2 ) uniformly on compact sets .
Then the neural-corrected Euler scheme is formally consistent of order at least two with the exact flow of the system.
Proof. 
The result follows directly from the local error expansion of the exact flow and the definition of the corrected update rule. No global convergence claim is made. □
Remark 1.
The neural-corrected Euler scheme defined in (13) can be interpreted as a data-driven perturbation of the explicit Euler method. Under mild regularity assumptions on the learned correction, it is possible to establish local accuracy and boundedness properties.
Proposition 2.
Assume that the neural correction operator R Δ t satisfies a Lipschitz-type bound of the form
R Δ t ( x ) R Δ t ( y ) C Δ t 2 x y ,
for all x , y in a compact invariant set of the Lotka–Volterra system, where C > 0 is a constant independent of Δ t . Then, the neural-corrected Euler method achieves second-order local accuracy and preserves boundedness of trajectories over finite time intervals.
Proof. 
The explicit Euler method has a local truncation error of order O ( Δ t 2 ) . By construction, the neural corrector is trained to approximate this leading-order truncation error with respect to a high-order reference solution. Condition (16) ensures that the correction does not amplify perturbations and acts as a stable second-order perturbation of the Euler update.
Standard arguments based on Grönwall-type inequalities imply that the accumulated error remains bounded over finite time horizons, provided the numerical trajectory stays within a compact set. This behavior is consistent with the empirical stability and boundedness observed in the numerical experiments reported in Section 7. □

6.12. Connection with Modified Equation Theory and Backward Error Analysis

From the perspective of classical numerical analysis, the behavior of a numerical integrator can be interpreted through its associated modified equation, as introduced in backward error analysis [18]. Rather than approximating the original differential equation x ˙ = f ( x ) exactly, a numerical method can be viewed as exactly integrating a nearby perturbed system of the form
x ˙ = f ( x ) + Δ t g 1 ( x ) + Δ t 2 g 2 ( x ) + ,
where the correction terms g k ( x ) encode the truncation error structure of the method.
For the explicit Euler method, the leading-order term of the modified equation is well known:
x ˙ = f ( x ) + Δ t 2 f ( x ) f ( x ) + O ( Δ t 2 ) ,
revealing that Euler introduces systematic perturbations that alter phase and amplitude properties in oscillatory systems.
The neural-corrected Euler scheme proposed in this work can be interpreted as a data-driven approximation of the modified equation flow. Rather than explicitly computing the higher-order operators g k ( x ) through symbolic differentiation or algebraic manipulation, the neural network learns an approximation of the induced truncation-error operator directly from data:
R ^ Δ t ( x ) Φ Δ t ( x ) x + Δ t f ( x ) .
In this sense, the neural corrector implicitly reconstructs the dominant higher-order terms of the modified equation associated with the Euler method, but without requiring an explicit analytical derivation. The resulting corrected scheme may therefore be viewed as an Euler method whose modified equation has been partially compensated through learning.
This interpretation clarifies why the correction is most effective in the intermediate time-step regime. In this range, the leading modified-equation terms dominate the numerical error and exhibit smooth, structured dependence on the system state and parameters. For very small time steps, these terms are negligible, while for excessively large steps the modified-equation expansion itself ceases to be informative.
From this viewpoint, the proposed method bridges classical backward error analysis and modern data-driven modeling: the neural network acts as a flexible surrogate for truncation-error operators that are traditionally derived through formal series expansions.
Theorem 1
(Consistency and finite-time stability of the neural-corrected Euler scheme). Let x ( t ) = f ( x ( t ) ) with f C 1 ( R d ) , and let Φ Δ t ( x ) denote the exact flow map of the system over a time step Δ t > 0 . Define the local truncation error of the explicit Euler method as
R Δ t ( x ) : = Φ Δ t ( x ) x + Δ t f ( x ) .
Consider the neural-corrected Euler scheme
x n + 1 = x n + Δ t f ( x n ) + R ^ Δ t ( x n ) ,
where R ^ Δ t is a learned correction operator.
Assume that there exists a compact set K R d such that Φ t ( K ) K for all t [ 0 , T ] , and that for all x , y K the following conditions hold:
(H1)
R ^ Δ t ( x ) C Δ t 2 ,
(H2)
R ^ Δ t ( x ) R ^ Δ t ( y ) C Δ t 2 x y ,
with a constant C > 0 independent of Δ t .
Then:
(i)
The scheme (19) is locally consistent of order at least two.
(ii)
If f is Lipschitz continuous on K with constant L, then the numerical solution satisfies
x ( t n ) x n   C T L e L T 1 Δ t , t n = n Δ t T ,
and the scheme is stable and bounded on the finite time interval [ 0 , T ] .
Proof. 
We proceed in two steps.
Step 1: Local consistency. Since f C 1 , the exact flow admits the Taylor expansion
Φ Δ t ( x ) = x + Δ t f ( x ) + O ( Δ t 2 ) , x K .
Subtracting the corrected Euler update yields
Φ Δ t ( x ) x + Δ t f ( x ) + R ^ Δ t ( x ) = R Δ t ( x ) R ^ Δ t ( x ) .
By definition, R Δ t ( x ) = O ( Δ t 2 ) uniformly on K, and by assumption (H1), R ^ Δ t ( x ) C Δ t 2 . Hence,
Φ Δ t ( x ) x + Δ t f ( x ) + R ^ Δ t ( x ) C T Δ t 2 ,
which establishes local consistency of order at least two.
Step 2: Global error estimate and stability. Define the global error e n : = x ( t n ) x n . Then
e n + 1 = Φ Δ t ( x ( t n ) ) x n + Δ t f ( x n ) + R ^ Δ t ( x n ) = Φ Δ t ( x ( t n ) ) Φ Δ t ( x n ) + Φ Δ t ( x n ) x n Δ t f ( x n ) R ^ Δ t ( x n ) .
Since the flow is Lipschitz continuous on K, we have
Φ Δ t ( u ) Φ Δ t ( v ) ( 1 + L Δ t ) u v , u , v K .
Using the consistency estimate from Step 1, we obtain
e n + 1 ( 1 + L Δ t ) e n + C T Δ t 2 .
Applying a discrete Grönwall inequality yields
e n e L t n e 0 + C T L ( e L t n 1 ) Δ t .
Since e 0 = 0 , the stated bound follows.
Stability with respect to perturbations of the initial data follows similarly from (H2), which ensures that the correction operator acts as a higher-order Lipschitz perturbation of the Euler step. Finally, boundedness on [ 0 , T ] follows from the compact invariance of K and the O ( Δ t ) control of the global error. □

7. Results

This section presents a comprehensive evaluation of the proposed neural-corrected Euler method. We analyze its numerical behavior across different time-step regimes, highlighting accuracy, long-term boundedness, and robustness properties. Unless otherwise stated, quantitative comparisons are primarily based on the mean absolute error (MAE) computed with respect to a high-order reference solution. The results are organized to first assess the method in the small time-step limit, followed by its performance in the intermediate regime where explicit schemes typically degrade. We further compare the proposed approach with classical Runge–Kutta methods and conclude with an analysis of the computational cost associated with each scheme.

7.1. Behavior for Small Time Steps

We begin by analyzing the behavior of the explicit Euler method for small time-step sizes, where classical numerical analysis predicts good agreement with higher-order integrators. This regime is included to establish a baseline and to clarify the limitations of neural correction when the underlying numerical method already provides sufficiently accurate results.
Figure 3 and Figure 4 show representative trajectories of the Lotka–Volterra system obtained using the explicit Euler method and the sixth-order Taylor method for Δ t = 0.01 and Δ t = 0.1 , respectively. In both cases, the two numerical solutions are visually indistinguishable over the simulated time horizon, exhibiting nearly identical oscillation amplitudes, phases, long-term behavior, and minimal MAE.
In this regime, the local truncation error of the Euler method is sufficiently small that error accumulation remains negligible. Consequently, the residuals between Euler and Taylor6 solutions exhibit little structure, offering limited information for a neural model to exploit.
These results highlight an important practical observation: neural correction is unnecessary when the step size is already small enough for classical integrators to perform well. This motivates the focus of the proposed approach on moderate to large time steps, where Euler’s numerical errors become significant and structured, and where a learned correction can meaningfully improve long-term boundedness and accuracy.
To quantify the limited benefit of neural correction in the small time-step regime, we report the mean absolute error (MAE) averaged over 50 randomly sampled parameter combinations. The results in Table 1 confirm that, for sufficiently small values of Δ t , the explicit Euler method already achieves low error levels, leaving little room for improvement through learned correction.

7.2. Performance in the Intermediate Time Step Regime

We now evaluate the performance of the neural-corrected Euler method in the intermediate time-step regime, defined here by Δ t [ 0.5 , 1.1 ] . This regime is particularly challenging: the time step is large enough for explicit Euler to accumulate significant phase and amplitude errors, yet not so large that the numerical solution immediately becomes unstable.
Table 2 reports the mean absolute error (MAE) averaged over 50 independent parameter configurations, together with the corresponding standard deviation. Across all tested values of Δ t , the neural corrector consistently reduces the error in both prey and predator populations. For Δ t = 0.5 , the corrected method lowers the average MAE by approximately a factor of three relative to plain Euler, while also reducing error variability. As the time step increases to Δ t = 0.8 and Δ t = 1.0 , the corrector continues to suppress the systematic error growth of Euler, achieving roughly a two- to three-fold reduction in MAE.
Even in the most demanding case Δ t = 1.1 , where explicit Euler exhibits substantial error accumulation over long horizons, the neural-corrected scheme remains stable and achieves a significant reduction in both mean error and dispersion. This indicates that the network has learned a robust approximation of the dominant truncation error structure of Euler, rather than relying on fine-tuned corrections valid only for small step sizes.
The qualitative trajectory plots further support these findings. While plain Euler trajectories progressively drift in phase and amplitude as Δ t increases, the neural-corrected trajectories remain closely aligned with the Taylor order-6 reference over the entire integration interval. Taken together, these results demonstrate that the proposed neural corrector is particularly effective in the intermediate time-step regime, where classical low-order methods fail and high-order solvers may be computationally undesirable.
Figure 5 illustrates representative trajectories in the intermediate time-step regime for increasing values of Δ t . In each case, the neural-corrected Euler trajectory is compared against both the raw Euler solution and the Taylor order-6 reference.

7.3. A Representative Case at Δ t = 1.2

Since the summary statistics in Table 2 are reported over 50 unseen parameter configurations for Δ t 1.1 , we additionally provide a representative unseen test case at Δ t = 1.2 to illustrate the behavior of the corrector in a larger-step regime.
Figure 6 illustrates the trajectories obtained for this representative unseen configuration at Δ t = 1.2 . The neural-corrected Euler solution remains significantly closer to the Taylor6 reference than the standard Euler approximation.
For completeness, we also examine the behavior of the neural corrector in the small time-step regime, where the explicit Euler method is already highly accurate. In this setting, little improvement is expected, and an effective corrector should preserve the base solution without introducing spurious dynamics.
As illustrated in Figure 7, for Δ t = 0.1 and Δ t = 0.01 , the trajectories produced by explicit Euler, neural-corrected Euler, and the Taylor order-6 reference are nearly indistinguishable. This confirms that the learned model does not over-correct when the truncation error of Euler is already negligible, and acts as a stable identity mapping in regimes where correction is unnecessary.
Table 3. Representative test case at Δ t = 1.2 with parameters a = 0.0432487 , b = 0.00122765 , c = 0.000754945 , d = 0.0177671 , N 0 = 67.0939 , P 0 = 30.2070 .
Table 3. Representative test case at Δ t = 1.2 with parameters a = 0.0432487 , b = 0.00122765 , c = 0.000754945 , d = 0.0177671 , N 0 = 67.0939 , P 0 = 30.2070 .
MethodMAE PreyMAE Predator
Euler13.578313.9214
NN3.71054.0930

7.4. Phase Portrait Preservation

Beyond pointwise error metrics, the qualitative structure of the trajectories is crucial for oscillatory systems. Figure 8 compares phase portraits obtained with explicit Euler, neural-corrected Euler, and the Taylor6 reference.
The neural-corrected trajectories remain bounded and preserve the characteristic predator–prey phase portrait. However, they exhibit mild inward spiraling (artificial damping). This occurs because the network is trained to minimize MSE without any conservation constraint; it learns to “pull” the Euler trajectory back toward the reference, inadvertently introducing a slight dissipative bias. Despite this, the corrected scheme is qualitatively far superior to plain Euler in the intermediate Δ t regime (where Euler fails entirely). If exact invariant preservation is required, a physics-informed loss term or symplectic architecture could be added in future work. For the present purpose—stable, bounded long-term integration—the mild damping is acceptable.

7.5. Comparison with Runge–Kutta Methods

In this section, the performance of the proposed neural-corrected Euler scheme is evaluated against the classical fourth-order Runge–Kutta (RK4) method, as a practical high-order benchmark rather than as an exact reference. The objective of this comparison is not to outperform RK4 in general, but to extend the practical usability of Euler-type schemes in regimes where Euler alone fails and higher-order methods are undesirable.
All numerical experiments are performed using identical initial conditions and parameter sets. The RK4 method is applied with the same time-step size as the Euler-based methods in order to ensure a fair comparison. Accuracy is evaluated by comparing the resulting trajectories with respect to the RK4 solution.
Figure 9 presents the system trajectories obtained using the standard Euler method, the neural-corrected Euler scheme, and the RK4 method for two representative time-step sizes, namely Δ t = 1 and Δ t = 0.5 . These values correspond to regimes in which the explicit Euler method is known to suffer from significant numerical errors.
For both time-step sizes, the standard Euler method exhibits noticeable deviations from the trajectories produced by RK4, manifested as phase shifts and amplitude errors. In contrast, the neural-corrected Euler scheme substantially improves the numerical behavior, producing trajectories that remain qualitatively close to those generated by RK4 over the entire simulation interval. These results indicate that the learned correction effectively compensates for the dominant truncation error of the Euler method, particularly in the intermediate and large time-step regimes. It is important to emphasize that RK4 is used here solely as an additional benchmark for qualitative comparison, whereas the neural correction itself is trained with respect to the Taylor6 reference solution introduced earlier.

7.6. Computational Cost per Time Step

To complement the accuracy and stability analysis presented above, we evaluate the computational cost of the considered numerical schemes. Table 4 reports the average wall-clock time per integration step for explicit Euler, classical fourth-order Runge–Kutta (RK4), and the proposed neural-corrected Euler method, measured for different values of the time step Δ t . All benchmarks were performed on CPU using single-step inference without batching, in order to reflect a conservative and transparent implementation setting.
As expected, explicit Euler exhibits the lowest per-step computational cost, since it requires a single evaluation of the vector field and minimal arithmetic operations. The RK4 method incurs a higher cost, approximately 4–7× that of Euler, due to its four evaluations of the right-hand side per step.
The neural-corrected Euler method introduces a larger per-step overhead, typically between 60 × and 100 × that of explicit Euler. This increase is primarily due to neural network inference (feature construction, normalization, and evaluation of several fully connected layers). The per-step cost of the neural correction is almost independent of Δ t , as expected for a fixed network architecture.
However, a direct per-step comparison with Euler is misleading in the regime where this method is intended to be used. For Δ t 0.8 , the explicit Euler method does not produce bounded or qualitatively correct trajectories (see Table 2 and Figure 5). In this regime, a practitioner cannot simply use Euler with the same large Δ t ˘ as the simulation would be useless. The relevant alternatives are:
  • Euler with a much smaller Δ t (e.g., Δ t = 0.01 ), which requires 80–100× more steps to cover the same time horizon, or
  • Higher-order methods such as RK4, which remain stable but require more work per step.
Therefore, the efficiency of the neural-corrected Euler method must be evaluated in terms of total computational time to achieve a given accuracy, not per-step cost. Table 5 shows this trade-off: for a fixed final time, the neural-corrected Euler (operating at Δ t = 1.0 ) achieves a global error that is two orders of magnitude smaller than Euler at Δ t = 0.01 , while requiring only slightly more total time than RK4. Moreover, the neural correction is amortisable: once trained, it can be reused across many simulations (e.g., parameter sweeps, ensemble forecasts) with no additional training cost. In GPU-based or batched implementations, the relative overhead of neural inference drops significantly, making the method even more competitive.
Moreover, the reported overhead corresponds to a conservative implementation on CPU without batching or hardware acceleration. In scenarios involving more expensive vector field evaluations, higher-dimensional systems, or batched and GPU-based inference, the relative cost of the neural correction is expected to decrease, making the proposed method increasingly competitive.
These results highlight that per-step computational cost alone does not fully characterize the efficiency of a numerical integrator. When total integration time and achieved accuracy are jointly considered, the proposed neural-corrected Euler scheme offers a competitive alternative to classical methods.

8. Discussion

This work proposes a neural residual correction framework designed to enhance the explicit Euler method when applied to oscillatory dynamical systems, with a particular focus on the Lotka–Volterra equations. The results demonstrate that learning the local truncation error of Euler with respect to a high-order reference integrator can substantially improve both accuracy and long-term qualitative behavior, especially in regimes where classical low-order methods are known to fail [2].

8.1. Why the Neural Corrector Works

The effectiveness of the proposed approach stems from its formulation as a residual learning problem. Rather than approximating the solution of the differential system directly, the network is trained to predict the systematic error introduced by the explicit Euler update, in a manner analogous to residual learning strategies in deep networks [16]. This error exhibits strong and repeatable structure, depending on the system parameters, the current state, and the time-step size. By learning this structured truncation error, the network compensates for the dominant source of numerical inaccuracy while preserving the simplicity of the underlying integrator, consistent with recent approaches that learn corrections to numerical solvers [8,19].
Importantly, the correction operates locally at each time step, yet yields global improvements over long integration horizons. This indicates that the network captures not only instantaneous error patterns but also the mechanisms responsible for cumulative phase drift and amplitude inflation in Euler trajectories. The observed stabilization of long-term dynamics suggests that the learned correction implicitly mitigates the destabilizing energy injection typically associated with explicit Euler methods in conservative or near-conservative systems [18].
The mild inward spiraling observed in some phase portraits suggests a small dissipative bias introduced by the correction. While this effect slightly alters the invariant structure of the Lotka–Volterra system, it remains acceptable for applications where qualitative stability and boundedness are prioritized over exact conservation. Future work could mitigate this behavior by incorporating invariant-aware loss terms or soft conservation constraints during training.

8.2. Accuracy Across Time-Step Regimes

The numerical experiments highlight three distinct regimes. For small time steps, where explicit Euler already achieves high accuracy, the neural corrector behaves as a near-identity mapping, introducing no artificial distortion and preserving the reference dynamics. This property is crucial, as it confirms that the network does not over-correct when the base method is sufficient.
In the intermediate time-step regime, the proposed approach delivers its most significant benefits. Here, explicit Euler accumulates substantial phase and amplitude errors, while the neural-corrected scheme consistently reduces both the mean error and its variability across parameter configurations. This regime is particularly relevant in practice, as it represents a compromise between computational efficiency and long-term boundedness.
Although MAE is used as the primary quantitative metric throughout this study, the corrected trajectories also preserve the qualitative phase portrait structure of the Lotka–Volterra system, maintaining closed orbits and preventing the artificial spiraling behavior typically induced by explicit Euler at moderate and large time steps, in agreement with classical results on structure preservation in numerical integration [18].

8.3. Generalization and Robustness

A key result of this study is the strong generalization performance observed on unseen parameter sets.
Generalization was assessed by evaluating the neural-corrected scheme on parameter combinations not seen during training. Although the correction degrades gracefully outside the training range, performance remains stable as long as the qualitative dynamics of the system are preserved. The neural-corrected trajectories remain closely aligned with the high-order Taylor reference even for parameter combinations not encountered during training. This suggests that the network learns general properties of the Euler truncation error rather than memorizing specific trajectories, a behavior consistent with operator-learning frameworks for parametric dynamical systems [17,20]. Overfitting was mitigated through the use of moderate network depth, residual connections, normalization layers, and early stopping based on validation loss.
Furthermore, the corrector exhibits robustness across different dynamical regimes, including large-amplitude oscillations and parameter configurations far from equilibrium. Such behavior supports the interpretation of the model as a solver-informed correction mechanism, rather than a purely data-driven surrogate, aligning with the broader paradigm of theory-guided machine learning [21].

8.4. Computational Cost and Practical Regimes

One of the principal advantages of the explicit Euler method is its simplicity and extremely low computational cost. By introducing a neural residual corrector, the proposed framework necessarily increases the computational complexity of each integration step due to the additional neural-network evaluation. As shown in Table 4, the corrected method is significantly more expensive per step than the standard Euler scheme.
However, such a comparison is not entirely meaningful in isolation. In the intermediate and large time-step regimes considered in this work, the explicit Euler method often fails to produce bounded or qualitatively meaningful trajectories, regardless of its low per-step cost. Consequently, the relevant comparison is not with Euler itself, but with higher-order integrators capable of maintaining acceptable long-term behavior [2].
From this perspective, the proposed framework should not be interpreted as a universal replacement for optimized high-order solvers such as RK4, but rather as a proof-of-concept hybrid numerical–machine learning approach for learning truncation-error corrections. The additional computational cost represents a trade-off for improved qualitative accuracy and enhanced long-term boundedness in regimes where the explicit Euler method alone exhibits substantial numerical degradation.
An additional advantage of the framework lies in cost amortization. The neural corrector is trained offline and can subsequently be reused across multiple simulations with different initial conditions and parameter configurations. Moreover, the online correction stage requires only a forward pass through a relatively lightweight feedforward network, which is well suited for batching and hardware acceleration on modern GPUs.
Future work may further reduce the computational overhead through model compression, reduced architectures, adaptive correction strategies, or operator-learning approaches capable of handling varying time-step regimes within a single model.

8.5. Limitations and Future Work

Despite its effectiveness, the proposed approach has several limitations. First, the neural corrector is trained independently for each fixed time-step size Δ t , requiring a separate model for each integration regime. While this design improves specialization and long-term boundedness in the targeted intermediate time-step regime, it limits practical flexibility in applications where adaptive time-stepping strategies are commonly employed. In particular, the current framework does not support dynamically varying time steps during integration, since the learned correction is specialized to the truncation-error structure associated with a specific Δ t .
This limitation reflects an intentional design choice rather than a theoretical restriction. Preliminary experiments indicated that training a single network across substantially different time-step regimes led to degraded performance and reduced robustness, likely due to the distinct qualitative error structures exhibited by the explicit Euler method as Δ t varies. By training specialized models, the network can more effectively learn the dominant truncation-error operator associated with a given numerical regime. Nevertheless, extending the framework toward adaptive or continuous-in- Δ t correction models constitutes an important direction for future work. Possible approaches include incorporating Δ t directly as a continuous input feature, training multi-regime neural operators, or employing operator-learning architectures capable of generalizing across varying discretization scales [17,20]. Such extensions could significantly improve the practical applicability of neural-corrected integrators in realistic simulation settings.
Second, the present study focuses on a two-dimensional autonomous Lotka–Volterra system. Although the proposed residual correction framework is not inherently restricted to this particular model, the trained neural network itself should not be interpreted as universally transferable across arbitrary nonlinear systems. The learned correction depends strongly on the underlying vector field, the numerical stability properties of the system, and the specific truncation-error structure produced by the explicit Euler method. Consequently, different nonlinear systems would generally require retraining and, in some cases, modified feature representations or network architectures.
The framework could potentially be extended to higher-dimensional, stiff, chaotic, or multistable systems. In particular, systems exhibiting multistability may involve distinct attractors and qualitatively different dynamical regimes, which could alter the structure of the numerical truncation error. In such settings, trajectory-level information such as the initial conditions may help the neural corrector distinguish between different basins of attraction. However, multistable and chaotic dynamics may also introduce additional challenges related to regime switching, long-term stability preservation, and geometric structure conservation, which remain important directions for future investigation.
Additionally, rigorous theoretical guarantees concerning the long-term boundedness and qualitative behavior of neural-corrected integrators remain largely unexplored and warrant further mathematical investigation.
Nonetheless, the results presented here indicate that neural residual correction constitutes a promising and interpretable pathway for enhancing classical numerical solvers, combining the robustness of established integration schemes with the adaptability of modern machine learning techniques.
For chaotic systems such as the Lorenz system, the selection of the time-step size requires additional care. The step size should not be chosen merely to maximize computational speed, but rather to identify an intermediate regime in which the explicit Euler error is sufficiently structured to be learned while the uncorrected trajectory remains bounded and dynamically meaningful. Very small time steps leave little room for neural correction, whereas excessively large time steps may cause the Euler trajectory to leave the attractor or enter dynamically unrelated regions. In such systems, the corrected scheme should be assessed over finite prediction horizons and through qualitative or statistical quantities, such as attractor preservation, boundedness, invariant-measure statistics, or Lyapunov-type indicators, rather than by long-time pointwise agreement alone.

9. Conclusions

The main contribution of this work is not to provide a universally faster integrator, but to demonstrate that the local truncation error of the explicit Euler method can be learned and corrected in a numerically interpretable manner.
This work introduced a neural residual correction framework aimed at enhancing the explicit Euler method for the numerical integration of the Lotka–Volterra system under intermediate and large time-step sizes. By learning the local truncation error of Euler with respect to a high-order Taylor reference, the proposed approach significantly improves numerical accuracy while preserving the simplicity and interpretability of the base integrator.
Numerical experiments demonstrate that the neural-corrected Euler method consistently reduces phase and amplitude errors across a wide range of time steps and parameter configurations. In the intermediate regime, where explicit Euler is computationally attractive but numerically inaccurate, the proposed method achieves error reductions of up to an order of magnitude relative to the uncorrected scheme. Importantly, the corrector generalizes well to unseen parameter sets and remains stable over long integration horizons, indicating that it captures systematic properties of the Euler truncation error rather than overfitting to specific trajectories.
From a practical standpoint, the proposed framework offers a favorable trade-off between accuracy and computational cost. While the neural corrector introduces additional per-step overhead, it can remain computationally competitive with classical high-order solvers when larger time steps are employed. Moreover, the correction mechanism can be seamlessly integrated into existing Euler-based implementations, making it attractive for large-scale parameter studies and exploratory simulations of oscillatory systems.
Several directions for future work naturally arise from this study. Promising extensions include the development of time-step–adaptive correctors capable of operating across a continuous range of Δ t values within a single model, as well as the application of the approach to higher-dimensional, stiff, or externally forced dynamical systems. Finally, establishing formal stability and convergence guarantees for neural-corrected integrators remains an important open theoretical challenge.
Overall, these results demonstrate that the truncation error of the explicit Euler method exhibits a structured and learnable dependence on the system state, parameters, and time step. By exploiting this structure through neural residual correction, it is possible to substantially extend the practical range of Euler’s method while retaining its simplicity and low computational cost.

Author Contributions

Conceptualization, D.d.J.S.R. and R.D.O.O.; methodology, D.d.J.S.R., R.D.O.O. and A.M.M.R.; software, D.d.J.S.R.; validation, D.d.J.S.R. and A.M.M.R.; formal analysis, D.d.J.S.R. and R.D.O.O.; investigation, D.d.J.S.R.; data curation, D.d.J.S.R.; writing—original draft, D.d.J.S.R.; writing—review and editing, R.D.O.O. and A.M.M.R.; visualization, D.d.J.S.R.; supervision, R.D.O.O. and A.M.M.R. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by Universidad de Cartagena under Resolution Act 036A-2026.

Data Availability Statement

The data presented in this study are openly available in [Github] at [https://github.com/dansuco2/NeuralCorrecterProyect (accessed on 29 December 2025)].

Acknowledgments

The authors acknowledge the support provided by Universidad de Cartagena under Resolution Act 036A-2026.

Conflicts of Interest

The authors declare no conflicts of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript; or in the decision to publish the results.

Appendix A. Validation of the Taylor6 Reference

Although the Taylor6 method does not provide an exact analytical solution, its accuracy was verified against an independent fourth-order Runge–Kutta solver using a significantly smaller time step ( Δ t = 0.01 ). Figure A1 and Figure A2 compare Taylor6 trajectories computed with Δ t = 0.5 and Δ t = 1 , respectively, against the RK4 reference. In both cases, the solutions are visually indistinguishable, and the mean absolute error remains below 10 7 for both prey and predator populations, confirming that Taylor6 provides a sufficiently accurate surrogate reference within the considered regime.
Figure A1. Δ t = 0.5 and parameter set: a = 0.040 , b = 0.0016 , c = 0.00069 , d = 0.019 , N 0 = 87 , P 0 = 56 .
Figure A1. Δ t = 0.5 and parameter set: a = 0.040 , b = 0.0016 , c = 0.00069 , d = 0.019 , N 0 = 87 , P 0 = 56 .
Mathematics 14 02327 g0a1
Figure A2. Δ t = 1 and parameter set: a = 0.038 , b = 0.00096 , c = 0.0017 , d = 0.026 , N 0 = 88 , P 0 = 24 .
Figure A2. Δ t = 1 and parameter set: a = 0.038 , b = 0.00096 , c = 0.0017 , d = 0.026 , N 0 = 88 , P 0 = 24 .
Mathematics 14 02327 g0a2

References

  1. Baker, N.; Alexander, F.; Bremer, T.; Hagberg, A.; Kevrekidis, Y.; Najm, H.; Parashar, M.; Patra, A.; Sethian, J.; Wild, S.; et al. Workshop report on basic research needs for scientific machine learning. arXiv 2019, arXiv:1903.10563. [Google Scholar] [CrossRef] [Scilit]
  2. Hairer, E.; Nørsett, S.P.; Wanner, G. Solving Ordinary Differential Equations I: Nonstiff Problems, 2nd ed.; Springer Series in Computational Mathematics; Springer: Berlin/Heidelberg, Germany, 1993; Volume 8. [Google Scholar] [CrossRef] [Scilit]
  3. Dupont, E.; Doucet, A.; Teh, Y.W. Augmented neural ODEs. arXiv 2019, arXiv:1904.01681. [Google Scholar]
  4. Lotka, A.J. Elements of Physical Biology; Williams & Wilkins: Baltimore, MD, USA, 1925; Reprinted as Elements of Mathematical Biology; Dover: New York, NY, USA, 1956. [Google Scholar]
  5. Volterra, V. Variazioni e fluttuazioni della abbondanza di specie animali in convivenza. Mem. Regia Accad. Naz. Lincei 1926, 2, 31–113. [Google Scholar]
  6. Abgrall, R.; Le Mélédo, E.; Öffner, P.; Torlo, D. Relaxation deferred correction methods and their applications to residual distribution schemes. SMAI J. Comput. Math. 2022, 8, 125–160. [Google Scholar] [CrossRef] [Scilit]
  7. Noorizadegan, A.; Young, D.L.; Hon, Y.C.; Chen, C.S. Power-enhanced residual network for function approximation and physics-informed inverse problems. Appl. Math. Comput. 2024, 480, 128910. [Google Scholar] [CrossRef] [Scilit]
  8. Eshaghi, M.S.; Anitescu, C.; Valizadeh, N.; Wang, Y.; Zhuang, X.; Rabczuk, T. NOWS: Neural operator warm starts for accelerating iterative solvers. arXiv 2025, arXiv:2511.02481. [Google Scholar]
  9. Zhu, M.; Chang, B.; Fu, C. Convolutional neural networks combined with Runge–Kutta methods. Neural Comput. Appl. 2022, 35, 1629–1643. [Google Scholar] [CrossRef] [Scilit]
  10. Annuš, N.; Kmeť, T. Hybrid physics-informed neural network correction of the Lotka–Volterra model under noisy conditions: Sensitivity analysis of the λ parameter. Appl. Sci. 2025, 15, 12316. [Google Scholar] [CrossRef] [Scilit]
  11. Qarariyah, A.; Yang, T.; Deng, F. An intelligent SPH framework based on machine-learned residual correction for elliptic PDEs. Algorithms 2025, 18, 803. [Google Scholar] [CrossRef] [Scilit]
  12. Kastoris, D.; Papadopoulos, D.; Giotopoulos, K. Neural network-informed Lotka–Volterra dynamics for cryptocurrency market analysis. Future Internet 2025, 17, 327. [Google Scholar] [CrossRef] [Scilit]
  13. Vo, V.T.; Noeiaghdam, S.; Sidorov, D.; Dreglea, A.; Wang, L. Solving nonlinear energy supply and demand system using physics-informed neural networks. Computation 2025, 13, 13. [Google Scholar] [CrossRef] [Scilit]
  14. Koics, D.; Kovács, E.; Hornyák, O. Effects of OpenCL-based parallelization methods on explicit numerical methods to solve the heat equation. Computers 2024, 13, 250. [Google Scholar] [CrossRef] [Scilit]
  15. Massaroli, S.; Poli, M.; Park, J.; Yamashita, A.; Asama, H. Dissecting neural ODEs. arXiv 2020, arXiv:2002.08071. [Google Scholar]
  16. He, K.; Zhang, X.; Ren, S.; Sun, J. Deep residual learning for image recognition. arXiv 2015, arXiv:1512.03385. [Google Scholar]
  17. Li, Z.; Liu, K.; Song, Y.; Yue, H.; Zuazua, E. Deep neural ODE operator networks for PDEs. arXiv 2025, arXiv:2510.15651. [Google Scholar]
  18. Hairer, E.; Lubich, C.; Wanner, G. Geometric Numerical Integration: Structure-Preserving Algorithms for Ordinary Differential Equations; Springer: Berlin/Heidelberg, Germany, 2006. [Google Scholar]
  19. Kochkov, D.; Smith, J.A.; Alieva, A.; Wang, Q.; Brenner, M.P.; Hoyer, S. Machine learning-accelerated computational fluid dynamics. Proc. Natl. Acad. Sci. USA 2021, 118, e2101784118. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  20. Lu, L.; Jin, P.; Pang, G.; Zhang, Z.; Karniadakis, G.E. Learning nonlinear operators via DeepONet based on the universal approximation theorem of operators. Nat. Mach. Intell. 2021, 3, 218–229. [Google Scholar] [CrossRef] [Scilit]
  21. Karpatne, A.; Atluri, G.; Faghmous, J.H.; Steinbach, M.S.; Banerjee, A.; Ganguly, A.R.; Shekhar, S.; Samatova, N.F.; Kumar, V. Theory-guided data science: A new paradigm for scientific discovery. arXiv 2016, arXiv:1612.08544. [Google Scholar]
Figure 1. Training and validation loss histories of the neural corrector for different values of the time step Δ t . Each subplot corresponds to a distinct training dataset generated at a fixed Δ t , illustrating the convergence behavior and generalization performance of the network across step sizes.
Figure 1. Training and validation loss histories of the neural corrector for different values of the time step Δ t . Each subplot corresponds to a distinct training dataset generated at a fixed Δ t , illustrating the convergence behavior and generalization performance of the network across step sizes.
Mathematics 14 02327 g001
Figure 2. Schematic overview of the neural-corrected Euler framework. Starting from the current state, an explicit Euler update is computed and used to construct a feature vector encoding the system parameters, state variables, and time-step information. A neural network then predicts a residual correction, which is added to the Euler update to obtain the corrected state.
Figure 2. Schematic overview of the neural-corrected Euler framework. Starting from the current state, an explicit Euler update is computed and used to construct a feature vector encoding the system parameters, state variables, and time-step information. A neural network then predicts a residual correction, which is added to the Euler update to obtain the corrected state.
Mathematics 14 02327 g002
Figure 3. Comparison between the explicit Euler method and the Taylor6 reference solution for Δ t = 0.01 and parameter set: a = 0.037 , b = 0.0010 , c = 0.0014 , d = 0.026 , N 0 = 82 , and P 0 = 28 . Both methods produce nearly identical predator–prey trajectories, yielding low mean absolute error (MAE) values of 0.22 for the prey population and 0.30 for the predator population.
Figure 3. Comparison between the explicit Euler method and the Taylor6 reference solution for Δ t = 0.01 and parameter set: a = 0.037 , b = 0.0010 , c = 0.0014 , d = 0.026 , N 0 = 82 , and P 0 = 28 . Both methods produce nearly identical predator–prey trajectories, yielding low mean absolute error (MAE) values of 0.22 for the prey population and 0.30 for the predator population.
Mathematics 14 02327 g003
Figure 4. Comparison between the explicit Euler method and the Taylor6 reference solution for Δ t = 0.1 and parameter set: a = 0.034 , b = 0.0019 , c = 0.0007 , d = 0.026 , N 0 = 140 , P 0 = 35 . The solutions remain in close agreement, with negligible phase drift or amplitude distortion and mean absolute error (MAE) values of 3.37 for the prey population and 1.33 for the predator population.
Figure 4. Comparison between the explicit Euler method and the Taylor6 reference solution for Δ t = 0.1 and parameter set: a = 0.034 , b = 0.0019 , c = 0.0007 , d = 0.026 , N 0 = 140 , P 0 = 35 . The solutions remain in close agreement, with negligible phase drift or amplitude distortion and mean absolute error (MAE) values of 3.37 for the prey population and 1.33 for the predator population.
Mathematics 14 02327 g004
Figure 5. Representative predator–prey trajectories in the intermediate time-step regime. For each value of Δ t , the neural-corrected Euler solution remains closely aligned with the Taylor order-6 reference, while the explicit Euler method exhibits increasing phase and amplitude errors as the time step grows.
Figure 5. Representative predator–prey trajectories in the intermediate time-step regime. For each value of Δ t , the neural-corrected Euler solution remains closely aligned with the Taylor order-6 reference, while the explicit Euler method exhibits increasing phase and amplitude errors as the time step grows.
Mathematics 14 02327 g005
Figure 6. Trajectories at Δ t = 1.2 for the representative unseen configuration in Table 3.
Figure 6. Trajectories at Δ t = 1.2 for the representative unseen configuration in Table 3.
Mathematics 14 02327 g006
Figure 7. Trajectories in the small time-step regime. For both Δ t = 0.1 and Δ t = 0.01 , explicit Euler, neural-corrected Euler, and the Taylor order-6 reference produce nearly identical solutions, indicating that the neural corrector preserves accuracy and does not introduce artificial distortions when correction is unnecessary.
Figure 7. Trajectories in the small time-step regime. For both Δ t = 0.1 and Δ t = 0.01 , explicit Euler, neural-corrected Euler, and the Taylor order-6 reference produce nearly identical solutions, indicating that the neural corrector preserves accuracy and does not introduce artificial distortions when correction is unnecessary.
Mathematics 14 02327 g007
Figure 8. Phase portraits comparing explicit Euler, Taylor6, and neural-corrected Euler solutions for different time-step sizes Δ t . While the neural-corrected trajectories may exhibit mild spiral-like behavior, the overall predator–prey phase structure remains consistent with the high-order reference, particularly in regimes where explicit Euler deteriorates.
Figure 8. Phase portraits comparing explicit Euler, Taylor6, and neural-corrected Euler solutions for different time-step sizes Δ t . While the neural-corrected trajectories may exhibit mild spiral-like behavior, the overall predator–prey phase structure remains consistent with the high-order reference, particularly in regimes where explicit Euler deteriorates.
Mathematics 14 02327 g008
Figure 9. Comparison of numerical solutions obtained with the explicit Euler method, the neural-corrected Euler scheme, and the RK4 method for two different time-step sizes. The neural correction significantly reduces the error of the Euler method and yields trajectories that closely follow the RK4 reference solution.
Figure 9. Comparison of numerical solutions obtained with the explicit Euler method, the neural-corrected Euler scheme, and the RK4 method for two different time-step sizes. The neural correction significantly reduces the error of the Euler method and yields trajectories that closely follow the RK4 reference solution.
Mathematics 14 02327 g009
Table 1. Average mean absolute error (MAE) for prey and predator populations in the small time-step regime, computed over 50 unseen parameter combinations. For Δ t = 0.01 and Δ t = 0.1 , the explicit Euler method closely matches the high-order reference solution, resulting in low errors and limited potential for neural correction. Reported values correspond to mean ± standard deviation across all test cases.
Table 1. Average mean absolute error (MAE) for prey and predator populations in the small time-step regime, computed over 50 unseen parameter combinations. For Δ t = 0.01 and Δ t = 0.1 , the explicit Euler method closely matches the high-order reference solution, resulting in low errors and limited potential for neural correction. Reported values correspond to mean ± standard deviation across all test cases.
Δ t Average MAE PreyAverage MAE Predator
0.010.22 ± 0.250.34 ± 0.49
0.11.70 ± 2.112.76 ± 3.62
Table 2. Average MAE (mean ± standard deviation) over 50 unseen parameter combinations for explicit Euler and neural-corrected Euler in the intermediate time-step regime.
Table 2. Average MAE (mean ± standard deviation) over 50 unseen parameter combinations for explicit Euler and neural-corrected Euler in the intermediate time-step regime.
Method Δ t Average MAE PreyAverage MAE Predator
Euler0.59.35 ± 6.6113.21 ± 12.46
NN0.52.51 ± 2.213.67 ± 3.64
Euler0.812.83 ± 8.3618.17 ± 15.95
NN0.83.74 ± 2.917.22 ± 5.10
Euler114.31 ± 8.7220.09 ± 16.04
NN14.68 ± 3.546.75 ± 6.47
Euler1.114.66 ± 8.5021.02 ± 16.41
NN1.15.06 ± 3.3510.02 ± 6.45
Table 4. Average wall-clock time per integration step for explicit Euler, classical RK4, and the neural-corrected Euler method, for different values of the time step Δ t . The last two columns report the computational cost relative to explicit Euler.
Table 4. Average wall-clock time per integration step for explicit Euler, classical RK4, and the neural-corrected Euler method, for different values of the time step Δ t . The last two columns report the computational cost relative to explicit Euler.
Δ t Euler (s/Step)RK4 (s/Step)NN (s/Step)RK4/EulerNN/Euler
0.51.72 × 10−51.11 × 10−41.16 × 10−36.47×67.58×
0.81.45 × 10−54.93 × 10−58.81 × 10−43.41×60.92×
18.96 × 10−65.21 × 10−58.78 × 10−45.82×98.07×
1.14.62 × 10−62.92 × 10−54.56 × 10−46.32×98.79×
Table 5. Global mean absolute error versus total wall-clock time required to integrate the system up to a fixed final time T. While the neural-corrected Euler method incurs a higher per-step cost, the use of larger time steps results in a competitive trade-off between accuracy and total computational time.
Table 5. Global mean absolute error versus total wall-clock time required to integrate the system up to a fixed final time T. While the neural-corrected Euler method incurs a higher per-step cost, the use of larger time steps results in a competitive trade-off between accuracy and total computational time.
MethodTotal Time (s)Global MAE
Euler0.05781.58 × 10 2
RK40.01425.87 × 10 4
NN-Euler0.02154.35 × 10 3
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Ramírez, D.d.J.S.; Ortiz, R.D.O.; Marín Ramírez, A.M. A Neural Residual Correction of the Explicit Euler Method via Learned Truncation Error Operators: A Lotka–Volterra Case Study. Mathematics 2026, 14, 2327. https://doi.org/10.3390/math14132327

AMA Style

Ramírez DdJS, Ortiz RDO, Marín Ramírez AM. A Neural Residual Correction of the Explicit Euler Method via Learned Truncation Error Operators: A Lotka–Volterra Case Study. Mathematics. 2026; 14(13):2327. https://doi.org/10.3390/math14132327

Chicago/Turabian Style

Ramírez, Daniel de Jesús Sierra, Rubén Darío Ortiz Ortiz, and Ana Magnolia Marín Ramírez. 2026. "A Neural Residual Correction of the Explicit Euler Method via Learned Truncation Error Operators: A Lotka–Volterra Case Study" Mathematics 14, no. 13: 2327. https://doi.org/10.3390/math14132327

APA Style

Ramírez, D. d. J. S., Ortiz, R. D. O., & Marín Ramírez, A. M. (2026). A Neural Residual Correction of the Explicit Euler Method via Learned Truncation Error Operators: A Lotka–Volterra Case Study. Mathematics, 14(13), 2327. https://doi.org/10.3390/math14132327

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