Next Article in Journal
Relationship between Preoperative Maxillomandibular Transverse Discrepancy and Post-Surgical Stability in Class II Malocclusion
Previous Article in Journal
Investigation of the Effects of Vortex Isolation Plates with Different Opening Ratios and Sizes on Vortex-Induced Vibration
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Identification of High-Order Nonlinear Coupled Systems Using a Data-Driven Approach

by
Rodolfo Daniel Velázquez-Sánchez
1,†,
Jonathan Omega Escobedo-Alva
2,†,
Raymundo Peña-García
1,†,
Ricardo Tapia-Herrera
3,† and
Jesús Alberto Meda-Campaña
1,*,†
1
SEPI ESIME Zacatenco, Instituto Politécnico Nacional, Ciudad de México 07738, Mexico
2
SEPI ESIME Ticomán, Instituto Politécnico Nacional, Ciudad de México 07340, Mexico
3
SEPI ESIME Zacatenco, CONAHCYT—Instituto Politécnico Nacional, Ciudad de México 07738, Mexico
*
Author to whom correspondence should be addressed.
These authors contributed equally to this work.
Appl. Sci. 2024, 14(9), 3864; https://doi.org/10.3390/app14093864
Submission received: 8 March 2024 / Revised: 18 April 2024 / Accepted: 28 April 2024 / Published: 30 April 2024
(This article belongs to the Section Computing and Artificial Intelligence)

Abstract

:
Most works related to the identification of mathematical nonlinear systems suggest that such approaches can always be directly applied to any nonlinear system. This misconception is greatly discouraging when the obtained results are not expected. Thus, the current work hypothesizes that the more information one has about the mathematical structure of the model, the most precise the identification result. Therefore, a variant of the Sparse Identification of Nonlinear Dynamics (SINDY) approach is presented to obtain the full mathematical nonlinear model of a high-order system with coupled dynamics, namely, a commercial quadcopter. Furthermore, due to its high sensitivity to inputs, a control system is devised using the identified model to stabilize the quadcopter. This illustrates the effectiveness of the proposed identification method.

1. Introduction

1.1. Motivation

Understanding the differential equations that govern the dynamics of nonlinear systems in real-time is always considered advantageous in scientific research. However, the availability of accurate mathematical models for such systems is not always guaranteed. Despite the recognized benefits of having access to these equations, practical limitations and inherent complexities often prevent the simple formulation of mathematical representations for real-world nonlinear systems. Consequently, many authors have focused their efforts on the practical identification of mathematical models for nonlinear systems [1].
On the other hand, the continuously growing capabilities of computing and data acquisition equipment have produced an explosion of data-driven models, which in many cases are more appealing than those obtained by analytical modeling approaches [2].
Ahead of the data-driven modeling techniques is Deep Learning (DL) [3,4]. DL has not only shown notable performance in image classification but is also very effective in predicting the future states of dynamical systems. However, its main drawback is the difficulty relating the DL models to the governing equations of the physical systems. A different data-driven approach is based on symbolic regression to obtain the structure of a nonlinear system from data [5]. Although this method identifies the interpretable physical models very well, its main drawback is the computational cost of working with a symbolic regressor, and it grows significantly as the dimension of the problem does. A genetic algorithm, considering the transition matrix in its fitness function, has been successfully applied to identify the physics-based longitudinal dynamics of an aircraft. However, its main drawback is that it is an iterative process strongly dependent on the size of the search region for parameters [6].
In [7], the problem has been restated as sparse identification combined with the Levenberg–Marquardt (LM) algorithm. Tibshirani first introduced the main idea for robust identification, which combines least squares minimization and discrimination through the L 1 norm, and named it Shrinkage Lasso Selection [8]. However, the problem has been simplified even more by the Sparse Identification of Nonlinear Dynamics (SINDY), which combines sparse regression with the advantages of the verified efficacy of the least squares (LS) approach [9,10].
Brunton et al. [9] proposed a method called Sparse Identification of Non-Linear Dynamics in 2016 which transforms a nonlinear model of the form x ˙ = f ( x , u ) , where x R n is the state vector and u R p is the input vector, into an equivalent linear model of the form X ˙ = Θ ( X , U ) Ξ (please refer to Section 2.2 for a more detailed explanation of this concept). This simplifies the nonlinear identification problem to solving a linear system with more equations than unknowns, which is a classical problem in linear algebra, namely, A x = b . This method offers an elegant approach to identifying nonlinear dynamics from data. The method can handle complex systems with perfect data from ideal experiments, as demonstrated in [9]. However, for simulations with imperfect data, the method requires some modifications, which are explained in [9].
The robustness analysis of the method with respect to the choice of “hyperparameters” is presented in [11]. The hyperparameters are related to the Lasso-type optimization, which is a classical optimization problem that uses the L 1 norm instead of the L 2 norm, as described in [12]. The extension of the method to systems with control inputs is discussed in [9]. SINDY has been applied during the identification of the models of complex systems as chaotic attractors, even in the presence of control signals, in a very successful way [9].
However, the original SINDY algorithm proves inadequate for high-order nonlinear systems with coupled dynamics, even when the structure of the mathematical model is known. The limitation arises from the reliance on the least squares approach, favoring the selection of large values over small. Consequently, the SINDY algorithm may exclude functions with small coefficients in nonlinear models where coefficients vary significantly in magnitude. This can result in inaccurate or incomplete models that fail to capture the true dynamics of the system. For instance, in a recent work [13], the authors proposed a modification of the SINDY algorithm, aiming to outperform the classical SINDY approach in constructing a system of ordinary differential equations from stochastic simulations.
Thus, despite the simplicity of SINDY, it requires constant modifications and improvements tailored to each new application. As a result, customized variants of the SINDY algorithm have begun to emerge in the recent literature [14,15,16,17,18].

1.2. Contribution

With this in mind, in the context of a known structure for a high-order nonlinear system with coupled dynamics, this work presents a significant contribution by introducing a simple modification of the SINDY methodology. Specifically, this modification allows the identification of missing coefficients within the known system structure. What distinguishes this contribution is not only its effectiveness but also its minimal computational cost. By seamlessly integrating into the existing SINDY framework, this modification offers a practical solution to a challenging problem, improving the applicability and accuracy of the method without imposing significant computational overhead. Therefore, in addition to improving SINDY’s capabilities for system identification, this work also underlines the importance of efficiency in algorithmic improvements within the field of nonlinear dynamical systems [19,20]. A comparison between the performance of the original algorithm and modified one was carried out by applying both to the identification of the mathematical model of a commercial quadcopter.

1.3. Manuscript Organization

The rest of this paper is organized as follows: In Section 2, the mathematical and numerical tools considered throughout the study are briefly reviewed. In Section 3, the classical SINDY algorithm is employed to identify the high-order nonlinear system with coupled dynamics. In Section 4, the modified algorithm is introduced and employed for the identification of the same system. In Section 5, some important points are discussed. Finally, Section 6 presents the concluding remarks.

2. Mathematical Tools

2.1. LS

The least squares method was introduced by Adrien-Marie Legendre in 1805 [21]. Roughly speaking, the least squares solution for the problem A x = b , where A R m × n , x R n , and  b R m , is a vector x ^ such that dist ( b , A x ^ ) dist ( b , A x ) , for all other vectors x R n , where dist ( b , A x ^ ) = b A x ^ is the square root of the sum of the squares of the elements of the vector b A x ^ . Therefore, a least squares solution minimizes the sum of the squares of the errors between b and A x ^ , hence its name [22].
When the columns of A are linearly independent, the least squares solution of
A x = b
is unique and it is given by [22]:
x ^ = ( A T A ) 1 A T b .
Equivalently, if the n columns of A, namely, a 1 , a 2 , , a n , are orthogonal, then the least squares solution of (1) is [22]:
x ^ = a 1 · b a 1 · a 1 , a 2 · b a 2 · a 2 , , a n · b a n · a n .
Moreover, the  Q R factorization can be applied to the matrix A, and the Gram–Schmidt algorithm can be used to obtain the orthogonal Q and upper triangular R matrices, which can be used to obtain the least squares solution of (1). For a thorough analysis of the least squares method, the  Q R factorization and the Gram–Schmidt algorithm, the reader can refer to [22,23].

2.2. SINDY

In 2016, Brunton et al. [9] introduced Sparse Identification of Nonlinear Dynamics (SINDY), which consists of the simple idea of solving the classical linear problem A x = b but transforming it into
X ˙ = Θ ( X , U ) Ξ ,
where the nonlinear model to be estimated has the form x ˙ = f ( x , u ) , with  x R n and u R p . In this formulation, X R m × n , where the i-th column of X corresponds to a vector formed by the m samples of the i-th state of x, the same applies for X ˙ , and  U R m × p , where the i-th column of U corresponds to a vector formed by the m samples of the i-th control input of u. On the other hand, Θ ( X , U ) R m × q , where each column of Θ ( X , U ) is a candidate function depending on x and/or u, which is evaluated at each one of the m sample instants, and the columns of Ξ R q × n are sparse vectors of coefficients.
The goal is to find the matrix Ξ by means of least squares such that the residual error is minimized. The  Ξ is a matrix of coefficients that determine the active terms in the nonlinear model x ˙ = f ( x , u ) , which can be approximated by a linear combination of candidate functions depending on x and/or u. The pseudocode for SINDY and its interpretation are presented in Appendix A.1 [9,12].

2.3. Mathematical Model of a Quadcopter

A quadcopter or quadrotor is a type of unmanned aerial vehicle (UAV) that has four rotors mounted on a rigid frame. The rotors can generate both lift and torque, which are used to control the position and orientation of the quadrotor. The mathematical model of a quadrotor can be derived using Newtonian and Euler’s laws and applying basic principles of physics. This derivation gives the equations that govern the motion of a quadrotor, both concerning the body frame and the inertial frame.
The configuration space of a quadcopter is defined by six variables: x, y, z, ϕ , θ , and  ψ , where ( x , y , z ) are the coordinates of the center of mass in an inertial frame, and  ( ϕ , θ , ψ ) are the Euler angles that represent the orientation of the body frame with respect to the inertial frame. The actuation space of a quadrotor is defined by four variables: u 1 , u 2 , u 3 , and  u 4 , where u i is the angular velocity of the i-th rotor. The schematics of this aircraft are given in Figure 1. In aeronautics, the convention of measuring elevation or altitude through the negative part of the Z-axis is often a matter of mathematical and geometric consistency. The convention is motivated by the right-hand coordinate system commonly used in aviation and engineering: the X-axis points forward (along the longitudinal axis of the aircraft), the Y-axis points to the right (along the lateral axis), and the Z-axis points downward (along the vertical axis) [24].
The dynamics of a quadcopter can be expressed as [25,26,27,28]:
x ˙ = f ( x , u ) ,
where x = x 1 x 12 T , u = [ u 1 u 4 ] T , and 
x ˙ 1 = x 7 ,
x ˙ 2 = x 8 ,
x ˙ 3 = x 9 ,
x ˙ 4 = x 12 ,
x ˙ 5 = x 11 ,
x ˙ 6 = x 10 ,
x ˙ 7 = β 1 m sin ( x 4 ) sin ( x 6 ) + cos ( x 4 ) cos ( x 6 ) sin ( x 5 ) ,
x ˙ 8 = β 1 m cos ( x 4 ) sin ( x 6 ) cos ( x 6 ) sin ( x 4 ) sin ( x 5 ) ,
x ˙ 9 = β 1 m cos ( x 5 ) cos ( x 6 ) + 9.81 ,
x ˙ 10 = 1 I x x β 2 + ( I y y I z z ) x 11 x 12 ,
x ˙ 11 = 1 I y y β 3 + ( I z z I x x ) x 10 x 12 ,
x ˙ 12 = 1 I z z β 4 + ( I x x I y y ) x 10 x 11 ,
with β 1 as the force responsible for throttle movement, β 2 as the torque responsible for roll movement, β 3 as the torque responsible for pitch movement, and  β 4 as the torque responsible for yaw movement, given by
β 1 = b ( u 1 2 + u 2 2 + u 3 2 + u 4 2 ) ,
β 2 = b ( u 4 2 + u 3 2 u 1 2 u 2 2 ) ,
β 3 = b ( u 2 2 + u 3 2 u 1 2 u 4 2 ) ,
β 4 = d ( u 1 2 + u 3 2 u 2 2 u 4 2 ) , and
Ω = u 1 u 2 + u 3 u 4 .
Notice that u 1 , u 2 , u 3 , and u 4 are the frequencies of rotors 1, 2, 3 and 4, respectively, i.e., they are the implicit control inputs and they are given in rad/s . The variables x 1 , x 2 , and x 3 represent the linear displacements along the earth fixed axes X e , Y e , and Z e , respectively, and they are in meters. On the other hand, the variables x 4 , x 5 , and x 6 describe the angular displacements around the body axes Z b , Y b , and X b , respectively, and they are in radians. The remaining state variables describe the linear and angular velocities, and they can be easily deduced from (5)–(22).

2.4. Simulink Support Package for Parrot Minidrones

The Simulink Support Package for Parrot Minidrones version 20.2.3 is a toolbox that enables users to design and deploy flight control algorithms for Parrot minidrones using Simulink. Users can wirelessly connect to the minidrones via Bluetooth and access their onboard sensors and camera. Users can also use additional tools such as the Aerospace Blockset and Simulink Coder to enhance their simulations and code generation. The toolbox also includes an example that shows how to model and simulate the 6-DOF equations of motion for the minidrones [29,30]. In Figure 2, the physical quadcopter simulated by the Simulink Support Package for Parrot Minidrones is depicted.
This package includes a Controller Project template designed as a framework for crafting a personalized controller or adapting it to specific needs. The template integrates a robust plant model simulation for both the Parrot Rolling Spider and Parrot Mambo drones. This simulation streamlines the evaluation of model outcomes before deployment, empowering users to scrutinize and refine their controller designs prior to applying them to the physical hardware. The template supports the modeling of equations of motion with six degrees of freedom (6-DOF), facilitating the simulation of aircraft behavior under diverse flight and environmental conditions. Figure 3 depicts the VRML environment employed by the Simulink Package for Parrot Minidrones.
It is worth mentioning that the Simulink Support Package for Parrot Minidrones has undergone extensive validation, confirming its high accuracy in approximating the real-time behavior of the Parrot Minidrones. As a result, the identification of the quadcopter’s mathematical model in this study relies heavily on the results generated by the Simulink package.

3. Identification of a High-Order Nonlinear Systems with Coupled Dynamics Using the Classical SINDY Algorithm

In this section, the Algorithm A1 is used to obtain the mathematical model of a quadcopter from the data generated by the Simulink Support Package for Parrot Minidrones.
For the sake of simplicity, throughout the remainder of this study, it is assumed that the Rolling Spider MiniDrone depicted in Figure 2 can be effectively modeled using Equations (5)–(17). In other words, the drone’s controls are considered to be β 1 , β 2 , β 3 , and  β 4 , instead of u 1 , u 2 , u 3 , and  u 4 . Adopting this perspective streamlines the required library of functions for SINDY, specifically the matrix Θ ( X , U ) . Despite this simplification, the resulting nonlinear system maintains sufficient complexity to reveal the limitations of the conventional SINDY approach. This underscores the advantages of the proposed modification, particularly in the identification of high-order nonlinear systems with coupled dynamics.
The Simulink Support Package for Parrot Minidrones is employed to simulate a 10-s flight sequence of the drone, with the sampling time T = 0.005 s . Throughout this duration, the drone undergoes takeoff and ascends to an altitude of 1.5 m. Meanwhile, the controls β 1 , β 2 , β 3 , and  β 4 are subtly perturbed to excite all four independent degrees of freedom of the drone. These inputs are shown in Figure 4.
During this simulated flight, the vectors x 1 , , x 12 , x ˙ 1 , , x ˙ 12 , β 1 , , β 4 R m are formed by reading the linear and angular displacements, linear and angular velocities, linear and angular accelerations, and controls. Clearly, m = 2001 .
So, to correctly formulate Equation (4), consider that the matrix X ˙ is:
X ˙ = x ˙ 1 , , x ˙ 12 ,
while the matrix Θ ( X , U ) is
Θ ( X , U ) = f 1 f 2 f 16 ,
with f 1 = 1 , f 2 = x 7 , f 3 = x 8 , f 4 = x 9 , f 5 = x 10 , f 6 = x 11 , f 7 = x 12 , f 8 = β 1 · ( sin ( x 4 ) · sin ( x 6 ) + cos ( x 4 ) · cos ( x 6 ) · sin ( x 5 ) ) , f 9 = β 1 · ( cos ( x 4 ) · sin ( x 6 ) cos ( x 6 ) · sin ( x 4 ) · sin ( x 5 ) ) , f 10 = β 1 · cos ( x 5 ) · cos ( x 6 ) , f 11 = β 2 , f 12 = x 11 · x 12 , f 13 = β 3 , f 14 = x 10 · x 12 , f 15 = β 4 , f 16 = x 10 · x 11 , where, as mentioned above, x ˙ 1 , , x ˙ 12 , f 1 , , f 16 R 2001 . Thus, the unknown matrix Ξ has a dimension of 16 × 12 .
The MATLAB code for the classical SINDY algorithm, with  T h e t a = Θ ( X , U ) , d X d t = X ˙ , l a m b d a = 1 × 10 3 , and  n = 12 , is given in Appendix A.2.
The matrix Ξ produced is:
Ξ = 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.01 0.18 4.8 1.1 1.1 0.076 0.21 0.2 0.13 1.2 5.6 0.053 9.1 × 10 3 0.018 1.5 × 10 3 0.12 2.4 0.095 0.051 2.3 × 10 3 0.096 0.63 1.3 0.21 0.034 0.14 0.093 0.67 1.2 0.4 0.12 0.071 0.11 0.12 3.8 0.12 0.072 0.064 0.18 1.7 0.14 1.1 15.0 1.3 0.1 8.3 8.5 2.0 0.066 14.0 1.0 5.5 1.6 1.1 0.015 0.27 7.5 2.0 2.9 0.11 1.1 0.52 5.7 8.2 × 10 3 90.0 6.7 0.068 0.027 0.054 2.5 6.2 0.46 0.77 1.1 6.4 2.0 5.9 × 10 3 84.0 0.033 0.13 0.041 4.5 9.6 0.48 2.4 2.3 6.4 30.0 39.0 4.1 × 10 3 0.048 0.069 0.073 1.7 2.2 0.2
It is noteworthy that the obtained identification does not exhibit sparsity, as each function considered in Θ ( X , U ) emerges between the seventh and twelfth equations in the identified model, even when the parameter lambda is not very small (e.g., 1 × 10 3 ). However, even if one were to consider the identified model as a potential representation of the nonlinear dynamics of the drone, a significant limitation becomes apparent: the resulting model is non-controllable. This poses a fundamental issue, given that drones are recognized as controllable systems in the literature [31]. This discrepancy underscores the need for further refinement in the modeling approach to ensure an accurate representation of the controllable nature inherent to drone dynamics.
This example demonstrates that, in general, it is not sufficient to know the functions appearing in the model to be identified for SINDY to yield correct results. The following section addresses and mitigates this drawback.

4. Identification of a High-Order Nonlinear Systems with Coupled Dynamics through the Modified SINDY Algorithm

4.1. GenesisXi Algorithm

At this point, it becomes clear that simply knowing the functions within the model is insufficient. It is also crucial to determine which differential equation each function should correspond to. This shift from model identification to coefficient (parameter) identification is significant, particularly for real-world nonlinear problems.
As a result, modifying the traditional SINDY algorithm involves integrating this additional information. The goal is to refine the results obtained so that they closely resemble known models, such as those from quadrotors, thus improving the applicability and accuracy of the algorithm in real-world scenarios.
To achieve this objective, it is necessary to formulate an initial matrix Ξ 0 wherein the positions of all candidate functions contained in Θ ( X , U ) within the differential equations of the mathematical model are defined. To automate this process, namely, obtaining the aforementioned matrix Ξ 0 , the GenesisXi algorithm is proposed. The pseudocode for this algorithm is described in Appendix A.3, while the corresponding MATLAB function, with  T h e t a _ L = Θ L , is given in Appendix A.4.
Thus, after applying GenesisXi algorithm, and in accordance with (5)–(17), the resulting matrix Ξ 0 is:
Ξ 0 = 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 .
Notice that the columns of Ξ 0 represent the differential equations in the nonlinear model, while the rows of Ξ 0 represent the candidate functions included in Θ ( X , U ) . Thus, the matrix (26) indicates that f 1 appears in the ninth differential equation, f 2 appears only in the second differential equation, and so forth.

4.2. Modified SINDY Algorithm

Now, the location of the candidate functions in the matrix Ξ 0 is passed as a parameter to the modified SINDY function, as illustrated in the MATLAB code presented in Appendix A.5.
The matrix Ξ obtained by applying the MATLAB function provided in Appendix A.5 to the data described in the previous section is:
Ξ = 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4.725 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 14.32 0 0 0 0 0 0 14.29 0 0 0 0 0 0 7.302 0 0 0 0 0 0 8169.0 0 0 0 0 0 2.442 0 0 0 0 0 0 5939 0 0 0 0 0 7.961 0 0 0 0 0 0 4087 0 0 0 0 0 0.09223 .
Unlike the matrix presented in (25), this matrix corresponds to the sparse identification of a high-order nonlinear system characterized by coupled dynamics, specifically exemplified in the context of drone dynamics. Then, the identified nonlinear system is given by:
x ˙ 1 = x 7
x ˙ 2 = x 8
x ˙ 3 = x 9
x ˙ 4 = x 12
x ˙ 5 = x 11
x ˙ 6 = x 10
x ˙ 7 = 14.32 β 1 ( sin ( x 4 ) sin ( x 6 ) + cos ( x 4 ) cos ( x 6 ) s i n ( x 5 ) )
x ˙ 8 = 14.29 β 1 ( cos ( x 4 ) sin ( x 6 ) cos ( x 6 ) sin ( x 4 ) sin ( x 5 ) )
x ˙ 9 = 7.302 β 1 cos ( x 5 ) cos ( x 6 ) + 4.725
x ˙ 10 = 8169 β 2 2.442 x 11 x 12
x ˙ 11 = 5939 β 3 7.961 x 10 x 12
x ˙ 12 = 4087.0 β 4 + 0.09223 x 10 x 11 .
Notice that the gravity value in Equation (36) is calculated as 4.725, which is 2.076 times smaller than 9.81. This implies that the entire equation is scaled by 2.076 1 . However, as per Equations (12)–(14), when the identified model is analyzed at the equilibrium, i.e., when all linear and angular displacements, velocities, and accelerations are zero, and the mass m is computed using Equations (34)–(36) multiplied by 2.076, it results in m = 0.0698 , m = 0.0699 , and  m = 0.0659 , respectively, which are very close to the nominal value found in the literature of m = 0.068 [29,30].
Now, based on these equations, a linear stabilizer is designed. To achieve this, Equations (28)–(39) are linearized at the equilibrium x e q = [ 0 0 0 0 0 0 0 0 0 0 0 0 ] T , resulting in:
x ˙ = A x + B u ,
with
A = 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1.0 0 0 0 0 0 0 9.27 0 0 0 0 0 0 0 0 0 0 0 0 9.247 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ,
and
B = 0 0 0 0 0 0 0 0 7.302 0 0 0 0 0 0 0 0 0 0 0 0 8169 0 0 0 0 0 0 0 0 0 0 0 0 5939 0 0 0 0 0 0 0 0 0 0 0 0 4087 T .
The stabilizer u = K x is obtained using the Linear Quadratic Regulator (LQR) approach, which combines the control energy and the state deviations in the cost function of the form:
J = 0 x T Q x + u T R u d t ,
where Q and R are positive definite matrices determining the compromise between minimizing the state deviations and the control energy [31]. In this case, Q = I [ 12 × 12 ] , and  R = 1 × 10 6 · I [ 4 × 4 ] . Thus, with matrices A, B, Q, and R as above, the gain K is computed using the MATLAB function l q r , resulting in:
K = 0 0 0.001 0 0 0 0 0.001 0 0 0 0.006795 0.001 0 0 0 0.007291 0 0 0 0 0.001 0 0 0 0 0.01658 0 0 0 0 0.001571 0 0.001632 0 0 0.001604 0 0 0 0.001859 0 0 0 0 0 0 0.00122
Then, the stabilizer u = K x is applied to the nonlinear model within the Simulink Support Package for Parrot Minidrones to assess the effectiveness of the identified model. In this example, the quadcopter reaches an altitude of 1 m using the linear stabilizer. The numerical results are presented in Figure 5 and Figure 6. Figure 5 illustrates the drone’s response to the linear stabilizer, while Figure 6 displays the corresponding input signals.
Please note that the goal of this work is not to design sophisticated controllers for complex drone behavior. Instead, the primary contribution of this work is to introduce an alternative method for obtaining the mathematical model of a high-order nonlinear system with coupled dynamics based on real-time measured data.

5. Discussion

1.
In the specific case study, the outcomes achieved through the classical SINDY algorithm do not align with physics-based identification. Moreover, they do not qualify as sparse identification, as all candidate functions are present in the matrix Ξ .
2.
Based on the knowledge of the structure of the complex system to be identified, a more precise algorithm has been introduced without a significant increase in computational cost.
3.
Although the identified model appears to have significant differences from the related model found in the literature, it enables the design of a controller capable of stabilizing the original high-order nonlinear system with coupled dynamics. This, in turn, demonstrates its notable approximation degree.
4.
The primary drawback of the proposed approach is that the identification problem transforms into a coefficient identification task. Nevertheless, in many real-world applications, this outcome may still be appealing because, in numerous cases, it is impossible to precisely determine the coefficients of a specific system, even when the structure of its mathematical model is available.

6. Conclusions

This study presents a modification of the classical SINDY algorithm, facilitating the identification of mathematical models for high-order nonlinear systems with coupled dynamics. Despite its negligible computational cost compared to the benefits it offers, a key requirement is the prior knowledge of the nonlinear model’s structure to generate the template Ξ 0 for correctly placing the nonlinear functions within the respective differential equations. The efficacy of the proposed approach was confirmed through the application of a linear controller, designed based on the identified model, to the real system. Looking ahead, applying this approach to real-time quadcopter data, as opposed to the data provided by MATLAB, would be advantageous. However, this endeavor exceeds the current scope of the study.

Author Contributions

Conceptualization, R.D.V.-S. and J.A.M.-C.; formal analysis, R.P.-G., R.D.V.-S., J.O.E.-A. and R.T.-H.; investigation, J.O.E.-A., R.T.-H. and J.A.M.-C.; methodology, J.O.E.-A., R.T.-H. and J.A.M.-C.; project administration, J.A.M.-C.; writing—original draft, J.A.M.-C.; writing—review and editing, R.D.V.-S., J.O.E.-A., R.P.-G., R.T.-H. and J.A.M.-C. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Informed Consent Statement

Not applicable.

Data Availability Statement

Data are contained within the article.

Acknowledgments

The authors gratefully acknowledge the partial support provided for this research by the Consejo Nacional de Humanidades Ciencias y Tecnologías (CONAHCYT) through the SNI (Sistema Nacional de Investigadores) scholarship. Additionally, the Instituto Politécnico Nacional contributed to this work through research projects 20230023 and 20240025, as well as by providing scholarships under the programs EDI (Estímulo al Desempeño de los Investigadores), COFAA (Comisión de Operación y Fomento de Actividades Académicas), and BEIFI (Beca de Estímulo Institucional de Formación de Investigadores).

Conflicts of Interest

The authors declare no conflicts of interest.

Definitions

ACoefficient matrix for the least squares problem.
bVector of observed or measured values for the least squares problem.
xVector of unknowns for the least squares problem.
x ^ Estimate or optimal solution for the least squares problem.
XMatrix whose columns are the states of the system, and the rows are the values of these states at different sampling instants.
X ˙ Matrix whose columns are the first-time derivatives of the states of the system, and the rows are the values of such derivatives at different sampling instants.
UMatrix whose columns are the input signals of the system, and the rows are the values of such inputs at different sampling instants.
Θ ( X , U ) Matrix whose columns constitute the library of candidate functions, dependent on the states and/or inputs of the nonlinear system. The rows represent the values of these functions at various sampling instants.
Ξ Sparse coefficient matrix that characterizes the importance or contribution of each term in the library of candidate functions (represented by Θ ( X , U ) ) to the dynamics of the system.
Ξ 0 Template for Ξ , representing the structure of the nonlinear systems.

Appendix A. Pseudocodes and MATLAB Functions

Appendix A.1. Classical SINDY Algorithm

The following is a verbal description of Algorithm A1:
  • Given a series of snapshots x R n , u R p and the corresponding time derivatives x ˙ of a dynamical system x ˙ = f ( x , u ) , arrange them into matrices X , X ˙ R m × n , and  U R m × p where m is the number of samples, n is the dimension of the state vector, and p is the dimension of the input vector.
    Algorithm A1 SINDY algorithm
    Require: Data matrix X, U, and derivative matrix X ˙
    Ensure: Sparse model x ˙ = Ξ Θ ( X , U )
     1:Construct a library of candidate functions Θ ( X , U )
     2:Solve the sparse regression problem X ˙ = Θ ( X , U ) Ξ using a sparsity-promoting technique (e.g., LASSO)
     3:Identify the active terms and coefficients in Ξ that form the model
  • Construct a library of nonlinear candidate functions Θ ( X , U ) of size m × q , where q is the number of candidate functions. These functions can be constant, polynomial, trigonometric, or more exotic functions of the x and u.
  • Solve the sparse regression problem X ˙ = Θ ( X , U ) Ξ , where Ξ is a matrix of coefficients of size q × n , by minimizing the objective function
    min Ξ X ˙ Θ ( X , U ) Ξ F 2 + λ Ξ 1 ,
    where · F is the Frobenius norm, · 1 is the l 1 norm, and  λ is a regularization parameter that controls the sparsity of Ξ .
  • Identify the sparse set of active terms in Θ ( X , U ) by selecting the rows of Ξ that have nonzero entries. These terms form the governing equations of the dynamical system:
    x ˙ = f ( x , u ) = i = 1 q ξ i θ i ( x , u ) ,
    where ξ i is the i-th row of Ξ and θ i ( x , u ) is the i-th candidate function.

Appendix A.2. Classical SINDY (MATLAB Code)

Listing A1. MATLAB function for the classical SINDY.
Applsci 14 03864 i001

Appendix A.3. GenesisXi Algorithm

The following is the description of Algorithm A2:
  • Given the vector Θ L R q , whose elements contain the number of the differential equation where the corresponding candidate function should be located, and n, which is the dimension of the nonlinear system to be estimated, the matrix Ξ 0 R q × n is set to zero. For this case, Θ L = [ 9 1 2 3 6 5 4 7 8 9 10 10 11 11 12 12 ] .
  • The vector Θ L is traversed from its first element to the last using the index k, simultaneously placing a “1” at the position ( k , Θ L ( k ) ) in the matrix Ξ 0 .
Algorithm A2 GenesisXi algorithm
Require: 
Data vector Θ L and n
Ensure: 
Initial matrix Ξ 0
 1:
Ξ 0 0 [ q , n ]
 2:
for  k = 1   to  q  do
 3:
        Ξ 0 ( k , Θ L ( k ) ) 1
4:
end for

Appendix A.4. GenesisXi (Matlab Code)

Listing A2. MATLAB function for the GenesisXi algorithm.
Applsci 14 03864 i002

Appendix A.5. Modified SINDY (Matlab Code)

Listing A3. MATLAB function with modifications to classical SINDY.
Applsci 14 03864 i003
Roughly speaking, the modifications consist of removing the functions that wrongly appear in the differential equations after the first guess of the matrix Ξ in line 4. To achieve this, the MATLAB operator “ . * ” is applied to multiply each element of the matrix Ξ obtained in line 4 by the corresponding element of the matrix Ξ 0 . In other words, Ξ 0 is used as a template for the desired matrix Ξ . The remainder of the program follows exactly the structure of the classical SINDY function presented in Listing A2.

References

  1. Editorial. The rise of data-driven modelling. Nat. Rev. Phys. 2021, 3, 845–855. [Google Scholar] [CrossRef]
  2. Moghadas, S.M.; Jaberi-Douraki, M. Mathematical Modelling: A Graduate Textbook; John Wiley & Sons, Inc.: Hoboken, NJ, USA, 2019. [Google Scholar]
  3. Montáns, F.J.; Chinesta, F.; Gómez-Bombarelli, R.; Kutz, J.N. Data-driven modeling and learning in science and engineering. Comptes Rendus Mécanique 2019, 347, 845–855. [Google Scholar] [CrossRef]
  4. Devo, A.; Mao, J.; Costante, G.; Loianno, G. Autonomous Single-Image Drone Exploration with Deep Reinforcement Learning and Mixed Reality. IEEE Robot. Autom. Lett. 2022, 7, 5031–5038. [Google Scholar] [CrossRef]
  5. Schmidt, M.; Lipson, H. Distilling Free-Form Natural Laws from Experimental Data. Science 2009, 324, 81–85. [Google Scholar] [CrossRef] [PubMed]
  6. Peña-García, R.; Velázquez-Sánchez, R.; Gómez-Daza-Argumedo, C.; Escobedo-Alva, J.; Tapia-Herrera, R.; Meda-Campaña, J. Physics-Based Aircraft Dynamics Identification Using Genetic Algorithms. Aerospace 2024, 11, 142. [Google Scholar] [CrossRef]
  7. Haring, M.; Grøtli, E.I.; Riemer-Sørensen, S.; Seel, K.; Hanssen, K.G. A Levenberg–Marquardt Algorithm for Sparse Identification of Dynamical Systems. IEEE Trans. Neural Netw. Learn. Syst. 2022, 34, 9323–9336. [Google Scholar] [CrossRef]
  8. Tibshirani, R. Regression Shrinkage and Selection Via the Lasso. J. R. Stat. Soc. Ser. B (Methodological) 1996, 58, 267–288. [Google Scholar] [CrossRef]
  9. Brunton, S.L.; Proctor, J.L.; Kutz, J.N. Discovering governing equations from data by sparse identification of nonlinear dynamical systems. Proc. Natl. Acad. Sci. USA 2016, 113, 3932–3937. [Google Scholar] [CrossRef] [PubMed]
  10. Hansen, P.C.; Pereyra, V.; Scherer, G. Least Squares Data Fitting with Applications; Johns Hopkins University Press: Baltimore, MD, USA, 2013. [Google Scholar]
  11. Bertrand, Q.; Klopfenstein, Q.; Blondel, M.; Vaiter, S.; Gramfort, A.; Salmon, J. Implicit differentiation of Lasso-type models for hyperparameter optimization. In Proceedings of the 37th International Conference on Machine Learning, Virtual Event, 13–18 July 2020; Daume, H., Singh, A., Eds.; Proceedings of Machine Learning Research. JMLR: Cambridge, MA, USA, 2020; Volume 119, pp. 810–821. [Google Scholar]
  12. Brunton, S.L.; Kutz, J.N. Data-Driven Science and Engineering: Machine Learning, Dynamical Systems, and Control; Cambridge University Press: Cambridge, MA, USA, 2019. [Google Scholar] [CrossRef]
  13. Burrage, P.M.; Weerasinghe, H.N.; Burrage, K. Using a library of chemical reactions to fit systems of ordinary differential equations to agent-based models: A machine learning approach. Numer. Algorithms 2024. [Google Scholar] [CrossRef]
  14. Cao, R.; Lu, Y.; He, Z. System identification method based on interpretable machine learning for unknown aircraft dynamics. Aerosp. Sci. Technol. 2022, 126, 107593. [Google Scholar] [CrossRef]
  15. Callaham, J.L.; Brunton, S.L.; Loiseau, J.C. On the role of nonlinear correlations in reduced-order modelling. J. Fluid Mech. 2022, 938, A1. [Google Scholar] [CrossRef]
  16. Sargsyan, S.; Brunton, S.L.; Kutz, J.N. Nonlinear model reduction for dynamical systems using sparse sensor locations from learned libraries. Phys. Rev. E 2015, 92, 033304. [Google Scholar] [CrossRef]
  17. Loiseau, J.C.; Brunton, S.L. Constrained sparse Galerkin regression. J. Fluid Mech. 2018, 838, 42–67. [Google Scholar] [CrossRef]
  18. Loiseau, J.-C.; Brunton, S.L.; Noack, B.R. 9 From the POD-Galerkin method to sparse manifold models. In Volume 3 Applications; De Gruyter: Berlin, Germany; Boston, MA, USA, 2021; pp. 279–320. [Google Scholar] [CrossRef]
  19. Zavialov, V.; Lobok, O.; Mysiura, T.; Popova, N.; Chornyi, V.; Pohorilyi, T. Identification of unknown parameters of the dynamic model of mass transfer. Math. Model. Anal. 2023, 28, 459–468. [Google Scholar] [CrossRef]
  20. Hritonenko, N.; Satsky, C.; Yatsenko, Y. Integral model of COVID-19 spread and mitigation in UK: Identification of transmission rate. Math. Model. Anal. 2022, 27, 573–589. [Google Scholar] [CrossRef]
  21. Dodge, Y. The Concise Encyclopedia of Statistics-Least-Squares Method; Springer: New York, NY, USA, 2008. [Google Scholar] [CrossRef]
  22. Margalit, D.; Rabinoff, J. Interactive Linear Algebra; Georgia Institute of Technology: Atlanta, GA, USA, 2019. [Google Scholar]
  23. Lay, D.C.; McDonald, J.J.; Lay, S.R. Linear Algebra and Its Applications; Pearson: New York, NY, USA, 2016. [Google Scholar]
  24. Phillips, W.F. Mechanics of Flight; John Wiley and Sons, Inc.: Hoboken, NJ, USA, 1980. [Google Scholar]
  25. Meda-Campaña, J.A.; Torres-Cruz, R.E.; Rojas-Ruiz, A.J.; Tapia-Herrera, R.; Hernández-Cortés, T.; Páramo-Carranza, L.A. The Output Regulation and the Kalman Filter as the Signal Generator. IEEE Access 2023, 11, 90825–90838. [Google Scholar] [CrossRef]
  26. Jennie, Y.; Fathurrahman, A.; Arifianto, O.; Sasongko, R. Mathematical modelling and simulation of a quadrotor unmanned aerial vehicle with automatic altitude and speed control. AIP Conf. Proc. 2020, 2226, 020011. [Google Scholar]
  27. Collazos Morales, C.A.; Ospina, J.P.; Sánchez, J.F.; Caro-Ruiz, C.; Grisales, V.H.; Ariza-Colpas, P.; De-la Hoz-Franco, E.; González, R.E. Mathematical Modelling and Identification of a Quadrotor. In Proceedings of the International Conference on Computational Science and Its Applications, Cagliari, Italy, 1–4 July 2020; Springer: Berlin/Heidelberg, Germany, 2020; pp. 261–275. [Google Scholar]
  28. Mohamed, A.; Elsayed, M.; Elshafei, M. A Comparative Study Between a Classical and Optimal Control of a Quadrotor UAV. arXiv 2020, arXiv:2009.13175. [Google Scholar]
  29. MathWorks. Parrot Minidrones Support from Simulink. 2023. Available online: https://www.mathworks.com/hardware-support/parrot-minidrones.html (accessed on 8 March 2024).
  30. MathWorks. Simulink Support Package for Parrot Minidrones Documentation. 2023. Available online: https://www.mathworks.com/help/supportpkg/parrot/ (accessed on 8 March 2024).
  31. Kailath, T. Linear Systems; Prentice–Hall, Inc.: Hoboken, NJ, USA, 1980. [Google Scholar]
Figure 1. Body diagram of the quadcopter.
Figure 1. Body diagram of the quadcopter.
Applsci 14 03864 g001
Figure 2. Rolling Spider by Parrot Minidrones.
Figure 2. Rolling Spider by Parrot Minidrones.
Applsci 14 03864 g002
Figure 3. Capture of the VRML environment provided by the Simulink Support Package for Parrot Minidrones.
Figure 3. Capture of the VRML environment provided by the Simulink Support Package for Parrot Minidrones.
Applsci 14 03864 g003
Figure 4. Input signals used to excite the four degrees of freedom of the drone.
Figure 4. Input signals used to excite the four degrees of freedom of the drone.
Applsci 14 03864 g004
Figure 5. Quadcopter’s four degrees of freedom with the linear stabilizer.
Figure 5. Quadcopter’s four degrees of freedom with the linear stabilizer.
Applsci 14 03864 g005
Figure 6. Input signals produced by the linear stabilizer.
Figure 6. Input signals produced by the linear stabilizer.
Applsci 14 03864 g006
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

Velázquez-Sánchez, R.D.; Escobedo-Alva, J.O.; Peña-García, R.; Tapia-Herrera, R.; Meda-Campaña, J.A. Identification of High-Order Nonlinear Coupled Systems Using a Data-Driven Approach. Appl. Sci. 2024, 14, 3864. https://doi.org/10.3390/app14093864

AMA Style

Velázquez-Sánchez RD, Escobedo-Alva JO, Peña-García R, Tapia-Herrera R, Meda-Campaña JA. Identification of High-Order Nonlinear Coupled Systems Using a Data-Driven Approach. Applied Sciences. 2024; 14(9):3864. https://doi.org/10.3390/app14093864

Chicago/Turabian Style

Velázquez-Sánchez, Rodolfo Daniel, Jonathan Omega Escobedo-Alva, Raymundo Peña-García, Ricardo Tapia-Herrera, and Jesús Alberto Meda-Campaña. 2024. "Identification of High-Order Nonlinear Coupled Systems Using a Data-Driven Approach" Applied Sciences 14, no. 9: 3864. https://doi.org/10.3390/app14093864

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