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

CN106681726BActive Publication Date: 2019-11-08苏州同元软控信息技术有限公司
3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Publication Date
2019-11-08

Smart Images

  • Figure 1
    Figure 1
  • Figure 2
    Figure 2
Patent Text Reader

Abstract

The invention discloses a method for converting a Python model to a Modelica model. A user only needs to sort out the Python model and fills in an xml file according to an xml data format, and a C language function model and a Modelica language model can be generated by automatic encapsulation through the support of a C language generation module and a Modelica language generation module. The method not only can greatly shorten coding time and testing time in the model encapsulation and improve the model encapsulation efficiency, but also completely meet the requirement for the successful encapsulation of different Python models. The method solves the integration problem of the Python model and the Modelica language, fills the market blank that the current market lacks tools which meet the requirement, helps the two languages complement with each other, and assists engineers in performing more effective simulation tests; at the same time, the engineering system modeling efficiency is improved, and the modeling mode is expanded.
Need to check novelty before this filing date? Find Prior Art

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 ...