Unified modeling simulation method and system based on model and prototype
By adopting the two modeling languages Modelica and Julia in complex systems, combining geometric models and multi-field model transformation, unified information physics modeling is realized, solving the problems of overall performance improvement and model fusion of complex systems in the existing technology, and realizing unified modeling and simulation of multiple fields and multiple fields.
Patent Information
- Application Number
- CN202411627730.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-03-11
AI Technical Summary
It is difficult for the existing technology to achieve overall performance improvement of complex systems, and in digital engineering driven by models and data, scientific computing modeling and engineering physical modeling language are not unified, three-dimensional models and system-level simulation models are not closely integrated, and various models are dispersed and have poor linkage.
Modelica is used as the physical domain modeling language and Julia as the information domain modeling language. Through geometric models and multi-field model transformation, unified information physics modeling, geometric state synchronous modeling and integration of system models and professional models are realized.
It realizes unified modeling of information physics, supports multi-field and multi-field unified modeling and simulation of complex systems, improves the overall improvement ability of system performance, and solves the problems of model fusion and storage.
Smart Images

Figure CN119598715A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of system modeling and simulation, and in particular to a unified modeling and simulation method and system based on models and prototypes. Background Art
[0002] At present, the requirements for complex system performance indicators have been greatly improved, and the characteristics of systematization, systemicity, digitization, and intelligence have been continuously enhanced. The coupling between disciplines has become more in-depth. Relying on traditional single disciplines, single fields, and component design optimization cannot comprehensively grasp and improve equipment performance. In addition, model and data-driven digital engineering is an important starting point for the digitalization of weapons and equipment, but the language expression of scientific computing modeling and engineering physics modeling is not unified, the three-dimensional model and system-level simulation model are not closely integrated, the system model and professional model formats are different, and various models are scattered, poorly linked, and cannot be organically combined. Therefore, it is necessary to solve the problems of system professional integration modeling, information physics unified modeling, geometric state synchronization modeling, and organic combination and storage of models in terms of language and tools. Summary of the invention
[0003] The present invention provides a unified modeling and simulation method and system based on models and prototypes, which realizes unified information-physics modeling, synchronous modeling of geometric states, fusion modeling of system models and professional models, and organic combination and storage of various models.
[0004] In the first aspect, a unified modeling and simulation method based on models and prototypes is provided, which can realize unified modeling and simulation in multiple fields and multiple fields, including:
[0005] Modelica is used as the physical domain modeling language to build the physical domain model, and Julia is used as the information domain modeling language to build the information domain model. The physical domain model is obtained by converting the geometric model and the multi-field model.
[0006] Perform model fusion and simulation solution of physical domain models and information domain models;
[0007] When the model is merged, the physical domain model is used as the main model to integrate the information domain model. The object type of the integration is the function of the information domain. The function of the information domain includes the function name, input parameters, and return value. When integrated into the physical domain model, the input parameters become the input port of the physical domain model, and the return value becomes the output port of the physical domain model. The output interface of the physical domain model supports connection with the input port of the information domain model, and the input interface of the physical domain model supports connection with the output port of the information domain model.
[0008] During simulation and solving, the physical domain model and the information domain model generate execution modules separately. When the solving module of the physical domain model calls the solving module of the information domain model for solving, the solutions are performed in sequence according to the connected topological structure. Among them, the Julia model is compiled into a dynamic link library, and the Modelica physical domain model is compiled into C code. Through the C code compiler, the dynamic link library of the information-physics fusion model is generated, and then the solver loads the dynamic link library for information-physics fusion simulation.
[0009] In conjunction with the first aspect, in some implementations of the first aspect, the method satisfies at least one of the following:
[0010] In the process of Modelica model compilation, Modelica text is used as input to generate Modelica abstract syntax tree, and model C code is generated after equation analysis, ordered equation set, and equation optimization operations;
[0011] During the compilation process of the Julia model, the Julia abstract syntax tree is generated using text as input. After preprocessing and simplifying comments and invalid codes, the Julia intermediate representation IR is generated. Finally, LLVM is used to generate the Julia dynamic link library.
[0012] When the information-physics model is compiled uniformly, the Julia dynamic link library and the model C code are used as input, and the C compiler is used to generate the information-physics fusion dynamic link library; the solver is used to load the dynamic link library into an executable program to perform simulation and generate simulation results.
[0013] In conjunction with the first aspect, in some implementations of the first aspect, the process of converting the physical domain model through the geometric model includes:
[0014] Import 3D models: develop 3D model analysis modules and perform 3D model analysis;
[0015] Execute conversion: according to the conversion rules between 3D model and Modelica model, convert the 3D model into Modelica memory data;
[0016] Generate Modelica multi-body model: Convert Modelica memory data into Modelica text according to the defined converted Modelica model structure.
[0017] In conjunction with the first aspect, in certain implementations of the first aspect, the geometric model is converted into a physical domain model to satisfy:
[0018] A 3D model component generates a model body. The body consists of three components: two markers and a bodyShape. The type of the marker is Modelica.Mechanics.MultiBody.Parts.FixedTranslation, and the type of the bodyShape is Modelica.Mechanics.MultiBody.Parts.BodyShape. The shaping parameters and physical properties in the 3D model will be passed into the bodyShape, and the positioning parameters will be passed into the marker.
[0019] For the mass conversion of geometric models, the object volume is calculated first. For irregular models, the voxel method and integral method are used to obtain the volume. Then the mass is calculated based on the object density and the value is set in the parameter m of bodyShape.
[0020] The centroid conversion of the geometric model is achieved by weighted averaging the X, Y, and Z coordinates of all points on the object. If the number of valid points is small, the number of valid points is increased by interpolation to improve the accuracy of the centroid calculation. After calculating the centroid, the centroid vector is set to the parameter r_CM.
[0021] For the rotational inertia conversion of the geometric model, decompose the object into several mass points, and calculate the position vector r_i of each mass point relative to the center of mass of the rigid body; for each mass point, calculate its mass m_i relative to the center of mass of the rigid body; according to the position vector and mass of each mass point, calculate the nine components of the inertia tensor; set the inertia tensor to be represented as a 3x3 matrix I, then the calculation formula for each component is as follows, where x_i, y_i, z_i represent the x, y, z components of the position vector of the ith mass point relative to the center of mass, and ∑ represents the sum of all mass points; after the calculation is completed, set the value to the model parameters I_11, I_22, I_33, I_21, I_31, I_32.
[0022] In combination with the first aspect, in some implementation methods of the first aspect, the physical domain model is implemented through a model reduction tool through a multi-field model conversion process. The model reduction tool takes the input and output data sets of the CAE tool as input, and generates a called data model through machine learning and data fitting. The modelica language is then used to encapsulate the model, and finally integrated into the physical domain simulation model. The interface specifications called include: an initialization interface dma_construction(), which is used to initialize memory at the beginning of the program; a simulation call interface dma_dostep(input,*output), which is used to pass input to the program and obtain output calculated by the DMA program; and a release interface dma_destructor(), which is used to release program memory after all calculations are completed.
[0023] In combination with the first aspect, in some implementations of the first aspect, when converting the physical domain model, there is an execution intermediate format file, which is encapsulated and called by the physical domain model and can also be called by other platforms; the standard content includes: model description information expressed in XML, a dynamic link library, and a standard interface for calling; the intermediate file is encapsulated using the physical domain model to generate the physical domain model.
[0024] In combination with the first aspect, in some implementations of the first aspect, the method is called through the aerospace business domain language CAL; the uses of the CAL language include: using the information-physical fusion model for modeling and simulation; realizing the conversion of a three-dimensional model into a physical domain model; realizing the reduction of a multi-field model to a physical domain model; calling commercial CAD and CAE software interfaces to realize model construction and simulation; wherein,
[0025] The function for building an information physics model through CAL is to add a model function, which takes the model name and model type as parameters and outputs a physical domain model object;
[0026] Define the conversion function from 3D model to physical domain model through CAL, the parameter is 3D model file, and outputs physical domain model object;
[0027] The field model is reduced to a physical domain model function through CAL definition;
[0028] Through the CAL function, a mapping relationship between the CAL function and the interface is established.
[0029] In combination with the first aspect, in some implementations of the first aspect, the construction, integration and operation of the language-driven system model are realized through CAL domain language calls, and multiple operation APIs of business operations are encapsulated into an instruction or function; language features include: implementing multiple inheritance, dot operator member access, Python-style properties and interface programming by extending Julia's syntax; supporting function features: parameter passing is performed in a "shared passing" manner to avoid the overhead of copying.
[0030] In conjunction with the first aspect, in some implementations of the first aspect, a compressed package of the method includes:
[0031] The overall description file is described in XML and describes the overall information of the model, including the name, the types of models included, inputs, outputs, and internal parameters;
[0032] Geometry model file, including geometry model and geometry model description file;
[0033] Multi-domain mechanism model files based on algebraic differential equations, including Modelica models, model-dependent image resource files, model description files, and model display image files;
[0034] Information domain files based on scientific computing, including Julia models, image resource files that the models depend on, model description files, and model display images;
[0035] The library file for external calls is called through the dynamic link library call method, including the following interfaces: control function interface, execution function interface, state function interface, and model acquisition function interface.
[0036] In the second aspect, a unified modeling and simulation system based on models and prototypes is provided, including a language layer, a platform layer, a tool layer, and an application layer;
[0037] In the language layer, the Modelica standard is used to express the physical domain model, and Julia is used to express the information model domain model to achieve component-based cyber-physical unified modeling;
[0038] In the platform layer, cyber-physical fusion modeling and cyber-physical fusion simulation are performed; cyber-physical fusion modeling implements a physical domain modeling platform based on the Modelica standard and an information domain modeling platform based on the Julia standard; by defining the interface specification of Julia integration into the physical domain platform, the Julia information domain component is integrated into the physical domain platform to implement cyber-physical fusion modeling; cyber-physical fusion simulation implements compiling the Julia model into a dynamic link library and the Modelica physical domain model into C code, including calling the dynamic link library interface generated by the Julia model; through the C code compiler, the dynamic link library of the cyber-physical fusion model is generated, and then the solver loads the dynamic link library for cyber-physical fusion simulation;
[0039] In the tool layer, set up the geometric state fusion tool and the model reduction tool; the geometric state fusion tool is developed based on the Modelica physical domain modeling and simulation platform; it takes the three-dimensional model as input and automatically generates the Modelica physical domain model, and the model parameters include the mass, center of mass, and moment of inertia of the system; it also supports the editing of three-dimensional model parameters and the synchronous update of the physical domain model; the model reduction tool is used to solve the problem of slow calculation speed of professional CAE models. The model reduction tool is used to reduce the three-dimensional performance model to a one-dimensional functional model through central manifold model reduction, LS reduction model reduction, modal synthesis model reduction, intrinsic orthogonal decomposition model reduction, and neural network-based time-varying simulation;
[0040] In the application layer, the APIs of platforms and tools are encapsulated through the CAL domain language to form a CAL domain language for the application side; this language is used to achieve unified operations of various models and improve modeling and simulation efficiency; in addition, according to the topological relationship of the equipment structure, the constructed physical domain and information domain models are encapsulated and integrated into a performance prototype unit PMU, and the overall description of the model and the organization of various models are used to characterize the system-level performance of the equipment.
[0041] Compared with the prior art, the solution provided by the present invention includes at least the following beneficial technical effects:
[0042] 1. Express the three-dimensional geometric model of complex systems, multi-domain (electromechanical, thermal, etc.) mechanism models based on algebraic differential equations, multi-physics field (aerodynamic, thermal, etc.) models based on partial differential equations, and information domain (perception, data, communication, computing, and control, etc.) models based on scientific computing, and support unified modeling and solving of the above models.
[0043] 2. Provide simulation engine system API for modeling, integration and operation of the above models. By defining the aerospace modeling language CAL and calling the simulation engine system API, the construction, integration and operation of language-driven aerospace system models are realized.
[0044] 3. Provide standardized file formats to store and deliver the above models. This realizes unified modeling of information physics, synchronous modeling of geometric states, fusion modeling of system models and professional models, and organic combination and storage of various models.
[0045] 4. Use information-physical fusion modeling and simulation to enhance the information domain modeling and information-physical fusion modeling capabilities based on unified modeling in the physical domain, and realize the simulation of complex CPS systems.
[0046] 5. The geometric state fusion tool is used to realize the fusion of the three-dimensional model and the simulation model. Through simulation, the three-dimensional display information of the system can be observed in real time.
[0047] 6. Use model reduction tools to achieve the integration of complex finite element models and system-level models, so that professional and refined models can be used in the early stages of scheme design to achieve the effect of the detailed design stage.
[0048] 7. Use CAL language to reduce the cost of learning multiple languages and implement one language to drive the call of Modelica, Julia language, CAD, CAE tools, and simulation systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 A schematic diagram of a unified modeling and simulation system based on models and prototypes.
[0050] Figure 2 Schematic diagram of converting a multi-field model into a physical domain model.
[0051] Figure 3 Schematic diagram of model fusion of physical domain model and information domain model.
[0052] Figure 4 Schematic diagram of the simulation solution of the information-physics fusion model.
[0053] Figure 5 A schematic diagram of a unified modeling and simulation method based on models and prototypes called through CAL.
[0054] Figure 6 This is a schematic diagram of the external call interface of the performance prototype unit PMU. DETAILED DESCRIPTION
[0055] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0056] Figure 1 The invention shows a unified modeling and simulation system based on models and prototypes, which includes a language layer, a platform layer, a tool layer, and an application layer.
[0057] In the language layer, the Modelica standard is used to express the physical domain model, and Julia is used to express the information model domain model to achieve component-based cyber-physical unified modeling.
[0058] In the platform layer, information-physical fusion modeling and information-physical fusion simulation are performed. Information-physical fusion modeling implements a physical domain modeling platform based on the Modelica standard and an information domain modeling platform based on the Julia standard. By defining the interface specification of Julia integrated into the physical domain platform, the Julia information domain component is integrated into the physical domain platform to realize information-physical fusion modeling. Information-physical fusion simulation realizes compiling the Julia model into a dynamic link library (.dll, .so) and the Modelica physical domain model into C code (including calling the dynamic link library interface generated by the Julia model). The dynamic link library of the information-physical fusion model is generated through the C code compiler, and then the solver loads the dynamic link library for information-physical fusion simulation.
[0059] In the tool layer, set up the geometry state fusion tool and the model reduction tool. The geometry state fusion tool is developed based on the Modelica physical domain modeling and simulation platform. With the three-dimensional model as input, the Modelica physical domain model is automatically generated. The model parameters include the mass, center of mass, moment of inertia, etc. of the system. At the same time, it supports the editing of three-dimensional model parameters and the synchronous update of the physical domain model. The model reduction tool is aimed at the problem of slow calculation speed of professional CAE models. The model reduction tool uses a variety of reduction methods (central manifold model reduction, LS reduction model reduction, modal synthesis model reduction, intrinsic orthogonal decomposition model reduction, neural network-based time-varying simulation, etc.) to reduce the three-dimensional performance model to a one-dimensional functional model, so as to greatly reduce the amount of calculation, thereby realizing real-time simulation based on one- and three-dimensional fusion.
[0060] In the application layer, the CAL domain language is used to encapsulate the API of the platform and tools to facilitate users to better use the platform and tools, reduce platform and tool operations, and reduce language learning costs. The CAL domain language is formed for the application end. This language can be used to achieve unified operation of various models and improve modeling and simulation efficiency. In addition, the performance prototype unit (PMU) is used to define the format and composition of the performance prototype unit to achieve unified storage and delivery of the model, and to achieve the overall description of the model and the organization of various models.
[0061] The present invention also provides a unified modeling and simulation method based on a model and a prototype, which specifically includes the following steps.
[0062] Step 1: Use Modelica as the physical domain modeling language to build the physical domain model, and use Julia as the information domain modeling language to build the information domain model.
[0063] Modelica is mainly used to build physical domain models, such as mechanical, electrical, hydraulic, thermal, etc. Julia is mainly used to build information domain models such as control, network, and communication.
[0064] In some embodiments provided by the present invention, the physical domain model can be obtained by converting the geometric model.
[0065] The geometric model format is, for example, Step, ISG, etc. By establishing a mapping relationship between geometric model objects and physical model objects, the geometric model is converted into a physical domain model. The specific steps include: importing a 3D model: developing a 3D model parsing module to perform parsing of 3D models in Step and IGES formats; performing conversion: converting the 3D model into Modelica memory data according to the conversion rules between the 3D model and the Modelica model; generating a Modelica multi-body model: converting the Modelica memory data into Modelica text according to the defined converted Modelica model structure.
[0066] The conversion of geometric models into physical domain models meets the following requirements: a 3D model component (e.g., a rod) generates a model body, which consists of three components: two markers (of type Modelica.Mechanics.MultiBody.Parts.FixedTranslation) and a bodyShape (of type Modelica.Mechanics.MultiBody.Parts.BodyShape). The fixed parameters (3D model path) and physical properties in the 3D model are passed into the bodyShape, and the positioning parameters (position, posture, etc.) are passed into the marker. Other rules are shown in Table 1.
[0067] Table 1
[0068]
[0069]
[0070] In some embodiments, for mass conversion of geometric models, the volume of the object is first calculated, and for irregular models, the voxel method, integral method, etc. are used to obtain the mass, and then the mass is calculated according to the density of the object, and the value is set in the parameter m of bodyShape.
[0071] In some embodiments, the centroid conversion of the geometric model can be achieved by weighted averaging the X, Y, and Z coordinates of all points on the object. If the number of valid points is small, the number of valid points can be increased by interpolation to improve the accuracy of the centroid calculation. After the centroid is calculated, the centroid vector is set to the parameter r_CM.
[0072] In some embodiments, for the moment of inertia conversion of the geometric model, the object is decomposed into several mass points, and the position vector r_i of each mass point relative to the center of mass of the rigid body is calculated. For each mass point, its mass m_i relative to the center of mass of the rigid body is calculated. According to the position vector and mass of each mass point, the nine components of the inertia tensor are calculated. The inertia tensor is set to be represented as a 3x3 matrix I, then the calculation formula for each component is as follows, where x_i, y_i, z_i represent the x, y, z components of the position vector of the i-th mass point relative to the center of mass, and ∑ represents the sum of all mass points. After the calculation is completed, the value is set to the model parameters I_11, I_22, I_33, I_21, I_31, I_32.
[0073] In some embodiments provided by the present invention, the physical domain model can be obtained by converting a multi-field model. The formats of input variables, result variables, field animation files, etc. supported by the multi-field model include, for example, csv, case, and geo.
[0074] When converting the physical domain model, the accuracy requirements, algorithm type, and number of training times of the model reduction can be met. The model reduction tool mainly takes the input and output data sets of the CAE tool as input, and generates a callable data model through machine learning, data fitting, etc. Then it is encapsulated using the Modelica language and finally integrated into the physical domain simulation model. The calling interface specifications mainly include: initialization interface dma_construction(): used to initialize memory at the beginning of the program; simulation call interface dma_dostep(input,*output): the main function is to pass the input to the program and obtain the output calculated by the DMA program; release interface dma_destructor(): used to release program memory after all calculations are completed.
[0075] When converting the physical domain model, there can be an executable intermediate format file, which can be encapsulated and called by the physical domain model and can also be called by other platforms. The standard content includes: model description information (expressed in XML), running module (dynamic link library), and standard calling interface (providing C header file). The intermediate file is encapsulated by the physical domain model to generate the physical domain model.
[0076] Step 2: Perform model fusion and simulation solution of the physical domain model and the information domain model.
[0077] During model fusion, the physical domain model is used as the main model to integrate the information domain model. The object type of the integration is the function of the information domain. The function of the information domain includes the function name, input parameters, and return value. When integrated into the physical domain model, the input parameters become the input port of the physical domain model, and the return value becomes the output port of the physical domain model. The output interface of the physical domain model supports connection with the input port of the information domain model, and the input interface of the physical domain model supports connection with the output port of the information domain model.
[0078] When merging models, you can display the components of the Modelica physical domain model and the Julia information domain model through a unified graphical editing interface; and edit Modelica and Julia code through a unified text editing interface. A single component is expressed using Modelica or Julia, and then integrated at the component level using the Modelica language as a framework. For details, see Figure 2 , including using Modelica to define Julia object classes, defining Julia model code specifications, creating new instances of Julia object classes, editing Julia object text, and connecting physical domain models and information domain models.
[0079] When solving the simulation after model fusion, the physical domain model and the information domain model generate executable modules separately. When the solution module of the physical domain model calls the solution module of the information domain model for solution, the solutions are performed in sequence according to the connected topological structure.
[0080] During simulation, the Julia model is compiled into a dynamic link library (.dll, .so), and the Modelica physical domain model is compiled into C code (including the dynamic link library interface generated by calling the Julia model). The dynamic link library of the information-physics fusion model is generated through the C code compiler, and then the solver loads the dynamic link library for information-physics fusion simulation. For details, see Figure 3 .
[0081] During the compilation process of the Julia model, the Julia abstract syntax tree is generated using text as input. After preprocessing and simplifying comments and invalid codes, the Julia intermediate representation IR is generated, and finally LLVM is used to generate the Julia dynamic link library.
[0082] In the process of Modelica model compilation, Modelica text is used as input to generate Modelica abstract syntax tree, and model C code is generated through operations such as equation analysis, ordered equation set, equation optimization, etc.
[0083] When the information-physics model is compiled uniformly, the Julia dynamic link library and the model C code are used as input to generate the information-physics fusion dynamic link library through the C compiler. The dynamic link library is loaded into the solver to become an executable program, and the simulation is performed to generate the simulation results.
[0084] In some embodiments provided by the present invention, the above-mentioned multi-domain and multi-field unified simulation method can be called through the aerospace business domain language (CAL). The uses of the CAL language include, for example: being able to use the information-physical fusion model for modeling and simulation; being able to realize the conversion of a three-dimensional model into a physical domain model; being able to realize the reduction of a multi-field model to a physical domain model; being able to call commercial CAD and CAE software interfaces to realize model construction and simulation.
[0085] The CAL domain language calls the simulation engine system API to implement the construction, integration and operation of the language-driven system model. It can encapsulate multiple business operation APIs (for example, adjusting the combustion area of the charge column includes setting the area parameters of the three-dimensional geometric model and setting the area parameters of the physical model) into one instruction or function. Language features include: implementing multiple inheritance, point operator member access, Python-style properties, and interface programming by extending Julia's syntax; supporting function features: parameter passing is performed in a "shared passing" manner to avoid the overhead of copying. Parameters can have the following characteristics: each parameter is separated by a comma and passed in by position; optional parameters all require a default value, defined with =; support for control flow and loops; support for macros; keyword parameters are marked with names and placed after the semicolon in the function signature, for example:
[0086] function func(req1,req2;key1=dflt1,key2=dflt2)
[0087] #doing
[0088] end
[0089] The implementation of the above multi-domain and multi-field unified simulation method through CAL call can be found in Figure 5 , including: developing the external interface of the engine system including modeling, integration, simulation, etc., so that the external system can call the interface; developing the CAL language parsing module, which can parse the text into structured instruction objects based on lexical, grammatical and semantic features; establishing a mapping relationship between the instruction object and the external interface of the engine system, and calling different types of interfaces according to the instruction object.
[0090] In some embodiments, functions of information-physical models can be constructed through CAL, for example, by adding a model function whose parameters are the model name and model type, and outputting a physical domain model object.
[0091] In some embodiments, a function for converting a three-dimensional model to a physical domain model may be defined by CAL, for example, a conversion function, the parameter of which is a three-dimensional model file, and the output is a physical domain model object.
[0092] In some embodiments, the field model can be reduced to a physical domain model function through the CAL definition.
[0093] In some embodiments, a mapping relationship between a CAL function and an interface can be established through a CAL function. For example, if commercial software supports calling an interface through Python code, a mapping relationship between the CAL interface and Python code is established, and when calling, CAL is converted into Python code to implement the calling of commercial software.
[0094] In some embodiments provided by the present invention, the performance prototype unit PMU file released by the multi-domain multi-field unified simulation system or method is essentially a compressed package, which mainly includes a model description file, a library file (dll, so) for external calls, a resource file and a model file (geometric model, CAE model). The calling method of the performance prototype unit is as follows: Figure 6 shown.
[0095] The overall description file in the compressed package can be described using XML, which mainly describes the overall information of the model, including the name, model types included, input, output, and internal parameters.
[0096] The geometry model files in the compressed package can include geometry models and geometry model description files in mainstream formats.
[0097] The multi-domain (electromechanical, thermal, etc.) mechanism model file based on algebraic differential equations in the compressed package may include Modelica models, resource files such as pictures that the model depends on, model description files, and model display picture files.
[0098] The information domain (perception, data, communication, computing, and control, etc.) files based on scientific computing in the compressed package can include Julia models, resource files such as pictures that the models depend on, model description files, and model display pictures.
[0099] The compressed package can also include files related to the following contents: multi-physics field (gas, dynamic, force, heat) source model; reduced-order multi-physics field (gas, dynamic, force, heat) Modelica model.
[0100] The library files (dll, so) in the compressed package for external calls can be called through dynamic link library calls, including the following interfaces: control function interface, execution function interface, state function interface, and model acquisition function interface.
[0101] Although the present invention is disclosed as above in the form of a preferred embodiment, it is not intended to limit the present invention. Any person skilled in the art may make possible changes and modifications without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention shall be based on the scope defined by the claims of the present invention.
Claims
1. A unified modeling and simulation method based on models and prototypes, characterized in that: include: Modelica is used as the physical domain modeling language to build the physical domain model, and Julia is used as the information domain modeling language to build the information domain model. The physical domain model is obtained by converting the geometric model and the multi-field model. Perform model fusion and simulation solution of physical domain models and information domain models; When the model is merged, the physical domain model is used as the main model to integrate the information domain model. The object type of the integration is the function of the information domain. The function of the information domain includes the function name, input parameters, and return value. When integrated into the physical domain model, the input parameters become the input port of the physical domain model, and the return value becomes the output port of the physical domain model. The output interface of the physical domain model supports connection with the input port of the information domain model, and the input interface of the physical domain model supports connection with the output port of the information domain model. During simulation and solving, the physical domain model and the information domain model generate execution modules separately. When the solving module of the physical domain model calls the solving module of the information domain model for solving, the solutions are performed in sequence according to the connected topological structure. Among them, the Julia model is compiled into a dynamic link library, and the Modelica physical domain model is compiled into C code. Through the C code compiler, the dynamic link library of the information-physics fusion model is generated, and then the solver loads the dynamic link library for information-physics fusion simulation.
2. The method according to claim 1, characterized in that The method satisfies at least one of the following: In the process of Modelica model compilation, Modelica text is used as input to generate Modelica abstract syntax tree, and model C code is generated after equation analysis, ordered equation set, and equation optimization operations; During the compilation process of the Julia model, the Julia abstract syntax tree is generated using text as input. After preprocessing and simplifying comments and invalid codes, the Julia intermediate representation IR is generated. Finally, LLVM is used to generate the Julia dynamic link library. When the information-physics model is compiled uniformly, the Julia dynamic link library and the model C code are used as input, and the dynamic link library of information-physics fusion is generated through the C compiler; Use the solver to load the dynamic link library into an executable program, perform simulation and generate simulation results.
3. The method according to claim 1, characterized in that The process of converting the physical domain model through the geometric model includes: Import 3D models: develop 3D model analysis modules and perform 3D model analysis; Execute conversion: according to the conversion rules between 3D model and Modelica model, convert the 3D model into Modelica memory data; Generate Modelica multi-body model: Convert Modelica memory data into Modelica text according to the defined converted Modelica model structure.
4. The method according to claim 3, characterized in that The geometric model is converted into a physical domain model to meet the following requirements: A 3D model component generates a model body. The body consists of three components: two markers and a bodyShape. The type of the marker is Modelica.Mechanics.MultiBody.Parts.FixedTranslation, and the type of the bodyShape is Modelica.Mechanics.MultiBody.Parts.BodyShape. The shaping parameters and physical properties in the 3D model will be passed into the bodyShape, and the positioning parameters will be passed into the marker. For the mass conversion of geometric models, the volume of the object is calculated first, and for irregular models, the voxel method and integral method algorithms are used to obtain it; Then calculate the mass based on the object density and set the value to the parameter m of bodyShape; The centroid transformation of the geometric model is achieved by weighted averaging the X, Y, and Z coordinates of all points on the object; if the number of valid points is small, the number of valid points is increased by interpolation to improve the accuracy of the centroid calculation; After calculating the centroid, set the centroid vector to the parameter r_CM; For the rotational inertia conversion of the geometric model, decompose the object into several mass points, and calculate the position vector r_i of each mass point relative to the center of mass of the rigid body; for each mass point, calculate its mass m_i relative to the center of mass of the rigid body; according to the position vector and mass of each mass point, calculate the nine components of the inertia tensor; set the inertia tensor to be represented as a 3x3 matrix I, then the calculation formula for each component is as follows, where x_i, y_i, z_i represent the x, y, z components of the position vector of the ith mass point relative to the center of mass, and ∑ represents the sum of all mass points; after the calculation is completed, set the value to the model parameters I_11, I_22, I_33, I_21, I_31, I_32.
5. The method according to claim 1, characterized in that The process of physical domain model conversion through multi-field model is realized by model reduction tool. The model reduction tool takes the input and output data sets of CAE tool as input, and generates the called data model through machine learning and data fitting. It is then encapsulated using Modelica language and finally integrated into the physical domain simulation model. The called interface specifications include: initialization interface dma_construction(), which is used to initialize memory at the beginning of the program; simulation call interface dma_dostep(input,*output), which is used to pass input to the program and obtain the output calculated by DMA program; release interface dma_destructor(), which is used to release program memory after all calculations are completed.
6. The method according to claim 5, characterized in that When converting the physical domain model, there is an execution intermediate format file, which is encapsulated and called by the physical domain model and can also be called by other platforms; The standard content includes: model description information expressed in XML, dynamic link library, and standard calling interface; The intermediate files are encapsulated using the physical domain model to generate the physical domain model.
7. The method according to claim 1, characterized in that The method is called through the aerospace business domain language CAL; the uses of the CAL language include: using the information-physics fusion model for modeling and simulation; realizing the conversion of three-dimensional models into physical domain models; realizing the reduction of multi-field models to physical domain models; calling commercial CAD and CAE software interfaces to realize model construction and simulation; wherein, The function for building an information physics model through CAL is to add a model function, which takes the model name and model type as parameters and outputs a physical domain model object; Define the conversion function from 3D model to physical domain model through CAL, the parameter is 3D model file, and outputs physical domain model object; The field model is reduced to a physical domain model function through CAL definition; Through the CAL function, a mapping relationship between the CAL function and the interface is established.
8. The method according to claim 1, characterized in that Through the CAL domain language call, the construction, integration and operation of the language-driven system model are realized, and multiple operation APIs of business operations are encapsulated into an instruction or function; the language features include: by extending Julia's syntax, multiple inheritance, dot operator member access, Python-style properties and interface programming are realized; support function features: parameter passing is performed in a "shared passing" manner to avoid the overhead of copying.
9. The method according to claim 1, characterized in that: The compressed package of the method comprises: The overall description file is described in XML and describes the overall information of the model, including the name, model types, inputs, outputs, and internal parameters; Geometry model file, including geometry model and geometry model description file; Multi-domain mechanism model files based on algebraic differential equations, including Modelica models, model-dependent image resource files, model description files, and model display image files; Information domain files based on scientific computing, including Julia models, image resource files that the models depend on, model description files, and model display images; The library file for external calls is called through the dynamic link library call method, including the following interfaces: control function interface, execution function interface, state function interface, and model acquisition function interface.
10. A unified modeling and simulation system based on models and prototypes, characterized in that: Includes language layer, platform layer, tool layer, and application layer; In the language layer, the Modelica standard is used to express the physical domain model, and Julia is used to express the information model domain model to achieve component-based cyber-physical unified modeling; In the platform layer, cyber-physical fusion modeling and cyber-physical fusion simulation are performed; The cyber-physical fusion modeling realizes the physical domain modeling platform based on the Modelica standard and the information domain modeling platform based on the Julia standard; by defining the interface specification of Julia integrated into the physical domain platform, the Julia information domain component is integrated into the physical domain platform to realize cyber-physical fusion modeling; cyber-physical fusion simulation realizes compiling the Julia model into a dynamic link library and the Modelica physical domain model into C code, including calling the dynamic link library interface generated by the Julia model; through the C code compiler, the dynamic link library of the cyber-physical fusion model is generated, and then the solver loads the dynamic link library for cyber-physical fusion simulation; In the tool layer, set up the geometric state fusion tool and the model reduction tool; the geometric state fusion tool is developed based on the Modelica physical domain modeling and simulation platform; it takes the three-dimensional model as input and automatically generates the Modelica physical domain model, and the model parameters include the mass, center of mass, and moment of inertia of the system; it also supports the editing of three-dimensional model parameters and the synchronous update of the physical domain model; the model reduction tool is used to solve the problem of slow calculation speed of professional CAE models. The model reduction tool is used to reduce the three-dimensional performance model to a one-dimensional functional model through central manifold model reduction, LS reduction model reduction, modal synthesis model reduction, intrinsic orthogonal decomposition model reduction, and neural network-based time-varying simulation; In the application layer, the APIs of the platform and tools are encapsulated through the CAL domain language, forming a CAL domain language for the application end; this language is used to achieve unified operations of various models and improve modeling and simulation efficiency; In addition, according to the topological relationship of the equipment structure, the constructed physical domain and information domain models are encapsulated and integrated into a performance prototype unit PMU. Through the overall description of the model and the organization of various models, the system-level performance of the equipment is characterized.