How to convert python model to modelica model
A model conversion and model technology, applied in the field of Python model conversion to Modelica model, cross-language environment model encapsulation, can solve problems such as difficulty in finding, inability to use Python model co-simulation, and difficulty in system simulation, so as to improve packaging efficiency and improve construction. Modular efficiency, the effect of extended modeling
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Publication Date
- 2019-11-08
Smart Images

Figure 1 
Figure 2
Abstract
Description
technical field
[0001] The invention belongs to the field of computer software and relates to a cross-language environment model encapsulation technology, in particular to a method for converting a Python model into a Modelica model. Background technique
[0002] With the development of science and technology and the expansion of computer simulation technology, the problems to be solved in system simulation are becoming more and more complex. Modeling technology is no longer limited to the behavior of a single organization or individual, but emphasizes the joint development of simulation systems and models, thus forming A simulation system that can reflect the principles of different disciplines, different simulation environments and different simulation processes. In the process of system simulation development, models developed in different programming languages are often encountered. How to unify them for joint simulation is one of the important problems that must be so...
Examples
Embodiment Construction
[0028] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments.
[0029] see figure 1 As shown, a method for converting a Python model to a Modelica model includes the following steps:
[0030] Step 1, in the xml writing module, use the unified xml description file template to generate the xml file;
[0031] The function of the xml file is to sort out the input and output parameters of the Python model, the Python language functions required for the simulation of the Python model, and whether the Python model depends on other library files; Skeleton support for functions and Modelica models; through a unified xml description file template, it can be applied to a variety of Python models as much as possible, such as Python models that call Dlls, pure Python language models, etc.
[0032] Step 2, see figure 2 As shown, in the xml writing module, according to the composition content of the Python ...