Hierarchical nonlinear physical model compilation optimization method and related equipment

By compiling and optimizing the nonlinear physical model in the hierarchical digital twin model, the existing simulation calculation problems are solved, and more efficient and accurate simulation calculations are achieved.

CN119378270BActive Publication Date: 2025-04-29武汉鼎元同立科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411943082.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-04-29
Estimated Expiration
2044-12-27

AI Technical Summary

Technical Problem

When the simulation object is a hierarchical digital twin model, there are existing problems with low simulation computing efficiency and low accuracy of simulation results.

Method used

Provide a hierarchical nonlinear physical model compilation optimization method. By building a hierarchical digital twin physic model of the target physical object, compiling and optimizing the nonlinear equation system in the physical model until the optimized simulation mathematical model meets the preset design requirements.

Benefits of technology

The efficiency and accuracy of simulation calculations are improved, the scale of nonlinear equation systems is reduced, and the simulation calculation efficiency and accuracy of physical models are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119378270B_ABST
    Figure CN119378270B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of digital twin simulation computing technology, and discloses a hierarchical nonlinear physical model compilation optimization method and related equipment. The hierarchical nonlinear physical model compilation optimization includes: building a hierarchical digital twin physical model of the target physical object, and then optimizing the nonlinear equation group contained in the physical model; each time the compilation optimization is completed, the target physical object will be simulated once, and the simulation results will be evaluated in multiple dimensions; if the simulation does not meet the preset design requirements, then based on the compilation optimization information of each nonlinear equation group, the relevant variables and the initial values ​​of the relevant variables in the physical model are redefined, and the nonlinear equation group contained in the physical model is optimized again until the optimized simulation mathematical model meets the preset design requirements. The present invention reduces the scale of the nonlinear equation group that needs to be simulated and calculated for the physical model, thereby improving the simulation calculation efficiency and accuracy of the physical model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of digital twin simulation computing, and in particular to a hierarchical nonlinear physical model compilation optimization method and related equipment. Background Art

[0002] Digital Twin refers to the creation of a virtual copy of a physical entity or system through digital technology to achieve management and optimization of its entire life cycle. The concept of digital twin is not just a static three-dimensional model. It can also be dynamically updated as the physical object changes, and use real-time data for dynamic simulation, prediction and optimization. This concept was originally applied to the fields of manufacturing and Industry 4.0, and has now expanded to multiple industries such as medicine, urban planning, aerospace and energy. This expansion has made digital twin systems increasingly complex and large, greatly increasing the complexity and challenges of digital twin simulation calculations. One of the important values ​​of digital twins is that they can predict the future behavior of the system and use it to realize feedback control of the physical system. Therefore, this technology has high requirements for the real-time performance of simulation calculations. In order to meet this challenge, simulation calculations need to be continuously optimized in terms of model compilation and computing efficiency.

[0003] Actual physical entities or systems are usually composed of several subsystems, and subsystems can be further decomposed into smaller granular components such as parts and assemblies. Therefore, digital twin physical models built based on object-oriented methods usually have an intuitive hierarchical structure. These functional modules are coupled to form a loop through actual physical connections, signal connections, etc., so the physical model is expressed as a set of equations in mathematical description, and the model variable values ​​need to be solved jointly. Since the loop involves component models with nonlinear characteristics, such as resistors whose volt-ampere characteristics are affected by temperature and friction of mechanical rotating connections, the twin model contains a large-scale nonlinear equation set, resulting in problems such as reduced simulation efficiency and erroneous results. Summary of the invention

[0004] The main purpose of the present invention is to provide a hierarchical nonlinear physical model compilation optimization method and related equipment, aiming to solve the technical problems of low simulation calculation efficiency and low simulation result accuracy when the simulation object is a hierarchical digital twin model.

[0005] A first aspect of the present invention provides a hierarchical nonlinear physical model compilation optimization method, the hierarchical nonlinear physical model compilation optimization method comprising:

[0006] Build a hierarchical digital twin physical model of the target physical object;

[0007] Compiling the physical model, and optimizing the nonlinear equations contained in the physical model to obtain an optimized simulation mathematical model and compilation optimization information of each nonlinear equation;

[0008] Based on the optimized simulation mathematical model, the target physical object is simulated, and the simulation results are evaluated in multiple dimensions to evaluate whether the simulation mathematical model meets the preset design requirements;

[0009] If the simulation mathematical model does not meet the preset design requirements, then based on the compiled optimization information of each nonlinear equation group, the relevant variables and the initial values ​​of the relevant variables in the physical model are redefined;

[0010] The physical model is recompiled, and the nonlinear equation group contained in the physical model is optimized again until the optimized simulation mathematical model meets the preset design requirements.

[0011] Optionally, in a first implementation of the first aspect of the present invention, the compiling of the physical model and optimizing the nonlinear equations included in the physical model to obtain the optimized simulation mathematical model and the compiled optimization information of each nonlinear equation group includes:

[0012] S1, parsing the hierarchical structure of each nested sub-model in the physical model to obtain a plurality of sub-models having a hierarchical relationship;

[0013] S2, searching for model variables with initial values ​​in each sub-model, and adding a priority attribute to each model variable with initial values;

[0014] S3, respectively checking the unknown model variables and behavior constraint equations in each sub-model to determine the nonlinear loop equation group in each sub-model;

[0015] S4, determining whether there is a nonlinear loop equation group that has not been compiled and optimized in each current sub-model;

[0016] S5, if there is currently a nonlinear loop equation group that has not been compiled and optimized, then execute step S6; if there is currently no nonlinear loop equation group that has not been compiled and optimized, then execute step S12;

[0017] S6, obtaining unknown model variables in the nonlinear loop equation group that is not currently compiled and optimized, and sorting the unknown model variables according to the priority of each unknown model variable;

[0018] S7, constructing an initial nonlinear iteration variable set corresponding to the current nonlinear loop equation group;

[0019] S8, adding the unknown model variable with the highest current priority and not compiled and optimized to the nonlinear iteration variable set to obtain an updated nonlinear iteration variable set;

[0020] S9, using the unknown model variables in the updated nonlinear iteration variable set to construct the assignment equations of other unknown model variables in the current nonlinear loop equation group;

[0021] S10, determining whether the unknown model variables in the updated nonlinear iteration variable set satisfy the solution of the current nonlinear loop equation group;

[0022] S11, if the current nonlinear loop equations are satisfied, then execute step S4; if the current nonlinear loop equations are not satisfied, then execute steps S8-S10;

[0023] S12, outputting the optimized simulation mathematical model and the compilation optimization information of each nonlinear equation group, wherein the compilation optimization information includes the nonlinear iteration variables used for iteratively solving the corresponding nonlinear equation group and the iteration initial value of each nonlinear iteration variable.

[0024] Optionally, in a second implementation of the first aspect of the present invention, searching for a model variable with an initial value in each sub-model and adding a priority attribute to each model variable with an initial value includes:

[0025] Find model variables with initial values ​​in each sub-model;

[0026] Based on the hierarchical structure of each sub-model, a priority attribute is added to each model variable with an initial value, wherein the model variable at the top level has the highest priority, and the priorities of the model variables at other levels decrease layer by layer;

[0027] Determine whether the model variable with initial value currently found has multiple levels of redefinition;

[0028] If there are multiple levels of redefinition and the initial values ​​of the model variables of the lower levels are redefined for the current level, the priority of the model variables of the multiple levels of redefinition is updated to the priority of the current level;

[0029] If there are multiple levels of redefinition and the initial values ​​of the bottom-level model variables are repeatedly defined for the multiple levels, the priorities of the multi-level redefined model variables are updated to the priorities of the top level.

[0030] Optionally, in a third implementation of the first aspect of the present invention, the sub-model is used to define model variables and behavior constraint equations of corresponding component modules in the target physical object, and the step of respectively checking the unknown model variables and behavior constraint equations in each sub-model to determine the nonlinear loop equation group in each sub-model includes:

[0031] Check whether there is a set of behavior constraint equations in each sub-model one by one;

[0032] If there is a behavior constraint equation group, then check whether each equation in the behavior constraint equation group contains at least one nonlinear term, wherein the nonlinear term includes the square, cube, exponential, logarithmic and trigonometric functions of the model variables;

[0033] If each equation in the behavior constraint equation group contains at least one nonlinear term, then checking whether each unknown model variable in the behavior constraint equation group appears in at least one equation, and whether each unknown model variable is directly or indirectly dependent on each other;

[0034] If each equation in the behavior constraint equation group contains at least one nonlinear term, each unknown model variable in the behavior constraint equation group appears in at least one equation, and each unknown model variable is directly or indirectly dependent on each other, then the currently checked behavior constraint equation group is determined to be a nonlinear loop equation group.

[0035] Optionally, in a fourth implementation of the first aspect of the present invention, adding the unknown model variable with the highest current priority and not compiled and optimized to the nonlinear iteration variable set to obtain the updated nonlinear iteration variable set includes:

[0036] Select the unknown model variable with the highest current priority and not compiled and optimized from the unknown model variables after priority sorting;

[0037] If there are multiple unknown model variables currently selected and they have the same priority, the unknown model variables that are not compiled and optimized are selected according to the default strategy;

[0038] The currently selected unknown model variables that have not been compiled and optimized are added to the current nonlinear iteration variable set to obtain an updated nonlinear iteration variable set.

[0039] Optionally, in a fifth implementation of the first aspect of the present invention, the step of using the unknown model variables in the updated nonlinear iteration variable set to construct the assignment equations of other unknown model variables in the current nonlinear loop equation group includes:

[0040] When updating the nonlinear iteration variable set, the unknown model variables currently added to the nonlinear iteration variable set are marked as known model variables;

[0041] All model variables in the updated nonlinear iteration variable set are used as nonlinear iteration variables for solving the nonlinear loop equation group;

[0042] According to the constraint relationship between the variables in the nonlinear loop equation group, it is determined whether other unknown model variables in the current nonlinear loop equation group can be expressed as an assignment form by the current nonlinear iteration variable;

[0043] If the current nonlinear iteration variable can be expressed in an assignment form, the assignment form of each equation in the nonlinear loop equation group is simplified to obtain the assignment equations of other unknown model variables in the current nonlinear loop equation group.

[0044] Optionally, in a sixth implementation of the first aspect of the present invention, the determining whether the unknown model variables in the updated nonlinear iteration variable set satisfy the solution of the current nonlinear loop equation group includes:

[0045] Determine whether all other unknown model variables in the current nonlinear loop equation group have corresponding assignment equations;

[0046] If there are corresponding assignment equations, then determine whether the residual equations in the nonlinear loop equations that have not been simplified in the assignment form can be iteratively solved by the unknown model variables in the updated nonlinear iteration variable set;

[0047] If the unknown model variables in the updated nonlinear iteration variable set can be iteratively solved, it is determined that the unknown model variables in the updated nonlinear iteration variable set satisfy the solution of the current nonlinear loop equation set.

[0048] The second aspect of the present invention further provides a hierarchical nonlinear physical model compilation and optimization device, the hierarchical nonlinear physical model compilation and optimization device comprising:

[0049] A building module is used to build a hierarchical digital twin physical model of the target physical object;

[0050] A compiling module, used for compiling the physical model and optimizing the nonlinear equations contained in the physical model to obtain an optimized simulation mathematical model and compilation optimization information of each nonlinear equation;

[0051] A simulation module, used to simulate the target physical object based on the optimized simulation mathematical model, and to perform multi-dimensional evaluation on the simulation results to evaluate whether the simulation mathematical model meets the preset design requirements;

[0052] A redefinition module, for redefining relevant variables and initial values ​​of relevant variables in the physical model based on compiled optimization information of each nonlinear equation group if the simulation mathematical model does not meet the preset design requirements;

[0053] The recompiling module is used to recompile the physical model and optimize the nonlinear equations contained in the physical model again until the optimized simulation mathematical model meets the preset design requirements.

[0054] Optionally, in a first implementation of the second aspect of the present invention, the compiling module includes:

[0055] A model parsing unit, used for parsing the hierarchical structure of each nested sub-model in the physical model to obtain a plurality of sub-models having a hierarchical relationship;

[0056] A priority adding unit, used for searching for model variables with initial values ​​in each sub-model, and adding a priority attribute to each model variable with initial values;

[0057] An equation group search unit is used to check the unknown model variables and behavior constraint equations in each sub-model respectively to determine the nonlinear loop equation group in each sub-model;

[0058] The first judgment unit is used to judge whether there is a nonlinear loop equation group that has not been compiled and optimized in each current sub-model;

[0059] A first jump execution unit is used to execute the variable sorting unit if there is a non-linear loop equation group that has not been compiled and optimized, and to execute the compilation result output unit if there is no non-linear loop equation group that has not been compiled and optimized;

[0060] A variable sorting unit is used to obtain unknown model variables in the nonlinear loop equation group that is not currently compiled and optimized, and sort each unknown model variable according to the priority of each unknown model variable;

[0061] An iteration variable set construction unit, used to construct an initial nonlinear iteration variable set corresponding to the current nonlinear loop equation group;

[0062] An iteration variable set updating unit is used to add the unknown model variable with the highest current priority and not compiled and optimized to the nonlinear iteration variable set to obtain an updated nonlinear iteration variable set;

[0063] An assignment equation construction unit, used to construct assignment equations of other unknown model variables in the current nonlinear loop equation group using the unknown model variables in the updated nonlinear iteration variable set;

[0064] A second judgment unit is used to judge whether the unknown model variables in the updated nonlinear iteration variable set satisfy the solution of the current nonlinear loop equation group;

[0065] A second jump execution unit is used to execute the first judgment unit if the current nonlinear loop equation group solution is satisfied, and to execute the iterative variable set updating unit, the assignment equation construction unit and the second judgment unit in sequence if the current nonlinear loop equation group solution is not satisfied;

[0066] The compilation result output unit is used to output the optimized simulation mathematical model and the compilation optimization information of each nonlinear equation group, wherein the compilation optimization information includes the nonlinear iteration variables used to iteratively solve the corresponding nonlinear equation group and the iteration initial value of each nonlinear iteration variable.

[0067] Optionally, in a second implementation of the second aspect of the present invention, the priority adding unit is specifically used to:

[0068] Find model variables with initial values ​​in each sub-model;

[0069] Based on the hierarchical structure of each sub-model, a priority attribute is added to each model variable with an initial value, wherein the model variable at the top level has the highest priority, and the priorities of the model variables at other levels decrease layer by layer;

[0070] Determine whether the model variable with initial value currently found has multiple levels of redefinition;

[0071] If there are multiple levels of redefinition and the initial values ​​of the model variables of the lower levels are redefined for the current level, the priority of the model variables of the multiple levels of redefinition is updated to the priority of the current level;

[0072] If there are multiple levels of redefinition and the initial values ​​of the bottom-level model variables are repeatedly defined for the multiple levels, the priorities of the multi-level redefined model variables are updated to the priorities of the top level.

[0073] Optionally, in a third implementation manner of the second aspect of the present invention, the sub-model is used to define model variables and behavior constraint equations of corresponding component modules in the target physical object, and the equation group search unit is specifically used to:

[0074] Check whether there is a set of behavior constraint equations in each sub-model one by one;

[0075] If there is a behavior constraint equation group, then check whether each equation in the behavior constraint equation group contains at least one nonlinear term, wherein the nonlinear term includes the square, cube, exponential, logarithmic and trigonometric functions of the model variables;

[0076] If each equation in the behavior constraint equation group contains at least one nonlinear term, then checking whether each unknown model variable in the behavior constraint equation group appears in at least one equation, and whether each unknown model variable is directly or indirectly dependent on each other;

[0077] If each equation in the behavior constraint equation group contains at least one nonlinear term, each unknown model variable in the behavior constraint equation group appears in at least one equation, and each unknown model variable is directly or indirectly dependent on each other, then the currently checked behavior constraint equation group is determined to be a nonlinear loop equation group.

[0078] Optionally, in a fourth implementation manner of the second aspect of the present invention, the iteration variable set updating unit is specifically used to:

[0079] Select the unknown model variable with the highest current priority and not compiled and optimized from the unknown model variables after priority sorting;

[0080] If there are multiple unknown model variables currently selected and they have the same priority, the unknown model variables that are not compiled and optimized are selected according to the default strategy;

[0081] The currently selected unknown model variables that have not been compiled and optimized are added to the current nonlinear iteration variable set to obtain an updated nonlinear iteration variable set.

[0082] Optionally, in a fifth implementation of the second aspect of the present invention, the assignment equation construction unit is specifically used to:

[0083] When updating the nonlinear iteration variable set, the unknown model variables currently added to the nonlinear iteration variable set are marked as known model variables;

[0084] All model variables in the updated nonlinear iteration variable set are used as nonlinear iteration variables for solving the nonlinear loop equation group;

[0085] According to the constraint relationship between the variables in the nonlinear loop equation group, it is determined whether other unknown model variables in the current nonlinear loop equation group can be expressed as an assignment form by the current nonlinear iteration variable;

[0086] If the current nonlinear iteration variable can be expressed in an assignment form, the assignment form of each equation in the nonlinear loop equation group is simplified to obtain the assignment equations of other unknown model variables in the current nonlinear loop equation group.

[0087] Optionally, in a sixth implementation manner of the second aspect of the present invention, the second judgment unit is specifically configured to:

[0088] Determine whether all other unknown model variables in the current nonlinear loop equation group have corresponding assignment equations;

[0089] If there are corresponding assignment equations, then determine whether the residual equations in the nonlinear loop equations that have not been simplified in the assignment form can be iteratively solved by the unknown model variables in the updated nonlinear iteration variable set;

[0090] If the unknown model variables in the updated nonlinear iteration variable set can be iteratively solved, it is determined that the unknown model variables in the updated nonlinear iteration variable set satisfy the solution of the current nonlinear loop equation set.

[0091] The third aspect of the present invention provides a computer device, comprising: a memory and at least one processor, wherein the memory stores instructions; the at least one processor calls the instructions in the memory so that the computer device executes the above-mentioned hierarchical nonlinear physical model compilation optimization method.

[0092] A fourth aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the above-mentioned hierarchical nonlinear physical model compilation optimization method.

[0093] In the technical solution provided by the present invention, the simulation efficiency and accuracy are improved by compiling and optimizing the nonlinear equations contained in the nonlinear physical model, specifically including: first building a hierarchical digital twin physical model of the target physical object, and then optimizing the nonlinear equations contained in the physical model to obtain the optimized simulation mathematical model and the compilation optimization information of each nonlinear equation group; each time the compilation optimization is completed, the target physical object will be simulated once, and the simulation results will be evaluated in multiple dimensions to evaluate whether the simulation mathematical model meets the preset design requirements; if the simulation mathematical model does not meet the preset design requirements, then based on the compilation optimization information of each nonlinear equation group, the relevant variables in the physical model and the initial values ​​of the relevant variables are redefined, and after the physical model modification is completed, the nonlinear equation group contained in the physical model is optimized again until the optimized simulation mathematical model meets the preset design requirements. The present invention compiles and optimizes the nonlinear equation group contained in the nonlinear physical model by looping, and uses the compilation optimization results of the previous round of physical model for the modification of the next round of physical model. Through multiple optimization adjustments of the nonlinear equation group contained in the physical model, the scale of the nonlinear equation group that the physical model needs to simulate and calculate is reduced, thereby improving the simulation calculation efficiency and accuracy of the physical model. BRIEF DESCRIPTION OF THE DRAWINGS

[0094] Figure 1 A schematic diagram of an embodiment of a hierarchical nonlinear physical model compilation optimization method according to an embodiment of the present invention;

[0095] Figure 2A schematic diagram of an embodiment of a hierarchical nonlinear physical model compilation and optimization device in an embodiment of the present invention;

[0096] Figure 3 FIG. 1 is a schematic diagram of an embodiment of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION

[0097] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0098] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 , an embodiment of the hierarchical nonlinear physical model compilation optimization method in the embodiment of the present invention includes:

[0099] S101. Build a hierarchical digital twin physical model of the target physical object;

[0100] In this embodiment, the target physical object is not limited and can be a physical object such as a car engine, an industrial robot, a space station, etc. The digital twin physical model refers to a physical object presented in a virtual space in a digital manner based on the digital twin technology. Specifically, the digital twin physical model creates a virtual model for a physical object in a digital manner to simulate its behavioral characteristics in a real environment. Through the digital twin physical model, users can intuitively see the morphology, structure, and behavioral characteristics of the physical object in the virtual space, which helps to better understand and manage the physical object.

[0101] Building a digital twin model requires the use of professional modeling tools, which provide the ability to digitally model and simulate physical systems or processes. This embodiment uses an object-oriented approach to build a physical model of a physical object. Specific modeling tools include but are not limited to Simulink, MWorks, Dymola, Adams, and can also be self-developed modeling tools. In addition to the function of building a model, self-developed modeling tools can also integrate model compilation functions and model compilation optimization functions.

[0102] S102, compiling the physical model, and optimizing the nonlinear equations included in the physical model to obtain an optimized simulation mathematical model and compilation optimization information of each nonlinear equation;

[0103] Actual physical entities or systems are usually composed of several subsystems, and subsystems can be further decomposed into smaller granular components such as parts and assemblies. Therefore, digital twin physical models built based on object-oriented methods usually have an intuitive hierarchical structure. These functional modules are coupled to form a loop through actual physical connections, signal connections, etc. Therefore, the physical model is expressed as a set of equations in mathematical description, and the model variable values ​​need to be solved jointly. Since the loop involves component models with nonlinear characteristics, such as resistors whose volt-ampere characteristics are affected by temperature and friction of mechanical rotating connections, the twin model contains a large-scale nonlinear equation group, resulting in problems such as reduced simulation efficiency and erroneous results. Under the premise that the twin physical model cannot be further simplified, studying the compilation optimization method of large-scale nonlinear equation groups is an effective means to improve the real-time performance of simulation.

[0104] In this embodiment, when compiling the physical model, the nonlinear equations contained in the physical model are optimized to obtain the optimized simulation mathematical model and the compilation optimization information of each nonlinear equation. The simulation mathematical model refers to a mathematical equation that represents the object to be simulated, which can be tested on a computer to simulate and predict the operation of the actual system.

[0105] In an optional embodiment, the above step 102 further includes:

[0106] S1, parsing the hierarchical structure of each nested sub-model in the physical model to obtain a plurality of sub-models having a hierarchical relationship;

[0107] In this embodiment, the physical model creates a virtual model for the physical object in a digital way to simulate its behavioral characteristics in the real environment, and usually includes a series of variables, parameters and equations to describe the state, behavior and evolution process of the physical object.

[0108] Physical models are usually abstract and simplified representations of physical phenomena, processes or systems in the real world, while nested sub-models refer to a larger physical model that contains multiple smaller and more specific models. These sub-models are nested in layers and together form a complete description of the entire physical model. The parsed physical model contains multiple sub-models with a hierarchical relationship, such as a top-level model, several middle-level models and several bottom-level models.

[0109] The top-level model is the outermost layer of the entire physical model, describing the overall structure and main behaviors of the system. The top-level model usually contains some macro variables and parameters to describe the overall characteristics and performance of the system.

[0110] The middle-level model is located between the top-level model and the bottom-level model, and describes the behavior of each component or subsystem of the system. The middle-level model is usually a further refinement or decomposition of some complex processes in the top-level model in order to more accurately describe the behavior of the system. These middle-level models may include multiple interrelated sub-models, each of which describes a specific aspect or function of the system.

[0111] The underlying model is the most specific and detailed level in the physical model, describing the microstructure and behavior of the system. The underlying model usually includes a large number of variables and parameters to describe the detailed state and evolution of the system. These underlying models may be precise descriptions based on physical laws or empirical models based on experimental data.

[0112] In a hierarchical structure, high-level models usually contain low-level models. For example, a top-level model may contain multiple middle-level models, and each middle-level model may contain multiple bottom-level models. This inclusion relationship reflects the hierarchy and nestedness between models. Models at different levels may interact with each other. For example, a middle-level model may affect the behavior of a bottom-level model in some way, and the behavior of a bottom-level model may in turn affect the middle-level model. This interaction makes the entire physical model a dynamic and complex system. In a hierarchical structure, low-level models usually rely on the context or environment provided by high-level models. For example, a bottom-level model may rely on certain parameters or conditions provided by a middle-level model to run. This dependency ensures coordination and consistency between models.

[0113] S2, searching for model variables with initial values ​​in each sub-model, and adding a priority attribute to each model variable with initial values;

[0114] In this embodiment, we start from the top-level model and go deeper into each layer of the model. For each sub-model, we check the model variables defined in it. Check the definition of each model variable to see if there is a clear initial value assigned. The initial value can be a constant, the result of a function call, or a value calculated from other model variables or parameters. For model variables with initial values, record their names, initial values, and the sub-models they belong to.

[0115] Develop a priority standard based on the system requirements, the importance of the variable, and its impact on the system behavior. Priorities can be numerical (such as 1 to 10, where 1 is the highest priority and 10 is the lowest priority) or descriptive (such as high, medium, and low). For each model variable with an initial value, assign a priority based on the importance of the submodel it is in, the impact of the variable on the system behavior, and possible constraints. Record the priority of each variable while recording the initial value of the model variable. If the model variable does not have an initial value attribute defined, no priority is set for it.

[0116] In an optional embodiment, the above step S2 further includes:

[0117] S21, searching for model variables with initial values ​​in each sub-model;

[0118] S22, based on the hierarchical structure of each sub-model, adding a priority attribute to each model variable with an initial value, wherein the model variable at the top level has the highest priority, and the priorities of the model variables at other levels decrease layer by layer;

[0119] In this embodiment, starting from the top-level model, go deeper into each layer of the model layer by layer. In each sub-model, check the definition of each model variable to find out whether it has a clear initial value. Record the model variables with initial values, including their names, initial values, and the sub-models they are in. The variable priority of the top-level model is set to the highest (for example, the priority is 1). The variable priority of the middle-level model decreases layer by layer (for example, the second layer is 2, the third layer is 3, and so on). The variable priority of the bottom-level model is set to the lowest (determined according to the number of levels). While recording the model variables with initial values, their priorities are recorded.

[0120] S23, determining whether the currently found model variable with an initial value has a multi-level redefinition;

[0121] Check whether the model variables with initial values ​​found in the current level are also defined and have initial values ​​in other levels (especially lower levels). If there are multiple levels of redefinition, record relevant information, including variable name, location (level) of redefinition, and respective initial values.

[0122] S24, if there is a multi-level redefinition and the initial value of the model variable of the lower level is redefined for the current level, the priority of the model variable redefined at the multi-level is updated to the priority of the current level;

[0123] S25. If there are multiple levels of redefinition and the initial values ​​of the bottom-level model variables are repeatedly defined in the multiple levels, the priorities of the model variables redefined in the multiple levels are updated to the priorities of the top level.

[0124] In this embodiment, for model variables that have been redefined at multiple levels, the priority level needs to be updated, specifically: (1) If there are multiple levels of redefinition and the initial values ​​of the lower-level model variables are redefined for the current level, the priority level of the model variables that have been redefined at multiple levels is updated to the priority level of the current level; (2) If there are multiple levels of redefinition and the initial values ​​of the lower-level model variables are repeatedly defined at multiple levels, the priority level of the model variables that have been redefined at multiple levels is updated to the priority level of the top level.

[0125] S3, respectively checking the unknown model variables and behavior constraint equations in each sub-model to determine the nonlinear loop equation group in each sub-model;

[0126] This embodiment is mainly for compiling and optimizing the nonlinear equations contained in the physical model, so as to achieve the decomposition of the nonlinear equations in the physical model and achieve the purpose of dimensionality reduction and simplification. Therefore, before compiling and optimizing, it is necessary to first determine the nonlinear loop equations in each sub-model in the physical model. When the unknown model variables in the sub-model are directly or indirectly dependent on each other, a solution loop is formed. For example, in the calculation formula A=f(B), the value of variable B needs to be known when calculating variable A, and the value of variable B in the calculation formula B=g(A) needs to be dependent on variable A for calculation. When nonlinear terms appear in the unknown variables in the loop equation group, such as sin(A), B 2 , then a nonlinear loop equation system is formed.

[0127] In an optional embodiment, the above step S3 further includes:

[0128] S31, checking whether there is a behavior constraint equation group in each sub-model one by one;

[0129] S32, if there is a behavior constraint equation group, then check whether each equation in the behavior constraint equation group contains at least one nonlinear term, wherein the nonlinear term includes the square, cube, exponential, logarithmic and trigonometric functions of the model variables;

[0130] S33, if each equation in the behavior constraint equation group contains at least one nonlinear term, then check one by one whether each unknown model variable in the behavior constraint equation group appears in at least one equation, and whether each unknown model variable is directly or indirectly dependent on each other;

[0131] S34. If each equation in the behavior constraint equation group contains at least one nonlinear term, each unknown model variable in the behavior constraint equation group appears in at least one equation, and each unknown model variable is directly or indirectly dependent on each other, then it is determined that the currently checked behavior constraint equation group is a nonlinear loop equation group.

[0132] In this embodiment, all sub-models are traversed, and each sub-model is checked to see whether a behavior constraint equation group is defined. For each existing behavior constraint equation group, all its equations are checked to see whether they contain at least one nonlinear term (such as the square, cubic, exponential, logarithmic or trigonometric function of the model variable). For each behavior constraint equation group containing nonlinear terms, all its unknown model variables are checked to see whether they appear in at least one equation, and whether there is a direct or indirect interdependence between these variables. If all the above conditions are met, the behavior constraint equation group currently being checked is determined to be a nonlinear loop equation group.

[0133] S4, determining whether there is a nonlinear loop equation group that has not been compiled and optimized in each current sub-model;

[0134] S5, if there is currently a nonlinear loop equation group that has not been compiled and optimized, then execute step S6; if there is currently no nonlinear loop equation group that has not been compiled and optimized, then execute step S12;

[0135] S6, obtaining unknown model variables in the nonlinear loop equation group that is not currently compiled and optimized, and sorting the unknown model variables according to the priority of each unknown model variable;

[0136] In this embodiment, the unknown model variables in the nonlinear loop equation group may have defined initial values ​​or may not have defined initial values. The unknown model variables with defined initial values ​​can be sorted according to the priority defined in step S2, while the unknown model variables with undefined initial values ​​can be regarded as having the lowest priority.

[0137] S7, constructing an initial nonlinear iteration variable set corresponding to the current nonlinear loop equation group;

[0138] In this embodiment, in order to facilitate the decomposition of the nonlinear loop equation group, it is necessary to determine the nonlinear iterative variables used for the decomposition of the equation group. Before optimization, the initial nonlinear iterative variable set is preferably empty. The nonlinear iterative variable set is used to store the nonlinear iterative variables used for the decomposition of the nonlinear loop equation group.

[0139] Equation decomposition is a large-scale nonlinear system compilation optimization method. The idea is to select m≤n unknown variables from a set of n nonlinear unknown variables, and the remaining variables can be represented by the values ​​of the selected m variables. This reduces the number of iterative variables in the numerical solution algorithm of nonlinear equations from n to m, thereby achieving dimensionality reduction and simplification of the equation system.

[0140] S8, adding the unknown model variable with the highest current priority and not compiled and optimized to the nonlinear iteration variable set to obtain an updated nonlinear iteration variable set;

[0141] In this embodiment, for the physical model, if the initial value attributes of the lower-level model variables are repeatedly defined at multiple levels, the variable definitions closer to the top-level model have higher confidence and are the target values ​​that the modeler prefers. Therefore, when selecting nonlinear iterative variables, the model variables with the highest priority are preferred.

[0142] In an optional embodiment, the above step S8 further includes:

[0143] S81, selecting the unknown model variable with the highest current priority and not compiled and optimized from the unknown model variables after priority sorting;

[0144] In this embodiment, two principles should be met when selecting nonlinear iteration variables from the unknown model variables after priority sorting: 1) try to select variables with higher priority; 2) the remaining unknown variables can be represented as an assignment form by the current nonlinear iteration variable set.

[0145] Regarding Principle 1, as mentioned above, the higher the priority of the model variable, the closer the initial value of the variable is to the top model, indicating that the modeler has a higher confidence in the initial value. Therefore, selecting the variable as a nonlinear iterative variable can ensure that a valid initial value of the iteration is obtained.

[0146] According to principle 2, each nonlinear loop equation group in the physical model can be expressed as follows:

[0147]

[0148] Among them, the nonlinear variable , select m nonlinear variables from vector X as the nonlinear iteration variable set , so that the remaining unknown variables can be expressed as the assignment calculation formula about Z:

[0149] ;

[0150] ;

[0151]

[0152]

[0153] The above process is actually to transform the original nonlinear loop equations Split into two parts: one part is an assignment form equation with a number (nm) , and the other part is the residual equation with the scale reduced to m When the nonlinear iterative variable Z is solved, the remaining unknown variables can also be updated and calculated based on the assignment form equation, thereby meeting the model solution requirements.

[0154] S82. If there are multiple unknown model variables currently selected and they have the same priority, select the unknown model variables that are not compiled and optimized according to the default strategy;

[0155] S83, adding the currently selected unknown model variable that has not been compiled and optimized to the current nonlinear iteration variable set to obtain an updated nonlinear iteration variable set.

[0156] If there are multiple unknown model variables currently selected with the same priority, a default strategy is used to select nonlinear iteration variables. For example, variables whose corresponding assignment expressions cannot be obtained are selected first, followed by variables with nonlinear terms, and finally variables are selected in the order of variable names. Finally, the currently selected unknown model variables that have not been compiled and optimized are added to the current nonlinear iteration variable set to obtain the updated nonlinear iteration variable set.

[0157] S9, using the unknown model variables in the updated nonlinear iteration variable set to construct the assignment equations of other unknown model variables in the current nonlinear loop equation group;

[0158] In this embodiment, when solving a nonlinear system of equations, especially when the system of equations contains multiple unknown variables and there are complex nonlinear relationships between these variables, an iterative method is required to gradually approximate the solution. The updated nonlinear iteration variable set contains some known unknown model variables (that is, having initial values), so these known variables can be used to construct the assignment equations of other unknown model variables in the current nonlinear loop equation system.

[0159] In an optional embodiment, the above step S9 further includes:

[0160] S91, when updating the nonlinear iteration variable set, marking the unknown model variables currently added to the nonlinear iteration variable set as known model variables;

[0161] S92, using all model variables in the updated nonlinear iteration variable set as nonlinear iteration variables for solving the nonlinear loop equation group;

[0162] S93, judging whether other unknown model variables in the current nonlinear loop equation group can be represented as an assignment form by the current nonlinear iteration variable according to the constraint relationship between the variables in the nonlinear loop equation group;

[0163] S94. If the current nonlinear iterative variable can be expressed in an assignment form, the assignment form of each equation in the nonlinear loop equation group is simplified to obtain the assignment equations of other unknown model variables in the current nonlinear loop equation group.

[0164] For each unknown model variable that has not yet been solved, try to construct an assignment equation using the known variables and the equations in the system. This may involve algebraic operations (such as addition, subtraction, multiplication, division, etc.) and possible equation transformations (such as transposing terms, combining like terms, etc.). Iterate through each equation in the nonlinear loop system of equations and check whether other unknown variables can be expressed as functions of the current nonlinear iteration variable through algebraic transformations (such as transposing terms, substituting, etc.).

[0165] Assume that there is a variable set [abcdefg] in the original nonlinear loop equation set. Select nonlinear iteration variables from the above set so that the remaining variables can be represented by the values ​​of this set of nonlinear iteration variables. The specific process is as follows:

[0166] (1) Assume that variable a is selected first and it is determined that equation 1 can be used to assign a value to b=e1(a); equation 2 can be used to assign a value to c=e2(a);

[0167] Since only the calculation methods of a, b, and c are determined at this time (a is nonlinear iteration, b and c are assignment calculations), the requirement that other variables are represented by the current nonlinear iteration variables in the form of assignment is not met, so new nonlinear iteration variables need to be added;

[0168] (2) Further select the variable d and determine that equation No. 3 can be used to assign the value e = e3(d); equation No. 4 can be used to assign the value f = e4(d);

[0169] Similarly, although a new nonlinear iteration variable d is added, the calculation method of the remaining variable g cannot be determined, so the remaining variable g must be selected as the nonlinear iteration variable;

[0170] (3) Further selecting the variable g as a new nonlinear iteration variable, that is, there is no variable in the original nonlinear loop equation group whose calculation method cannot be determined;

[0171] After the above nonlinear loop equation group is processed, the nonlinear iteration variable set is determined to be [adg], and the variable set for assignment calculation is determined to be [bcef], among which equations numbered 1, 2, 3, and 4 are selected as assignment equations.

[0172] S10, determining whether the unknown model variables in the updated nonlinear iteration variable set satisfy the solution of the current nonlinear loop equation group;

[0173] In this embodiment, the nonlinear loop equations solver solves the problem by iteration, wherein the problem form of the iterative solution can be expressed as the following residual function:

[0174] res = f(X)

[0175] Among them, res represents the residual value, X represents the nonlinear iteration variable, and X can be in vector form, for example, containing 10 variables. The larger the scale of X, the lower the efficiency of the iterative solution.

[0176] The nonlinear solver iteration process can be understood as:

[0177] (1) Given an initial value X0, substitute the function f(X) to calculate the residual res. If the residual res < the acceptance threshold, the iteration is successful, otherwise execute (2).

[0178] (2) Modify the nonlinear iteration variable X', substitute the function f(X') to calculate the residual res, and iterate this process until the residual res < the acceptance threshold. For example, given the following nonlinear loop equations:

[0179]

[0180] Then its residual function can be expressed as res=f(x,y,z):

[0181]

[0182] In this embodiment, the optimization scheme of the nonlinear loop equation group is to reduce the number of nonlinear iteration variables. From the final residual function form, the number of input parameters should be reduced. To achieve this goal, it is required that the nonlinear iteration variables finally selected can represent other variables in the form of assignment. Then, a part of the variables in the original nonlinear loop becomes nonlinear iteration variables, which are solved by solver iteration, and the other part becomes assignment variables, which are represented by nonlinear iteration variable assignment. Taking the above nonlinear equation group as an example, assuming that the selected nonlinear iteration variables are y and z, then x can be represented in the form of assignment of y and z, and all variables can be solved, and the residual function formed is as follows:

[0183]

[0184] The variable x in the original nonlinear loop equation group is expressed in the form of assignments of nonlinear iterative variables y and z, thereby forming an assignment equation.

[0185] In an optional embodiment, the above step S10 further includes:

[0186] S1001, determining whether all other unknown model variables in the current nonlinear loop equation group have corresponding assignment equations;

[0187] S1002, if there are corresponding assignment equations, then determine whether the residual equation group that has not been simplified in the assignment form in the nonlinear loop equation group can be iteratively solved by the unknown model variables in the updated nonlinear iteration variable set;

[0188] S1003: If the unknown model variables in the updated nonlinear iteration variable set can be iteratively solved, then determining whether the unknown model variables in the updated nonlinear iteration variable set satisfy the solution of the current nonlinear loop equation set.

[0189] In this embodiment, after any variable is added to the nonlinear iteration variable set, it is marked as a known variable. According to the constraint relationship of the original nonlinear equation, it can be determined whether the remaining unknown variables can be represented by the current set of variables. For example, given three constraint equations , select variables is a nonlinear iteration variable, then the constraint equation Solvable variables , which can be further explained by the constraint equation Solving for variables , so the model solution requirements are met. If the constraint equation and It can be simplified to The assignment form is determined as an assignment equation. Substitute into the constraint equation It can be determined whether it satisfies the constraint conditions. If not, the residual value is calculated, so it is called a constraint equation. is the residual equation.

[0190] In this embodiment, if all other unknown model variables in the nonlinear loop equation group have corresponding assignment equations, and the residual equation group in the nonlinear loop equation group that has not been simplified in assignment form can be iteratively solved by the unknown model variables in the updated nonlinear iterative variable set, then it is determined that the unknown model variables in the updated nonlinear iterative variable set satisfy the solution of the current nonlinear loop equation group.

[0191] S11, if the current nonlinear loop equations are satisfied, then execute step S4; if the current nonlinear loop equations are not satisfied, then execute steps S8-S10;

[0192] S12, outputting the optimized simulation mathematical model and the compilation optimization information of each nonlinear equation group, wherein the compilation optimization information includes the nonlinear iteration variables used for iteratively solving the corresponding nonlinear equation group and the iteration initial value of each nonlinear iteration variable.

[0193] In this embodiment, after the nonlinear iteration set and the assignment equation are determined, the remaining constraint equations form a smaller residual equation group, which is used for iterative solution calculation of the nonlinear loop equation group. The iteration initial value of this set of iteration variables is determined according to the initial value attribute of the variables in the nonlinear iteration variable set. If the iteration variable has no initial value attribute, the default value 0 is used as the iteration initial value. The nonlinear iteration variable set can be used to simplify the original nonlinear loop equation group into the assignment equation and the residual equation, thereby forming a simulation mathematical model after compilation optimization, and the compilation optimization information includes the nonlinear iteration variables used for iterative solution of the corresponding nonlinear equation group and the iteration initial value of each nonlinear iteration variable.

[0194] S103, simulating the target physical object based on the optimized simulation mathematical model, and performing a multi-dimensional evaluation on the simulation results to evaluate whether the simulation mathematical model meets the preset design requirements;

[0195] S104, if the simulation mathematical model does not meet the preset design requirements, then based on the compiled optimization information of each nonlinear equation group, redefine the relevant variables and the initial values ​​of the relevant variables in the physical model;

[0196] In this embodiment, although the nonlinear equations in the physical model are simplified during the compilation process, it is not certain that the simplified simulation mathematical model is necessarily optimal. Therefore, it is necessary to simulate the target physical object to evaluate whether the simplified simulation mathematical model meets the preset design requirements.

[0197] In this embodiment, for different physical objects, the corresponding evaluation dimensions and the design requirements of the simulation mathematical model are different and need to be set based on the actual situation. For example, for the simulation of an automobile engine, the corresponding evaluation dimensions may be: power performance evaluation, economy evaluation, emission performance evaluation, stability and ride comfort evaluation, reliability evaluation, etc., and corresponding design requirement indicators may be set for different evaluation dimensions.

[0198] In this embodiment, if the compiled and optimized simulation mathematical model does not meet the preset design requirements, the relevant variables and the initial values ​​of the relevant variables in the physical model can be redefined based on the compiled optimization information of each nonlinear equation group. The modeler can control the simplified nonlinear equation form and nonlinear iterative variables of the model by redefining the initial value attributes of specific variables in the top-level model. Different simplified forms have different solution performances. The combination with the highest computational efficiency can be selected through simulation testing. At the same time, the target solution in the case of multiple solutions can be controlled by adjusting the initial value to avoid erroneous results.

[0199] It should be noted that, in other embodiments of the present invention, in order to facilitate different application scenarios and different user requirements, the model compilation tool also supports a variety of model compilation optimization modes for users to choose from, such as a fully automatic mode and a semi-automatic mode.

[0200] The fully automatic mode means that the entire model compilation process is automatically completed by the program (i.e., the model compilation tool). The main advantages of this mode are: simple user operation, which does not require the user to have very professional theoretical knowledge. The disadvantages of this mode are: 1) The set of nonlinear iterative variables automatically selected by the program is not the optimal combination, which makes it difficult or even impossible to solve the simplified mathematical model; 2) The iterative variables automatically selected by the program may be auxiliary variables with no actual physical meaning. When the nonlinear equation has multiple solutions, the iterative calculation may converge to an erroneous result, that is, the simulation multiple solutions are uncontrollable.

[0201] The semi-automatic mode means that during the model compilation process, the modeler (i.e., the user) can intervene in the model compilation. For example, in step S104, the relevant variables and the initial values ​​of the relevant variables in the physical model redefined based on the compilation optimization information of each nonlinear equation group can be selected by the modeler and then provided to the model compilation tool. Of course, in some embodiments, the relevant variables and the initial values ​​of the relevant variables in the redefined physical model can also be automatically selected by the model compilation tool based on pre-set rule conditions. The semi-automatic mode utilizes the hierarchical structure of the model, and the priority of the variables can be used to control the nonlinear iteration variables finally selected when optimizing nonlinear equations. The advantages of this mode are: 1) It can avoid the model compilation tool from automatically selecting inappropriate nonlinear iteration variables; 2) The modeler can control the effect of equation scale simplification by trying to select different iteration variables (because different variables may not be expressed in the form of assignment, and the number of nonlinear iteration variables will also be different, affecting the subsequent solution effect); 3) Since nonlinear iteration variables must provide reasonable initial iteration values, this mode can avoid the nonlinear iteration variables automatically selected by the tool without initial values, and at the same time, multiple solutions can be controlled by giving initial values; 4) The initial values ​​of different hierarchical structure models are time-sensitive, and in this mode, the modeler can add different initial values ​​according to the current hierarchical model, but for the current simulation, the initial values ​​redefined in the top-level model must be more trustworthy. The main disadvantage of the semi-automatic mode is that the entire model compilation process requires relevant professionals to complete the operation.

[0202] S105, recompiling the physical model, and optimizing the nonlinear equations contained in the physical model again, until the optimized simulation mathematical model meets the preset design requirements.

[0203] In this embodiment, the initial value attributes of the variables are redefined at the top level of the physical model according to the compilation optimization information of the nonlinear equation group to achieve: 1) the auxiliary model compilation tool selects the desired variables as nonlinear iteration variables; 2) reasonable iteration initial values ​​are provided to ensure the successful solution of the nonlinear equations and convergence to the target solution in the case of multiple solutions.

[0204] After redefining the relevant variables and the initial values ​​of the relevant variables in the physical model, the updated physical model is recompiled, and the nonlinear equations contained in the physical model are further optimized again until the optimized simulation mathematical model meets the preset design requirements. At this time, the obtained simulation mathematical model can not only meet the design requirements, but also improve the simulation calculation efficiency and accuracy of the physical model.

[0205] Based on the hierarchical nonlinear physical model compilation optimization method in this embodiment, the modeler can provide a heuristic strategy for splitting and simplifying the nonlinear equation group by defining the initial value attributes of the variables at the top level of the model, that is, participating in the model compilation process, rather than passively accepting the simplified results of the simulation tool, so the simplified form of the equation is controllable to a certain extent. The modeler can test the solution performance of different simplified forms to select the most suitable combination of nonlinear iterative variables. The compilation optimization method designed in this embodiment preferentially selects variables with top-level initial value attributes as nonlinear iterative variables. On the one hand, it can avoid selecting variables that cannot provide initial values, such as auxiliary variables, and on the other hand, the top-level initial value attributes are more timely, ensuring that the calculation results are closer to the current application scenario. In the case of multiple solutions, the convergence to the target solution can be controlled by adjusting the initial value.

[0206] In this embodiment, the simulation efficiency and accuracy are improved by compiling and optimizing the nonlinear equations contained in the nonlinear physical model, specifically including: first building a hierarchical digital twin physical model of the target physical object, and then optimizing the nonlinear equations contained in the physical model to obtain the optimized simulation mathematical model and the compilation optimization information of each nonlinear equation group; each time the compilation optimization is completed, the target physical object will be simulated once, and the simulation results will be evaluated in multiple dimensions to evaluate whether the simulation mathematical model meets the preset design requirements; if the simulation mathematical model does not meet the preset design requirements, then based on the compilation optimization information of each nonlinear equation group, the relevant variables in the physical model and the initial values ​​of the relevant variables are redefined, and after the physical model modification is completed, the nonlinear equation group contained in the physical model is optimized again until the optimized simulation mathematical model meets the preset design requirements. In this embodiment, the nonlinear equation group contained in the nonlinear physical model is compiled and optimized by looping, and the compilation optimization results of the previous round of physical model are used for the modification of the next round of physical model. Through multiple optimization adjustments of the nonlinear equation group contained in the physical model, the scale of the nonlinear equation group that the physical model needs to simulate and calculate is reduced, thereby improving the simulation calculation efficiency and accuracy of the physical model.

[0207] The hierarchical nonlinear physical model compilation optimization method according to the embodiment of the present invention is described above. The hierarchical nonlinear physical model compilation optimization device according to the embodiment of the present invention is described below. Figure 2 In one embodiment of the present invention, a hierarchical nonlinear physical model compilation and optimization device includes:

[0208] A building module 201 is used to build a hierarchical digital twin physical model of a target physical object;

[0209] A compiling module 202 is used to compile the physical model and optimize the nonlinear equations included in the physical model to obtain an optimized simulation mathematical model and compilation optimization information of each nonlinear equation;

[0210] A simulation module 203 is used to simulate the target physical object based on the optimized simulation mathematical model, and to perform multi-dimensional evaluation on the simulation results to evaluate whether the simulation mathematical model meets the preset design requirements;

[0211] A redefinition module 204, for redefining relevant variables and initial values ​​of relevant variables in the physical model based on compiled optimization information of each nonlinear equation group if the simulation mathematical model does not meet the preset design requirements;

[0212] The recompiling module 205 is used to recompile the physical model and optimize the nonlinear equations contained in the physical model again until the optimized simulation mathematical model meets the preset design requirements.

[0213] Optionally, in one embodiment, the compiling module 302 includes:

[0214] A model parsing unit, used for parsing the hierarchical structure of each nested sub-model in the physical model to obtain a plurality of sub-models having a hierarchical relationship;

[0215] A priority adding unit, used for searching for model variables with initial values ​​in each sub-model, and adding a priority attribute to each model variable with initial values;

[0216] An equation group search unit is used to check the unknown model variables and behavior constraint equations in each sub-model respectively to determine the nonlinear loop equation group in each sub-model;

[0217] The first judgment unit is used to judge whether there is a nonlinear loop equation group that has not been compiled and optimized in each current sub-model;

[0218] A first jump execution unit is used to execute the variable sorting unit if there is a non-linear loop equation group that has not been compiled and optimized, and to execute the compilation result output unit if there is no non-linear loop equation group that has not been compiled and optimized;

[0219] A variable sorting unit is used to obtain unknown model variables in the nonlinear loop equation group that is not currently compiled and optimized, and sort each unknown model variable according to the priority of each unknown model variable;

[0220] An iteration variable set construction unit, used to construct an initial nonlinear iteration variable set corresponding to the current nonlinear loop equation group;

[0221] An iteration variable set updating unit is used to add the unknown model variable with the highest current priority and not compiled and optimized to the nonlinear iteration variable set to obtain an updated nonlinear iteration variable set;

[0222] An assignment equation construction unit, used to construct assignment equations of other unknown model variables in the current nonlinear loop equation group using the unknown model variables in the updated nonlinear iteration variable set;

[0223] A second judgment unit is used to judge whether the unknown model variables in the updated nonlinear iteration variable set satisfy the solution of the current nonlinear loop equation group;

[0224] A second jump execution unit is used to execute the first judgment unit if the current nonlinear loop equation group solution is satisfied, and to execute the iterative variable set updating unit, the assignment equation construction unit and the second judgment unit in sequence if the current nonlinear loop equation group solution is not satisfied;

[0225] The compilation result output unit is used to output the optimized simulation mathematical model and the compilation optimization information of each nonlinear equation group, wherein the compilation optimization information includes the nonlinear iteration variables used to iteratively solve the corresponding nonlinear equation group and the iteration initial value of each nonlinear iteration variable.

[0226] Optionally, in one embodiment, the priority adding unit is specifically used for:

[0227] Find model variables with initial values ​​in each sub-model;

[0228] Based on the hierarchical structure of each sub-model, a priority attribute is added to each model variable with an initial value, wherein the model variable at the top level has the highest priority, and the priorities of the model variables at other levels decrease layer by layer;

[0229] Determine whether the model variable with initial value currently found has multiple levels of redefinition;

[0230] If there are multiple levels of redefinition and the initial values ​​of the model variables of the lower levels are redefined for the current level, the priority of the model variables of the multiple levels of redefinition is updated to the priority of the current level;

[0231] If there are multiple levels of redefinition and the initial values ​​of the bottom-level model variables are repeatedly defined for the multiple levels, the priorities of the multi-level redefined model variables are updated to the priorities of the top level.

[0232] Optionally, in one embodiment, the sub-model is used to define model variables and behavior constraint equations of corresponding component modules in the target physical object, and the equation group search unit is specifically used to:

[0233] Check whether there is a set of behavior constraint equations in each sub-model one by one;

[0234] If there is a behavior constraint equation group, then check whether each equation in the behavior constraint equation group contains at least one nonlinear term, wherein the nonlinear term includes the square, cube, exponential, logarithmic and trigonometric functions of the model variables;

[0235] If each equation in the behavior constraint equation group contains at least one nonlinear term, then checking whether each unknown model variable in the behavior constraint equation group appears in at least one equation, and whether each unknown model variable is directly or indirectly dependent on each other;

[0236] If each equation in the behavior constraint equation group contains at least one nonlinear term, each unknown model variable in the behavior constraint equation group appears in at least one equation, and each unknown model variable is directly or indirectly dependent on each other, then the currently checked behavior constraint equation group is determined to be a nonlinear loop equation group.

[0237] Optionally, in one embodiment, the iteration variable set updating unit is specifically used for:

[0238] Select the unknown model variable with the highest current priority and not compiled and optimized from the unknown model variables after priority sorting;

[0239] If there are multiple unknown model variables currently selected and they have the same priority, the unknown model variables that are not compiled and optimized are selected according to the default strategy;

[0240] The currently selected unknown model variables that have not been compiled and optimized are added to the current nonlinear iteration variable set to obtain an updated nonlinear iteration variable set.

[0241] Optionally, in one embodiment, the assignment equation construction unit is specifically used for:

[0242] When updating the nonlinear iteration variable set, the unknown model variables currently added to the nonlinear iteration variable set are marked as known model variables;

[0243] All model variables in the updated nonlinear iteration variable set are used as nonlinear iteration variables for solving the nonlinear loop equation group;

[0244] According to the constraint relationship between the variables in the nonlinear loop equation group, it is determined whether other unknown model variables in the current nonlinear loop equation group can be expressed as an assignment form by the current nonlinear iteration variable;

[0245] If the current nonlinear iteration variable can be expressed in an assignment form, the assignment form of each equation in the nonlinear loop equation group is simplified to obtain the assignment equations of other unknown model variables in the current nonlinear loop equation group.

[0246] Optionally, in one embodiment, the second judgment unit is specifically configured to:

[0247] Determine whether all other unknown model variables in the current nonlinear loop equation group have corresponding assignment equations;

[0248] If there are corresponding assignment equations, then determine whether the residual equations in the nonlinear loop equations that have not been simplified in the assignment form can be iteratively solved by the unknown model variables in the updated nonlinear iteration variable set;

[0249] If the unknown model variables in the updated nonlinear iteration variable set can be iteratively solved, it is determined that the unknown model variables in the updated nonlinear iteration variable set satisfy the solution of the current nonlinear loop equation set.

[0250] Since the embodiments of the device part correspond to the embodiments of the above-mentioned method, please refer to the above-mentioned method embodiments for the introduction of the hierarchical nonlinear physical model compilation and optimization device provided by the present invention. The present invention will not be repeated here, and it has the same beneficial effects as the above-mentioned hierarchical nonlinear physical model compilation and optimization method.

[0251] above Figure 2 The hierarchical nonlinear physical model compilation and optimization apparatus in the embodiment of the present invention is described in detail from the perspective of modular functional entities. The computer device in the embodiment of the present invention is described in detail from the perspective of hardware processing.

[0252] Figure 3 : is a schematic diagram of the structure of a computer device provided by an embodiment of the present invention. The computer device 500 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 510 (for example, one or more processors) and a memory 520, and one or more storage media 530 (for example, one or more mass storage devices) storing application programs 533 or data 532. Among them, the memory 520 and the storage medium 530 can be short-term storage or permanent storage. The program stored in the storage medium 530 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the computer device 500. Furthermore, the processor 510 may be configured to communicate with the storage medium 530 to execute a series of instruction operations in the storage medium 530 on the computer device 500.

[0253] The computer device 500 may also include one or more power supplies 540, one or more wired or wireless network interfaces 550, one or more input and output interfaces 560, and / or one or more operating systems 531, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. It will be appreciated by those skilled in the art that Figure 3 The illustrated computer device structure does not constitute a limitation on the computer device, and may include more or fewer components than illustrated, or combine certain components, or arrange the components differently.

[0254] The present invention also provides a computer device, the computer device includes a memory and a processor, the memory stores computer-readable instructions, when the computer-readable instructions are executed by the processor, the processor executes the steps of the hierarchical nonlinear physical model compilation optimization method in the above embodiments. The present invention also provides a computer-readable storage medium, the computer-readable storage medium can be a non-volatile computer-readable storage medium, the computer-readable storage medium can also be a volatile computer-readable storage medium, the computer-readable storage medium stores instructions, when the instructions are executed on a computer, the computer executes the steps of the hierarchical nonlinear physical model compilation optimization method.

[0255] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0256] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0257] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A hierarchical nonlinear physical model compilation optimization method, characterized in that: The hierarchical nonlinear physical model compilation optimization method comprises: Build a hierarchical digital twin physical model of the target physical object; Compiling the physical model, and optimizing the nonlinear equations contained in the physical model to obtain an optimized simulation mathematical model and compilation optimization information of each nonlinear equation; Based on the optimized simulation mathematical model, the target physical object is simulated, and the simulation results are evaluated in multiple dimensions to evaluate whether the simulation mathematical model meets the preset design requirements; If the simulation mathematical model does not meet the preset design requirements, then based on the compiled optimization information of each nonlinear equation group, the relevant variables and the initial values ​​of the relevant variables in the physical model are redefined; Recompiling the physical model, and optimizing the nonlinear equations contained in the physical model again, until the optimized simulation mathematical model meets the preset design requirements; The compiling of the physical model and optimizing the nonlinear equations contained in the physical model to obtain the optimized simulation mathematical model and the compilation optimization information of each nonlinear equation group include: S1, parsing the hierarchical structure of each nested sub-model in the physical model to obtain a plurality of sub-models having a hierarchical relationship; S2, searching for model variables with initial values ​​in each sub-model, and adding a priority attribute to each model variable with initial values; S3, respectively checking the unknown model variables and behavior constraint equations in each sub-model to determine the nonlinear loop equation group in each sub-model; S4, determining whether there is a nonlinear loop equation group that has not been compiled and optimized in each current sub-model; S5, if there is currently a nonlinear loop equation group that has not been compiled and optimized, then execute step S6; if there is currently no nonlinear loop equation group that has not been compiled and optimized, then execute step S12; S6, obtaining unknown model variables in the nonlinear loop equation group that is not currently compiled and optimized, and sorting the unknown model variables according to the priority of each unknown model variable; S7, constructing an initial nonlinear iteration variable set corresponding to the current nonlinear loop equation group; S8, adding the unknown model variable with the highest current priority and not compiled and optimized to the nonlinear iteration variable set to obtain an updated nonlinear iteration variable set; S9, using the unknown model variables in the updated nonlinear iteration variable set to construct the assignment equations of other unknown model variables in the current nonlinear loop equation group; S10, determining whether the unknown model variables in the updated nonlinear iteration variable set satisfy the solution of the current nonlinear loop equation group; S11, if the current nonlinear loop equations are satisfied, then execute step S4; if the current nonlinear loop equations are not satisfied, then execute steps S8-S10; S12, outputting the optimized simulation mathematical model and the compilation optimization information of each nonlinear equation group, wherein the compilation optimization information includes the nonlinear iteration variables used for iteratively solving the corresponding nonlinear equation group and the iteration initial value of each nonlinear iteration variable.

2. The hierarchical nonlinear physical model compilation optimization method according to claim 1, characterized in that: The step of searching for model variables with initial values ​​in each sub-model and adding a priority attribute to each model variable with initial values ​​comprises: Find model variables with initial values ​​in each sub-model; Based on the hierarchical structure of each sub-model, a priority attribute is added to each model variable with an initial value, wherein the model variable at the top level has the highest priority, and the priorities of the model variables at other levels decrease layer by layer; Determine whether the model variable with initial value currently found has multiple levels of redefinition; If there are multiple levels of redefinition and the initial values ​​of the model variables of the lower levels are redefined for the current level, the priority of the model variables of the multiple levels of redefinition is updated to the priority of the current level; If there are multiple levels of redefinition and the initial values ​​of the bottom-level model variables are repeatedly defined for the multiple levels, the priorities of the multi-level redefined model variables are updated to the priorities of the top level.

3. The hierarchical nonlinear physical model compilation optimization method according to claim 1, characterized in that: The sub-model is used to define the model variables and behavior constraint equations of the corresponding component modules in the target physical object, and the unknown model variables and behavior constraint equations in each sub-model are checked respectively to determine the nonlinear loop equation group in each sub-model, including: Check whether there is a set of behavior constraint equations in each sub-model one by one; If there is a behavior constraint equation group, then check whether each equation in the behavior constraint equation group contains at least one nonlinear term, wherein the nonlinear term includes the square, cube, exponential, logarithmic and trigonometric functions of the model variables; If each equation in the behavior constraint equation group contains at least one nonlinear term, then checking whether each unknown model variable in the behavior constraint equation group appears in at least one equation, and whether each unknown model variable is directly or indirectly dependent on each other; If each equation in the behavior constraint equation group contains at least one nonlinear term, each unknown model variable in the behavior constraint equation group appears in at least one equation, and each unknown model variable is directly or indirectly dependent on each other, then the currently checked behavior constraint equation group is determined to be a nonlinear loop equation group.

4. The hierarchical nonlinear physical model compilation optimization method according to claim 1, characterized in that: The step of adding the unknown model variable with the highest current priority and not compiled and optimized to the nonlinear iteration variable set to obtain the updated nonlinear iteration variable set includes: Select the unknown model variable with the highest current priority and not compiled and optimized from the unknown model variables after priority sorting; If there are multiple unknown model variables currently selected and they have the same priority, the unknown model variables that are not compiled and optimized are selected according to the default strategy; The currently selected unknown model variables that have not been compiled and optimized are added to the current nonlinear iteration variable set to obtain an updated nonlinear iteration variable set.

5. The hierarchical nonlinear physical model compilation optimization method according to claim 1, characterized in that: The step of using the unknown model variables in the updated nonlinear iteration variable set to construct the assignment equations of other unknown model variables in the current nonlinear loop equation group includes: When updating the nonlinear iteration variable set, the unknown model variables currently added to the nonlinear iteration variable set are marked as known model variables; All model variables in the updated nonlinear iteration variable set are used as nonlinear iteration variables for solving the nonlinear loop equation group; According to the constraint relationship between the variables in the nonlinear loop equation group, it is determined whether other unknown model variables in the current nonlinear loop equation group can be expressed as an assignment form by the current nonlinear iteration variable; If the current nonlinear iteration variable can be expressed in an assignment form, the assignment form of each equation in the nonlinear loop equation group is simplified to obtain the assignment equations of other unknown model variables in the current nonlinear loop equation group.

6. The hierarchical nonlinear physical model compilation optimization method according to claim 1, characterized in that: The step of judging whether the unknown model variables in the updated nonlinear iteration variable set satisfy the solution of the current nonlinear loop equation group comprises: Determine whether all other unknown model variables in the current nonlinear loop equation group have corresponding assignment equations; If there are corresponding assignment equations, then determine whether the residual equations in the nonlinear loop equations that have not been simplified in the assignment form can be iteratively solved by the unknown model variables in the updated nonlinear iteration variable set; If the unknown model variables in the updated nonlinear iteration variable set can be iteratively solved, it is determined that the unknown model variables in the updated nonlinear iteration variable set satisfy the solution of the current nonlinear loop equation set.

7. A hierarchical nonlinear physical model compilation and optimization device, characterized in that: The hierarchical nonlinear physical model compilation and optimization device comprises: A building module is used to build a hierarchical digital twin physical model of the target physical object; A compiling module, used for compiling the physical model and optimizing the nonlinear equations contained in the physical model to obtain an optimized simulation mathematical model and compilation optimization information of each nonlinear equation; A simulation module, used to simulate the target physical object based on the optimized simulation mathematical model, and to perform multi-dimensional evaluation on the simulation results to evaluate whether the simulation mathematical model meets the preset design requirements; A redefinition module, for redefining relevant variables and initial values ​​of relevant variables in the physical model based on compiled optimization information of each nonlinear equation group if the simulation mathematical model does not meet the preset design requirements; A recompiling module, used for recompiling the physical model and optimizing the nonlinear equations contained in the physical model again until the optimized simulation mathematical model meets the preset design requirements; Wherein, the compiling module includes: A model parsing unit, used for parsing the hierarchical structure of each nested sub-model in the physical model to obtain a plurality of sub-models having a hierarchical relationship; A priority adding unit, used for searching for model variables with initial values ​​in each sub-model, and adding a priority attribute to each model variable with initial values; An equation group search unit is used to check the unknown model variables and behavior constraint equations in each sub-model respectively to determine the nonlinear loop equation group in each sub-model; The first judgment unit is used to judge whether there is a nonlinear loop equation group that has not been compiled and optimized in each current sub-model; A first jump execution unit is used to execute the variable sorting unit if there is a non-linear loop equation group that has not been compiled and optimized, and to execute the compilation result output unit if there is no non-linear loop equation group that has not been compiled and optimized; A variable sorting unit is used to obtain unknown model variables in the nonlinear loop equation group that is not currently compiled and optimized, and sort each unknown model variable according to the priority of each unknown model variable; An iteration variable set construction unit, used to construct an initial nonlinear iteration variable set corresponding to the current nonlinear loop equation group; An iteration variable set updating unit is used to add the unknown model variable with the highest current priority and not compiled and optimized to the nonlinear iteration variable set to obtain an updated nonlinear iteration variable set; An assignment equation construction unit, used to construct assignment equations of other unknown model variables in the current nonlinear loop equation group using the unknown model variables in the updated nonlinear iteration variable set; A second judgment unit is used to judge whether the unknown model variables in the updated nonlinear iteration variable set satisfy the solution of the current nonlinear loop equation group; A second jump execution unit is used to execute the first judgment unit if the current nonlinear loop equation group solution is satisfied, and to execute the iterative variable set updating unit, the assignment equation construction unit and the second judgment unit in sequence if the current nonlinear loop equation group solution is not satisfied; The compilation result output unit is used to output the optimized simulation mathematical model and the compilation optimization information of each nonlinear equation group, wherein the compilation optimization information includes the nonlinear iteration variables used to iteratively solve the corresponding nonlinear equation group and the iteration initial value of each nonlinear iteration variable.

8. A computer device, characterized in that: The computer device comprises: a memory and at least one processor, wherein instructions are stored in the memory; The at least one processor calls the instructions in the memory to enable the computer device to execute the hierarchical nonlinear physical model compilation optimization method according to any one of claims 1 to 6.

9. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions are executed by the processor, the hierarchical nonlinear physical model compilation optimization method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • GMM-based power system digital twinborn parameter correction method and device

    CN113505490A

  • Synchronous phase modifier fault diagnosis method adopting digital twinborn model

    CN115310363A