2

I have an ongoing project in which a physical modelling in Modelica is as FMU extracted. These functional mock-up units are used with PyFMI to realize simulations. To this purpose, I wrote some Python modules as well. What I want to do is showing some examples of the simulation results without exposing my model(.fmu file) and my modules. The user will be able to change parameters in the model and simulate accordingly. To sum up, I want it to be a black box only with input parameters and output plots.

I have been trying doing so with Jupyter notebook(I am open to any other solution). I extracted my Python modules as .pyd files to hide the code and I am now importing them into notebook. So far it seems reasonable to me. But I don't know how to hide the .fmu file. I would import the model in Python workspace and then save the whole workspace, if possible.

To summarize,

1) Is my code safe as .pyd file?

2) Is it possible to save the workspace in Python? Or do you have another solution for my .fmu file?

3) Could there by some other tool more suitable to this purpose than Jupyter? After all I want it to reachable for anyone through web and to be tried as they wanted. But the model itself isn't allowed to be distributed.

falsterbo
  • 520
  • 1
  • 3
  • 15

2 Answers2

1

Well, it depends on your application. I recently launched a site called modelica.university that showcases applications involving Modelica and FMI. The underlying platform is proprietary but the site is public. So if you were interested in hosting your models there, I'd be willing to discuss it. The key points is that it does address your concern because the models themselves are not accessible via the web, only the inputs and outputs.

Michael Tiller
  • 9,291
  • 3
  • 26
  • 41
1

Well, if you need to send FMU, you can compile it not to contain source codes or modelica sources within it. OR you can hide FMU by running it on some server and exposing only some API to access it.

I did some similar work in the past during our research project at university. The pilot implementation exposes FMU to .NET backend which gives REST api to manipulate model inputs, control simulation and get model variables. The UI in pure HTML5 and Javascript has access only to the REST API via HTTP with some limited ability to show model variables and controls over simulation.

A demo simulator is e.g. at: Simulator of Haemodynamics

Within the simulator, it's posible to edit the screen in a 'Simulation Editor' tab. Btw., it was written probably the same year when project Jupyter evolves from IPython. The underlying platform is opensource, supports FMU 1.0. So it's worth to consider Jupyter notebooks can be clients of a appropriate backend.

Tomas Kulhanek
  • 867
  • 1
  • 10
  • 18