Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

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

Active Publication Date: 2019-11-08
苏州同元软控信息技术有限公司
View PDF3 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] In the process of engineering modeling, if the system is built with Modelica language and a certain model is developed with Python language, under the existing technology, it is impossible to embed the Python model into the system for joint simulation, which will cause certain difficulties for system simulation
If it is necessary to convert the Python model to the Modelica model, the user not only needs to learn the official Python API by himself to realize the calling of the C language to the Python language, but also needs to learn the calling mechanism of the Modelica language to the C language; and because the encapsulation process is not a direct conversion, there is a C The language is used as the middle layer, and various errors will inevitably occur when directly simulating the Modelica model, and it is difficult to find out whether the real cause of the error is the C language function or the Modelica model

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • How to convert python model to modelica model
  • How to convert python model to modelica model

Examples

Experimental program
Comparison scheme
Effect test

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

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

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.

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

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F8/35G06F8/30
CPCG06F8/315G06F8/35
Inventor 邵进涛张晨曦江雷周凡利谢刚刘奇
Owner 苏州同元软控信息技术有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products