Where can I find the lua script of a Co-Simulation model in OMSimulator (OpenModelica)? - openmodelica

I am trying to run a co-simulation model using OMSimulator. I managed to create a FMU from a TRNSYS model thanks to this tool: https://sourceforge.net/projects/trnsys-fmu/
When I import it, I get the following error:
[2] 12:23:32 Scripting Error
[fmiLogger] module FMI2XML: Start attribute is required for this causality, variability and initial combination
It seems that I need to initialize some variables (not sure about what) in the OMSimulator command line. I think that it is the Lua script I heard about, but I cannot really find it.
I would really appreciate it someone could help me on this, since the documentation (https://openmodelica.org/doc/OMSimulator/v2.0.1/html/OMSimulator.html) it is not enough for my level.
Thanks!!!

It seems to be a problem with the FMU and not OMSimulator. The start value is required in the modelDescription.xml file of the FMU according to the FMI specification.

Related

How to block students from reading Python module source code

I have written a module for teaching Python. I'd like to make it difficult for the smarter ones to view the source code as a short-cut. Does not need to be fully secure - disabling the inspect module might be enough - if this is possible.
In case this is useful to anyone else using Python3 for class tests etc here's what I've ended up doing (with thanks to wbwlkr).
python3 -OO -m py_compile testmod.py creates a file __pycache__/testmod.cpython-34.pyo
Creating a symbolic link to this file named testmod.pyc means the code can't easily be inspected.
One other consideration is that sensitive local variables should be overwritten when not needed or they can be queried by locals()
What you are searching for is a solution to "obfuscate" the source code of your module.
You could compile your module to byte-code, as suggested here :
https://stackoverflow.com/a/7418341/8714367

CountreExample generation in KodKod

I have just switched to working with KodKod I am still trying to understand it. I have wrote a program to help me understand I succeeded to see if the solution is SATISFIABLE or UNSATISFIABLE .
I want to be able to see the CountreExample like we normally do in Alloy, I found the Method proof() of the type solution but it always returns null .
I want to know if there is a way to return the CountreExample or not.
Thank you in advance.
Try to look at this examples of Alloy API usages: https://github.com/kaptoxic/alloy/tree/master/src/edu/mit/csail/sdg/alloy4whole

building opengm with python3

Hi I'm trying to build opengm with python3, which is allegedly supported. Crosspost to opengm forum here. The reason I ask is that I get an error on "PyInt_FromLong" which is according to this article something that shouldn't come up when porting a c library like opengm to python3. When I changed this to PyLong_FromLong, I ran into another compilation problem down the line from numpy.core.multiarray. Also note that it builds (with the appropriate ccmake options) with Python2 just fine.
My questions are:
1. Has anyone actually successfully build this?
2. Can anyone shed some light as to whether this is something on my end or theirs?
Thanks,
Chris

How to modify modelica library examples

I am trying to run the PumpingSystem Example in the openmodelica Fluid library using the nightly build 1.9.1+dev (r21018). Unfortunately the simulation crashes saying it failed to solve NLS at initialization.
I tried to modify the model either by creating a new one extending it (which only permits the modification of the parameters but not the structure, I understand that this is probably what extension means) or by copying the text view of the model to a new file, but then OMEdit crashes.
Will you please advise how I can create a copy that I can modify?
Thank you.
PS: I am running this on Linux, the Windows version seems to translate all libraries,creates an infinite amount of translation errors "expected package to have within ; but got ..." and then terminates with a translation error "C:/OpenModelica1.9.1Nightly/lib/omlibrary/Modelica 3.2.1/Blocks/Continuous/Internal/Filter/Utilities/normalizationFactor.mo:14:3-42:27] Error: An element with name normalizationResidue is already declared in this scope."
You can not modify the system libraries. You can only extend them.
Creating a copy of the model is currently not supported. You can follow this ticket https://trac.openmodelica.org/OpenModelica/ticket/2190
If you just copy paste the text, as you already did, you need to manually update the relative paths used in the model.

What should we install to include "D3dukmdt.h" in my VC++ code?

I want to use D3DDDIFormat enumeration in my code. So I included "D3dukmdt.h" as given in the link "D3DDDIFORMAT
But when I do # include "D3dukmdt.h" in my C++ file, I see that the header file D3dukmdt.h is not recognized at all.
Can anyone kindly help me in this. Should I install anything in order to include this header file.
Thanks in advance.
It looks like you need the Windows Driver Kit (WDK) to get access to such things. It seems unlikely to me that you are trying to write a driver and don't appreciate you need the driver kit so you may be better off explaining what you are trying to do to get a workable alternative explanation

Resources