Conference article

Client-side Modelica powered by Python or JavaScript

Rüdiger Franke
ABB, Germany

Download articlehttp://dx.doi.org/10.3384/ecp140961105

Published in: Proceedings of the 10th International Modelica Conference; March 10-12; 2014; Lund; Sweden

Linköping Electronic Conference Proceedings 96:115, p. 1105-1112

Show more +

Published: 2014-03-10

ISBN: 978-91-7519-380-9

ISSN: 1650-3686 (print), 1650-3740 (online)

Abstract

Modelica is primarily supported by simulation environments for the treatment of equation based models and model libraries. As of today Modelica is rarely used for the exchange of engineering data; visualization or interactive computing; even though the Modelica language offers a lot of interesting features for such applications.

This paper investigates the potential of lightweight Modelica tools that run directly in scripting or web clients. Two Modelica parsers have been implemented in the popular client-side languages Python and JavaScript.

The Modelica parser in Python is extended with a backend translating algorithmic Modelica definitions to Python. This gives access to existing Python packages from scripted Modelica. It also enables the interactive debugging of algorithmic Modelica code.

The Modelica parser in JavaScript offers a generic backend interface. The paper demonstrates two applications. First a simple analysis tool for Modelica packages running from the command line is demonstrated. The true potential of JavaScript is the embedding of engineering data as Modelica code with HTML5 documents and their processing on the client side; e.g. in Web browsers. The paper shows a Modelica text editor and parameter GUI generator running in a web browser.

Keywords

Modelica; scripting; interactive computing; data exchange; Lex; Yacc; Python; JavaScript; jQuery; HTML5.

References

[1] Modelica – A Unified Language for Systems Modeling, Language Specification, version 3.3, May 9, 2012. https://www.modelica.org/documents/ModelicaSpec33.pdf

[2] David Beazley: PLY (Python Lex Yacc), version 3.4, 2011. http://www.dabeaz.com/ply/

[3] Steve Jobs: Thoughts on Flash, April 2010. http://www.apple.com/hotnews/thoughts-on-flash/

[4] jQuery – write less, do more; and jQuery UI. http://jquery.com, http://jqueryui.com

[5] Node.js – a platform for easily building fast, scalable network applications. http://nodejs.org

[6] Zachary Carter: Jison – your friendly JavaScript parser generator, version 0.4.13, 2013. http://zaach.github.io/jison/

Citations in Crossref