System identification method, system and device based on PINN architecture
Through the system identification method based on PINN architecture, the X network and TC network combined with Transformer encoder are used to solve the problem of insufficient accuracy and stability in large-scale complex systems, and the precise identification and prediction of system dynamics are achieved, and the reliability and computing efficiency of control strategies are improved.
Patent Information
- Application Number
- CN202510369189.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-27
- Publication Date
- 2025-07-04
AI Technical Summary
When traditional manual modeling methods face large-scale, complex nonlinear systems or highly coupled multiphysical scenarios, it is difficult to fully capture the complex role relationship between system variables, resulting in a decrease in model accuracy and stability, affecting the reliability and computational efficiency of control strategies.
The system identification method based on PINN architecture is adopted to construct smooth state functions through X networks and extract differential information, combine with TC networks to identify and predict system dynamics parameters, and use Transformer encoder and automatic differential technology to learn system dynamics models and constrain physical laws to reduce dependence on precise mathematical models.
It realizes accurate state reconstruction and differential information capture of complex systems, improves prediction accuracy and stability, adapts to changes in complex environments, reduces computing burden, and improves the accuracy and efficiency of control strategies.
Smart Images

Figure CN120255340A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of system identification, and in particular to a system identification method, system and device based on a PINN architecture. Background Art
[0002] Currently, when the scale of the system model is too large, traditional manual modeling and solving methods will face great challenges. Manual modeling not only requires a large amount of professional knowledge and experience, but also in the modeling process, engineers need to select and adjust various assumptions and parameters of the system. Although these methods can provide effective control in smaller-scale systems, when the dimension and complexity of the system increase, the difficulty of manual modeling increases sharply. Especially in the face of complex non-linear systems or highly coupled multi-physical scenarios, traditional modeling methods often struggle to comprehensively consider all dynamic changes, which may lead to large deviations in the model, thereby affecting the accuracy and reliability of the control strategy.
[0003] The implicit coupling relationship within the system is also a factor that cannot be ignored. In many complex systems, the interaction between variables is often much more complex than what appears on the surface, and the interaction between variables usually exhibits characteristics such as non-linearity and implicit coupling. Traditional modeling methods often struggle to comprehensively capture these deep interactions, so the accuracy of the model may be greatly reduced. This error not only affects the output result of the system, but may also make the control system unstable, or even cause the system to get out of control, leading to serious safety hazards.
[0004] Especially in practical applications, the model predictive control method (Model Predictive Control, MPC) is more dependent on the system model. Especially when the system model is inaccurate, it is more likely to lead to a significant decline in the control effect. For example, in a changing environmental condition, the parameters of the system may change, or due to external interference, the behavior of the system may deviate. If the system model fails to accurately reflect these changes, the prediction ability of MPC will be greatly weakened, resulting in incorrect optimization decisions, and thus unable to provide an effective control strategy; at the same time, the computational complexity is always an urgent problem to be solved. Especially in multi-variable, large-scale and real-time control systems, the computational burden becomes heavier. As the dimension of the system state and control variables continues to increase, the optimization problem of MPC often becomes a high-dimensional non-linear constrained optimization problem. Such problems not only require efficient optimization algorithms, but also a powerful numerical computing framework to support fast solution. Summary of the Invention
[0005] The purpose of the present invention is to provide a system identification method, system and device based on a PINN architecture to solve at least one of the above technical problems existing in the prior art.
[0006] In a first aspect, to solve the above technical problems, the present invention provides a system identification method based on a PINN architecture, comprising the following steps: Step 1: Determine the state variables and control variables ; Step 2: During the normal operation of the controlled system, collect state variable data and control variable data with time marks; Step 3: Train the control model through the state variable data and control variable data. The control model includes an X network and a TC network; the X network is used to construct a smooth and physically meaningful state function and extract differential information ; the TC network is used to identify and predict the system dynamics parameters for the state function and differential information ; Step 4: Use the trained TC network as the system dynamics model to predict the variables of the controlled system.
[0007] In this way, a system dynamics model that can comprehensively capture the complex interaction relationships between various variables can be obtained, so as to predict the control parameters of various specific control models.
[0008] In a feasible implementation, the X network includes a first feedforward layer, a first connection layer, and an automatic differentiation layer arranged in sequence; The first feedforward layer is used to receive the time series of state variables and learn to obtain the state function ; The first connection layer is used to connect the scalars separately output in the feedforward layer to obtain a reconstructed state vector; The automatic differentiation layer is used to take the derivative of the state vector to obtain differential information ;
[0009] In a feasible implementation, the TC network includes a second connection layer, an input embedding layer, a segment encoding layer, a position encoding layer, a Transformer encoder, a second feedforward layer, and an output layer arranged in sequence; The second connection layer is used to connect the control variables with the corresponding state vector to obtain a connection vector; The input embedding layer is used to perform feature processing on the connection vector to obtain a feature vector; The segmented encoding layer is used to add segmented information encoding to the feature vector; the position encoding layer is used to add position information encoding to the feature vector; in this way, it is convenient for subsequent modules to distinguish the identities and orders of different parameters and different data sub-blocks; The Transformer encoder includes N stacked basic modules, and each basic module includes a multi-head self-attention layer, a first residual and normalization layer, a third feed-forward layer, and a second residual and normalization layer arranged in sequence; The multi-head self-attention layer is used to globally focus on the mutual correlation of all elements in the feature vector in the time dimension; The first residual and normalization layer includes two input ends: the first input end is connected to the output end of the multi-head self-attention layer; the second input end is connected to the input end of the multi-head self-attention layer; in this way, the residual connection and normalization before and after the multi-head self-attention layer can be realized, so as to stabilize the training and improve the information flow; The third feed-forward layer is used to perform non-linear transformation on the features generated by the multi-head self-attention layer; The second residual and normalization layer includes two input ends: the first input end is connected to the output end of the third feed-forward layer; the second input end is connected to the input end of the third feed-forward layer; in this way, the residual connection and normalization before and after the third feed-forward layer can be realized, so as to further stabilize the training and improve the information flow; The second feed-forward layer is used to perform non-linear transformation on the features generated by the Transformer encoder; The output layer includes three input ends: the first input end is connected to the output end of the second feed-forward layer; the second input end is used to receive the state vector; the third input end is used to receive the differential information output by the X network; the output layer is used to perform post-processing calculation on the output result of the second feed-forward layer to obtain a prediction result; the post-processing calculation includes using the differential information output by the X network as a physical law constraint.
[0010] In a feasible implementation manner, the specific calculation formula of the output layer can be: ; where, represents the first parameter to be fitted; represents the second parameter to be fitted; represents the function to be fitted; represents all the parameters to be trained in the Transformer encoder; In this way, by combining with the known physical laws at the prediction output end, the TC network can not only learn function fitting in a "black box" manner from the data, but also use physical law constraints, such as the decay term of The influencing items are incorporated into the prediction process to improve the interpretability and reliability of model prediction; Of course, in other embodiments, the Transformer encoder can also be replaced by other machine learning architectures; the specific calculation formula of the output layer can also be replaced by other state space equations describing the control object to achieve similar technical effects.
[0011] In a feasible embodiment, the loss function of the X network includes a state reconstruction error (StateReconstruction Loss), and the specific formula can be: ; Where, represents the state reconstruction error; represents the predicted value of the state variable by the X network; represents the true value (label) of the state variable.
[0012] In a feasible embodiment, the loss function of the TC network includes a physical consistency loss, and the specific formula is: ; Where, represents the physical consistency loss; in this way, the TC network can learn the parameters to be fitted closer to the physical laws , and the function to be fitted .
[0013] In a feasible embodiment, the training method of the control model includes: Step a1, based on the existing state variable data, train the X network by minimizing the loss function, so as to obtain a stable and better-performing reconstruction state model (i.e., the X network) and high-quality differential information; Step a2, unify the timestamps, and use the timestamp of the control variable data as the input of the X network to obtain the state variable and differential information at the corresponding time point; Step a3, based on the state variable and differential information , train the TC network by minimizing the loss function, so that the TC network can learn to accurately predict and parameterize the system dynamics under the constraints of physical laws.
[0014] In a feasible embodiment, the specific method for predicting the variables of the controlled system in step 4 includes: Step b1, construct the state equation of the controlled system, and the specific formula is: ; Wherein, represents the derivative with respect to time; represents the state variable vector of the controlled system; Step b2: At each reference point, perform Taylor expansion on the state equation, retain the constant term and the linear term, and ignore the high-order terms, to obtain the expansion equation as: ; Wherein, represents the reference point; At each reference point on the planned path, the state equation of the controlled system is: ; Subtract these two equations to obtain an ordinary differential equation (ODE), specifically: ; Step b3: Discretize the ordinary differential equation to meet the discretization requirements of the variable relationship in predictive control, to obtain the discretization formula as: ; Wherein, represents the difference vector between the actual state variable and the reference state variable at time ; represents the difference between the actual control variable and the reference control variable at time ; represents the sampling period; represents the identity matrix; Denote as matrix , and denote as matrix ; Step b4: Use the TC network as the solver for the state equation, and predict the output matrix based on the input matrix of the TC network; the input matrix includes the state variable and the control variable at the input time; the output matrix includes the differential information at the corresponding time; based on the input matrix and the output matrix, through matrix operations, obtain matrix and matrix ; Step b5: Based on matrix A and matrix B, calculate the difference between the actual state variable and the reference state variable at the next time through the discretization formula in step b3; in this way, the automatic differentiation function of the PyTorch tool can be fully utilized to obtain the two Jacobian matrices of the output and input of the TC network, so as to conveniently, quickly and accurately calculate the matrix and matrix , and then calculate to obtain the accurate , thereby realizing the precise control of the controlled system and avoiding problems such as high difficulty, high cost, and poor accuracy during manual solution.
[0015] In a feasible implementation manner, the specific method for predicting the variables of the controlled system in step 4 further includes a control optimization method, specifically including: Step b6: Add the differences in the future sub-sampling periods to obtain the cost function , specifically: ; Among them, , and all represent the corresponding weight matrices, and are set as diagonal matrices for subsequent analysis; Step b7: Based on the discretization formula, after introducing the gain rate, construct the overall recurrence formula, specifically: ; Among them, represents the state variable difference parameter matrix, and the specific expression is: ; represents the control variable difference parameter matrix, and the specific expression is: ; Among them, represents the gain rate, and the numerical range is ; In this way, it is beneficial for the system dynamics model to focus on long-term losses and enable the control to converge faster; Step b8: Substitute the overall recurrence formula into the cost function to obtain the derived cost function as: ; Among them, , and all represent the corresponding parameter weight matrices; and there are: ; ; ; Among them, represents the matrix space of the weight matrix , represents the matrix space of the weight matrix , and there are: ; Step b9: Remove the constant term in the cost function to obtain the simplified cost function , specifically as follows: ; Due to the convex optimization theory, there is a uniquely determined such that the gradient is 0, and at the same time achieves the minimum value. Therefore, let the gradient be 0, and the calculation formula for the control variable difference vector is obtained as: ; wherein, represents the concat form of the difference between the actual control variable and the reference control variable at time , that is: ; Take the first in to calculate the optimal input value of the control variable at time ; wherein, represents the control variable value of the reference point at time ; In this way, continuously promoting the control process makes the optimal input value of the control variable change continuously, so that the state variable will quickly approach the reference value at the reference point, and further achieve the technical effect of control optimization.
[0016] In the second aspect, based on the same inventive concept, the present application also provides a system identification system based on the PINN architecture, including a data receiving module, a data processing module, and a result generating module; The data receiving module is used to collect state variable data and control variable data with time stamps during the normal operation of the controlled system; The data processing module includes a model unit and a prediction unit; The model unit trains a control model through the state variable data and the control variable data. The control model includes an X network and a TC network; the X network is used to construct a smooth and physically meaningful state function and extract differential information ; the TC network is used to identify and predict the system dynamics parameters for the state function and the differential information ; The prediction unit uses the trained TC network as a system dynamics model to predict the variables of the controlled system. The result generation module is used to send out the prediction result.
[0017] In a third aspect, based on the same inventive concept, the present application further provides a system identification device based on the PINN architecture, including a processor, a memory, and a bus. The memory stores instructions and data that can be read by the processor. The processor is used to call the instructions and data in the memory to execute the system identification method based on the PINN architecture as described above. The bus is connected between each functional component for transmitting information.
[0018] Adopting the above technical solutions, the present invention has the following beneficial effects: The system identification method, system, and device based on the PINN architecture provided by the present invention perform system identification based on the physics-informed neural network architecture, and then realize model predictive control; by combining the state of the continuous system dynamics with the data-driven deep learning architecture, the reconstruction and prediction of the system state are realized; based on the differential equation constraint and automatic differentiation technology, the rapid identification and approximation of the system dynamics model are realized. Especially for MPC, this solution is based on a deep learning framework (such as Transformer), and automatically learns the system dynamics model through the historical data of the controlled system, rather than relying on traditional mathematical modeling methods. Therefore, when facing complex nonlinear systems, this solution can perform adaptive adjustment and reduce the dependence on accurate mathematical models; this solution incorporates differential equation constraints into the neural network architecture, thereby retaining the physical law rules during the learning process, and further making the prediction results more in line with the actual dynamic behavior; this solution combines the PINN architecture and automatic differentiation technology, which can accurately capture the system state and its differential information, improving the accuracy and stability of the prediction. Description of the Drawings
[0019] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0020] Figure 1 It is a flowchart of a system identification method based on the PINN architecture provided by an embodiment of the present invention; Figure 2 It is an X network architecture diagram provided by an embodiment of the present invention; Figure 3 It is a TC network architecture diagram provided by an embodiment of the present invention; Figure 4A system identification system diagram based on the PINN architecture provided by an embodiment of the present invention. Detailed implementation manners
[0021] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Apparently, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0022] In the description of the present invention, it should be noted that the orientation or positional relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus should not be construed as a limitation of the present invention. In addition, the terms "first", "second", and "third" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance.
[0023] In the description of the present invention, it should be noted that unless otherwise clearly defined and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium, and it can be the communication inside two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific situations.
[0024] The present invention will be further explained and illustrated below in conjunction with specific implementation manners.
[0025] It should also be noted that the following specific embodiments or specific implementation manners are a series of optimized setting manners listed by the present invention to further explain the specific invention content, and these setting manners can be combined with each other or used in association with each other.
[0026] Embodiment 1: As Figure 1 shown, a system identification method based on the PINN architecture provided in this embodiment includes the following steps: Step 1: Determine the state variables and control variables ; Step 2: During the normal operation of the controlled system, collect the state variable data and control variable data with time marks. Step 3: Train a control model using state variable data and control variable data. The control model includes an X network (X net) and a TC network (TC net). The X network is used to construct a smooth state function with physical meaning and extract differential information (such as velocity, acceleration, etc.). The TC network is used to identify and predict the system dynamics parameters for the state function and differential information . Step 4: Use the trained TC network as the system dynamics model to predict the variables of the controlled system.
[0027] In this way, a system dynamics model that can comprehensively capture the complex interaction relationships between variables can be obtained, so as to predict the control parameters of various specific control models.
[0028] Furthermore, as Figure 2 shown, the X network includes a first feed-forward layer (Feed Forward), a first connection layer (concat), and an automatic differentiation layer arranged in sequence; The first feed-forward layer is used to receive the time series of state variables and learn an appropriate state function ; The first connection layer is used to connect the scalars separately output in the feed-forward layer to obtain a reconstructed state vector; The automatic differentiation layer is used to take the derivative of the state vector to obtain differential information .
[0029] Furthermore, as Figure 3 shown, the TC network includes a second connection layer, an input embedding layer (Input Embedding), a segment encoding layer (Segment Encoding), a positional encoding layer (PositionalEncoding), a Transformer encoder, a second feed-forward layer, and an output layer arranged in sequence; The second connection layer is used to connect the control variable with the corresponding state vector to obtain a connection vector; The input embedding layer is used to perform feature processing on the connection vector to obtain a feature vector; The segment encoding layer is used to add segment information encoding to the feature vector. The positional encoding layer is used to add positional information encoding to the feature vector. In this way, it is convenient for subsequent modules to distinguish the identities and orders of different parameters and different data sub-blocks; The Transformer encoder includes N stacked basic modules, and each basic module includes a multi-head self-attention layer (Multi-Head Attention), a first residual and normalization layer (Add&Norm), a third feed-forward layer, and a second residual and normalization layer arranged in sequence; The multi-head self-attention layer is used to globally focus on the mutual correlation of all elements in the feature vector in the time dimension; The first residual and normalization layer includes two input ends: the first input end is connected to the output end of the multi-head self-attention layer; the second input end is connected to the input end of the multi-head self-attention layer; in this way, the residual connection and normalization before and after the multi-head self-attention layer can be realized, so as to stabilize the training and enhance the information flow; The third feed-forward layer is used to perform non-linear transformation on the features generated by the multi-head self-attention layer; The second residual and normalization layer includes two input ends: the first input end is connected to the output end of the third feed-forward layer; the second input end is connected to the input end of the third feed-forward layer; in this way, the residual connection and normalization before and after the third feed-forward layer can be realized, so as to further stabilize the training and enhance the information flow; The second feed-forward layer is used to perform non-linear transformation on the features generated by the Transformer encoder; The output layer includes three input ends: the first input end is connected to the output end of the second feed-forward layer; the second input end is used to receive the state vector; the third input end is used to receive the differential information output by the X network; the output layer is used to perform post-processing calculation on the output result (output) of the second feed-forward layer to obtain the prediction result (prediction); the post-processing calculation includes using the differential information output by the X network as the physical law constraint (Physical Label).
[0030] Further, the segmented information encoding refers to encoding according to category information, specifically including: setting the category of the state variable to 0, setting the category of the control variable to 1, and then converting it into corresponding high-dimensional information through the embedding layer and adding it to the feature vector.
[0031] Further, the position information encoding refers to encoding according to the absolute position, specifically including: after setting the maximum vector length, assigning the elements at different positions in the feature vector according to the encoding values calculated by the sine and cosine formulas, obtaining the corresponding high-dimensional information, and adding it to the feature vector.
[0032] Further, the specific calculation formula of the output layer can be: ; Among them, represents the first parameter to be fitted; Represents the second parameter to be fitted; Represents the function to be fitted; Represents all the parameters to be trained in the Transformer encoder; Represents time; In this way, by combining with known physical laws at the prediction output end, the TC network can not only learn function fitting in a "black box" manner from data, but also incorporate physical law constraints, such as the decay term of the influence term of into the prediction process, improving the interpretability and reliability of model prediction;
[0033] Furthermore, the loss function of the X network includes the state reconstruction error (State ReconstructionLoss), and the specific formula can be: ; where, represents the state reconstruction error; represents the predicted value of the state variable by the X network; represents the true value (label) of the state variable.
[0034] Furthermore, the loss function of the TC network includes the physical consistency loss, and the specific formula is: ; where, represents the physical consistency loss; in this way, the TC network can learn the parameters to be fitted , and the function to be fitted more closely to the physical laws.
[0035] Furthermore, the training method of the control model includes: Step a1: Based on the existing state variable data, train the X network by minimizing the loss function, so as to obtain a stable and well-performing reconstructed state model (i.e., the X network) and high-quality differential information; Step a2: Unify the timestamps, take the timestamp of the control variable data as the input of the X network, and obtain the state variable and differential information at the corresponding time point; Step a3: Based on the state variable and differential information By minimizing the loss function, the TC network is trained so that the TC network learns to accurately predict system dynamics and identify parameters under the constraints of physical laws.
[0036] Furthermore, the optimization method of the control model includes: updating the parameters of the X network and the TC network based on gradient calculation through an optimizer, such as Adam or L-BFGS.
[0037] Furthermore, the training method also includes improving the stability of the training process through conventional methods such as learning rate scheduling and / or early stopping strategy and / or gradient clipping.
[0038] Furthermore, the specific method for predicting the variables of the controlled system in step 4 includes:[[]] Step b1: Construct the state equation of the controlled system, and the specific formula is:[[]] ; Wherein,[[]] represents[[]] the derivative with respect to time; represents the state variable vector of the controlled system; Step b2: At each reference point, perform a Taylor expansion on the state equation, retain the constant term and the linear term, and ignore the high-order terms, to obtain the expansion equation as:[[]] ; Wherein,[[]] represents the reference point; At each reference point on the planned path[[]] the state equation of the controlled system is:[[]] ; Subtract these two equations to obtain an ordinary differential equation (ODE), specifically:[[]] ; Step b3: Discretize the ordinary differential equation to meet the discretization requirements of the variable relationship in predictive control, and obtain the discretization formula as:[[]] ; Wherein,[[]] represents the difference vector between the actual state variable and the reference state variable at time[[]] ; represents the difference between the actual control variable and the reference control variable at time[[]] ; represents the sampling period; represents the identity matrix; Denote[[]] as matrix[[]] , denote as matrix ; Step b4: Take the TC network as the solver of the state equation, and based on the input matrix of the TC network, predict the output matrix; the input matrix includes the state variables and control variables at the input time; the output matrix includes the differential information at the corresponding time; based on the input matrix and the output matrix, through matrix operations, obtain matrix and matrix ; Step b5: Based on matrix A and matrix B, through the discretization formula in step b3, calculate the difference between the actual state variable and the reference state variable at the next time; in this way, the automatic differentiation function of the PyTorch tool can be fully utilized to obtain the two Jacobian matrices of the output and input of the TC network, so as to conveniently, quickly and accurately calculate matrix and matrix , and then calculate the accurate , thus realizing the precise control of the controlled system and avoiding problems such as high difficulty, high cost and poor accuracy in manual solution.
[0039] Furthermore, the specific method for predicting the variables of the controlled system in step 4 further includes a control optimization method, specifically including: Step b6: Add the differences in the future sub-sampling periods to obtain the cost function , specifically: ; where , and all represent the corresponding weight matrices and are set as diagonal matrices for subsequent analysis; Step b7: Based on the discretization formula, after introducing the gain rate, construct the overall recurrence formula, specifically: ; where represents the state variable difference parameter matrix, and the specific expression is: ; represents the control variable difference parameter matrix, and the specific expression is: ; where represents the gain rate, and the numerical range is ; in this way, it is beneficial for the system dynamics model to focus on long-term losses and make the control converge faster; Step b8: Substitute the overall recurrence formula into the cost function to obtain the derived cost function as follows: ; where, 、 and all represent the corresponding parameter weight matrices; and there are: ; ; ; where, represents the matrix space of the weight matrix , represents the matrix space of the weight matrix , and there are: ; Step b9: Remove the constant term from the cost function to obtain the simplified cost function , specifically: ; Since based on the convex optimization theory, there is a uniquely determined such that the gradient is 0, and at the same time the achieves the minimum value, so let the gradient be 0 to obtain the calculation formula for the control variable difference vector as: ; where, represents the concat (concatenation) form of the difference between the actual control variable and the reference control variable at time , that is: ; Take the first in , and calculate the optimal input value of the control variable at time , and the specific formula is: ; where, represents the control variable value of the reference point at time ; In this way, continuously promote the control process to make the optimal input value of the control variable change continuously, so that the state variable will quickly approach the reference value at the reference point, thereby achieving the technical effect of control optimization.
[0040] Example 2: As Figure 4As shown in the figure, this embodiment provides a system identification system based on the PINN architecture, including a data receiving module, a data processing module, and a result generating module; The data receiving module is used to collect state variable data and control variable data with time stamps during the normal operation of the controlled system; The data processing module includes a model unit and a prediction unit; The model unit trains a control model through state variable data and control variable data. The control model includes an X network and a TC network. The X network is used to construct a smooth state function with physical meaning and extract differential information ; The TC network is used to identify and predict the system dynamics parameters for the state function and differential information ; The prediction unit uses the trained TC network as a system dynamics model to predict the variables of the controlled system; The result generating module is used to send the prediction results externally.
[0041] Embodiment 3: This embodiment provides a system identification device based on the PINN architecture, including a processor, a memory, and a bus. The memory stores instructions and data that can be read by the processor. The processor is used to call the instructions and data in the memory to execute the system identification method based on the PINN architecture as described above. The bus is connected between the functional components to transmit information.
[0042] In another implementation of this solution, it can be implemented in the form of an integrated device (such as a chip). The device can include corresponding modules that execute each or several steps in the above embodiments. The modules can be one or more hardware modules specifically configured to execute the corresponding steps, or implemented by a processor configured to execute the corresponding steps, or stored in a computer-readable medium for implementation by the processor, or implemented through a certain combination.
[0043] The processor executes the various methods and processes described above. For example, the method embodiments in this solution can be implemented as a software program, which is tangibly included in a machine-readable medium, such as a memory. In some embodiments, part or all of the software program can be loaded and / or installed via the memory and / or the communication interface. When the software program is loaded into the memory and executed by the processor, one or more steps in the methods described above can be executed. Alternatively, in other embodiments, the processor can be configured to execute one of the above methods in any other suitable manner (such as by means of firmware).
[0044] The device can be implemented using a bus architecture. The bus architecture can include any number of interconnected buses and bridges, depending on the specific application of the hardware and the overall design constraints. The bus connects together various circuits of one or more processors, memories, and / or hardware modules. The bus can also connect various other circuits such as peripheral devices, voltage regulators, power management circuits, external antennas, etc.
[0045] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc.
[0046] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A system identification method based on the PINN architecture, characterized in that, Including: Step 1: Determine the state variables and control variables of the control model and the control variables ; Step 2. During the normal operation of the controlled system, collect the status variable data and control variable data with time marks; Step 3: Train a control model using state variable data and control variable data. The control model includes an X network and a TC network. The X network is used to construct a smooth state function with physical meaning and extract differential information ; The TC network is used to identify and predict system dynamics parameters for the state function and differential information . Step 4: Use the trained TC network as a system dynamics model to predict the variables of the controlled system.
2. The method according to claim 1, characterized in that The X network includes a first feedforward layer, a first connection layer, and an automatic differentiation layer arranged in sequence; The first feedforward layer is used to receive the time series of state variables and learn the state function ; The first connection layer is used to connect the individually output scalars in the feedforward layer to obtain a reconstructed state vector; The automatic micro-layer is used to derive the state vector to obtain differential information .
3. The method according to claim 2, wherein The TC network includes a second connection layer, an input embedding layer, a segment encoding layer, a position encoding layer, a Transformer encoder, a second feedforward layer, and an output layer arranged in sequence; The second connection layer is used to obtain a connection vector after connecting the control variable with the corresponding state vector; The input embedding layer is used to perform feature processing on the connection vector to obtain a feature vector; The segment encoding layer is used to add segment information encoding to the feature vector; the position encoding layer is used to add position information encoding to the feature vector; The Transformer encoder includes N stacked basic modules, and each basic module includes a multi-head self-attention layer, a first residual and normalization layer, a third feedforward layer, and a second residual and normalization layer arranged in sequence; The multi-head self-attention layer is used to globally focus on the mutual correlation of all elements in the feature vector in the time dimension; The first residual and normalization layer includes two input ends: the first input end is connected to the output end of the multi-head self-attention layer; The second input end is connected to the input end of the multi-head self-attention layer; The third feedforward layer is used to perform a non-linear transformation on the features generated by the multi-head self-attention layer; The second residual and normalization layer includes two input ends: the first input end is connected to the output end of the third feedforward layer; The second input end is connected to the input end of the third feedforward layer; The second feedforward layer is used to perform a non-linear transformation on the features generated by the Transformer encoder; The output layer includes three input ends: the first input end is connected to the output end of the second feedforward layer; The second input end is used to receive the state vector; The third input end is used to receive the differential information output by the X network; the output layer is used to perform post-processing calculation on the output result of the second feedforward layer to obtain a prediction result; the post-processing calculation includes using the differential information output by the X network as a physical law constraint.
4. The method according to claim 3, wherein The specific calculation formula of the output layer is: ; Among them, represents the first parameter to be fitted; represents the second parameter to be fitted; represents the function to be fitted; represents all the parameters to be trained in the Transformer encoder.
5. The method according to claim 4, wherein The loss function of the X network includes a state reconstruction error, and the specific formula is: ; Among them, represents the state reconstruction error; represents the predicted value of the state variable by the X network; represents the true value of the state variable.
6. The method according to claim 5, wherein The loss function of the TC network includes a physical consistency loss, and the specific formula is: ; Among them, represents the physical consistency loss.
7. The method according to claim 5, characterized in that, The specific method for predicting the variables of the controlled system in Step 4 includes: Step b1: Construct the state equation of the controlled system, and the specific formula is: ; Among them, denotes the derivative with respect to time; denotes the state variable vector of the controlled system; Step b2: At each reference point, perform a Taylor expansion on the state equation, retain the constant term and the linear term, and ignore the high-order terms, to obtain the expansion equation as: ; Among them, represents the reference point; At each reference point of the planned path the state equation of the controlled system is as follows: ; Subtract these two equations to obtain an ordinary differential equation, specifically: ; Step b3: Perform discretization processing on the ordinary differential equation to obtain the discretization formula as: ; Among them, represents the difference vector between the actual state variable and the reference state variable at time ; represents the difference between the actual control variable and the reference control variable at time ; represents the sampling period; represents the identity matrix. Let be denoted as matrix , and let be denoted as matrix ; Step b4: Use the TC network as the solver for the state equation, and based on the input matrix of the TC network, predict the output matrix; the input matrix includes the state variables and control variables at the input time; the output matrix includes the differential information at the corresponding time; based on the input matrix and the output matrix, through matrix operations, obtain matrix and matrix ; Step b5: Based on matrix A and matrix B, calculate the difference between the actual state variable and the reference state variable at the next moment through the discretization formula in Step b3.
8. The method according to claim 7, wherein The specific method for predicting the variables of the controlled system in Step 4 also includes a control optimization method, specifically including: Step b6: Add the differences in the future sub-sampling periods to obtain a cost function , specifically: ; Among them, , and all represent the corresponding weight matrices and are set as diagonal matrices; Step b7: Based on the discretization formula, after introducing the gain rate, construct the overall recurrence formula, specifically as follows: ; Among them, represents the state variable difference parameter matrix, and the specific expression is: ; Denote the control variable difference parameter matrix, and the specific expression is: ; Among them, represents the gain rate, and the numerical range is ; Step b8: Substitute the overall recurrence formula into the cost function to obtain the derived cost function as follows: ; Among them, , and all represent the corresponding parameter weight matrices; and there are: ; ; ; Among them, represents the matrix space of the weight matrix , represents the matrix space of the weight matrix , and there is: ; Step b9: Remove the constant term in the cost function , and obtain the simplified cost function , specifically: ; Let the gradient be 0, and the calculation formula for the difference vector of the control variable is obtained as follows: ; Among them, represents the concat form of the difference between the actual control variable and the reference control variable at the moment, that is: ; Take the first one in , calculate the optimal input value of the control variable at time , and the specific formula is: ; Among them, represents the reference point at the moment of the control variable value.
9. A system identification system based on the PINN architecture, characterized in that, It includes a data receiving module, a data processing module, and a result generating module; The data receiving module is used to collect status variable data and control variable data with time marks during the normal operation of the controlled system; The data processing module includes a model unit and a prediction unit; The model unit trains a control model through state variable data and control variable data, and the control model includes an X network and a TC network; the X network is used to construct a smooth state function with physical meaning and extract differential information ; the TC network is used to identify and predict system dynamics parameters for the state function and differential information . The prediction unit uses the trained TC network as a system dynamics model to predict the variables of the controlled system; The result generating module is used to send out the prediction results.
10. A system identification device based on the PINN architecture, characterized in that, It includes a processor, a memory, and a bus. The memory stores instructions and data read by the processor. The processor is used to call the instructions and data in the memory to execute the method according to any one of claims 1-8. The bus is connected between the functional components to transmit information.