- Index
- » Users
- » adeas
- » Profile
Posts
Choose csv result format in `Simulation->Simulation Setup->Output->Output Format` and then simulate the model. This will generate the csv result file for all variables instead of the default mat file.
Adeel.
The problem is due to "C:/Users/VED/Desktop/РЎРљРўРњ/OM_sample". You have special characters in the package location. Either change the package location or download the latest build which handles the special characters better.
Adeel.
We need more information. Compilation log etc.
Adeel.
And yes you need to restart after the change.
Adeel.
Change from Modelica 3.2.3 to Modelica 4.0.0 in the Tools->Libraries.
Adeel.
I can't find Transient 1.0.3. The only master version available is 2.0.0 and is using Modelica 4.0.0
https://github.com/ClaRaLibrary/TransiEnt
Adeel.
Any specific class that you are trying to open?
I test the same on my side and try to debug the issue.
Adeel.
It is hard for us to know why an older version is not working on a specific platform.
Maybe we can help you getting your models to run in the latest version. What is the exact problem when you use the latest build?
Adeel.
It says that you are using OpenModelica v1.14.1 (64-bit) and the latest available stable release is 1.18.1.
Please download the latest release or the nightly build and try again.
Adeel.
Looking at the extents in the annotation I can see that it should be vertically flipped. And I get the same behavior in OMEdit.
I even tested your model in Dymola and got the same output.
Here is the code where bitmap should be drawn without any vertical or horizontal flip,
Code:
model iconTest
equation
annotation(
Icon(graphics = {Bitmap(extent = {{-100, -100}, {100, 100}}, imageSource = "/9j/4AAQSkZJRgABAQIAJQAlAAD/4QhoRXhpZgAASUkqAAgAAAAGABoBBQABAAAAVgAAABsBBQABAAAAXgAAACgBAwABAAAAAwAAADEBAgANAAAAZgAAADIBAgAUAAAAdAAAAGmHBAABAAAAiAAAAJoAAADOAgAAEwAAAM4CAAATAAAAR0lNUCAyLjEwLjIwAAAyMDIxOjEwOjE0IDE1OjE4OjEwAAEAAaADAAEAAAABAAAAAAAAAAgAAAEEAAEAAAAAAQAAAQEEAAEAAAAAAQAAAgEDAAMAAAAAAQAAAwEDAAEAAAAGAAAABgEDAAEAAAAGAAAAFQEDAAEAAAADAAAAAQIEAAEAAAAGAQAAAgIEAAEAAABZBwAAAAAAAAgACAAIAP/Y/+AAEEpGSUYAAQEAAAEAAQAA/9sAQwAIBgYHBgUIBwcHCQkICgwUDQwLCwwZEhMPFB0aHx4dGhwcICQuJyAiLCMcHCg3KSwwMTQ0NB8nOT04MjwuMzQy/9sAQwEJCQkMCwwYDQ0YMiEcITIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy/8AAEQgBAAEAAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+v/EAB8BAAMBAQEBAQEBAQEAAAAAAAABAgMEBQYHCAkKC//EALURAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJicoKSo1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uLj5OXm5+jp6vLz9PX29/j5+v/aAAwDAQACEQMRAD8A9/ooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiqVAF2isekoA2aKyK0aAJqKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAoornqANmuKrlq9GoA84rWr1GigDhKsV2dFAHndZNetUUAeP13ddBXKUAddTq8cr1ugCxRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFU6AMmuLqjXsFABUlFFABRRRQAUUUUAFFFFABRRRQBn15XXslZtAFqrFeQ169QAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFeWV6bXldAHo9adFFABRRTaAHUVylcrQB6rRXn9dxQBYooooAKKKKACiiigDgq3a1680oA9UooooAKKKKACiiigAooooAKKKKACiiigAooooA56supq0KAN+iiigArymu5rm6ANGpK6yuIoA5yqNfNFfUlAHqNWq8wr0+gAooooAKKya82oA9frxmvTa4ygD0ulplPoAKKKKACiiigAooooAKKKKACiiigAooooA5CtOqNMoA62iiigDiazq62vM6AL1RV4pXq1AHTVtV2VY9AHl1e015tXpNABRRRQB5lW7W/XBUAQ1drs6fQAVo15TXq1ABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFAGdXD16RXj1AHsVFNp1ABXm9ekUlAHkdaVdTXK0AdLXn1dlXY0AR1ZoooAKKKKACiiigAooooA87rqK1K8ioA9lopKWgAooooAKKKKACiiigAooooAKKKKACufroKKAPKa9NqhXDUAeo0V4lSUAe3UV4jRQB7dRXiNPoA9rorzmvQqAJKKKKACiiigAoorhqAO5rgK5SpqAPTa16gqegAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKzKhoA2aKxqKANmisaloAqVhV6BXmFAHp9FFFABRRRQAV5tXpNebUAdzWhWdWjQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFAHPVVrq6KAOUorq6KAOUpa6qigArymvVq8hoA9eorma6WgBaKKKACvNq9JrzCgDvq0aq1aoAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigDh6y69MooA8zor0yigDzOn16TRQAlNp9FAHE1ydexUlAHnldfUdcxQBu1wtdTXX0AS0UUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQBkVBRVagCzRVaigCzS1VpaAOmooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooA//2QD/4gKwSUNDX1BST0ZJTEUAAQEAAAKgbGNtcwQwAABtbnRyUkdCIFhZWiAH5QAKAA4ADQARAARhY3NwTVNGVAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLWxjbXMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA1kZXNjAAABIAAAAEBjcHJ0AAABYAAAADZ3dHB0AAABmAAAABRjaGFkAAABrAAAACxyWFlaAAAB2AAAABRiWFlaAAAB7AAAABRnWFlaAAACAAAAABRyVFJDAAACFAAAACBnVFJDAAACFAAAACBiVFJDAAACFAAAACBjaHJtAAACNAAAACRkbW5kAAACWAAAACRkbWRkAAACfAAAACRtbHVjAAAAAAAAAAEAAAAMZW5VUwAAACQAAAAcAEcASQBNAFAAIABiAHUAaQBsAHQALQBpAG4AIABzAFIARwBCbWx1YwAAAAAAAAABAAAADGVuVVMAAAAaAAAAHABQAHUAYgBsAGkAYwAgAEQAbwBtAGEAaQBuAABYWVogAAAAAAAA9tYAAQAAAADTLXNmMzIAAAAAAAEMQgAABd7///MlAAAHkwAA/ZD///uh///9ogAAA9wAAMBuWFlaIAAAAAAAAG+gAAA49QAAA5BYWVogAAAAAAAAJJ8AAA+EAAC2xFhZWiAAAAAAAABilwAAt4cAABjZcGFyYQAAAAAAAwAAAAJmZgAA8qcAAA1ZAAAT0AAACltjaHJtAAAAAAADAAAAAKPXAABUfAAATM0AAJmaAAAmZwAAD1xtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAAgAAAAcAEcASQBNAFBtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAAgAAAAcAHMAUgBHAEL/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBT/wgARCAAgACADAREAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAABAUCAwYI/8QAFAEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEAMQAAAB6pAyQUCGcGA8IGfGhaGC4uCz/8QAGxAAAwEBAAMAAAAAAAAAAAAAAgMEAQAFFBX/2gAIAQEAAQUC4q1ia6QaXVHoT2+U+a2ykSlEsMWLxq6ZmMZlO+nIrUo50YuYyVLS7//EABQRAQAAAAAAAAAAAAAAAAAAAED/2gAIAQMBAT8BB//EABQRAQAAAAAAAAAAAAAAAAAAAED/2gAIAQIBAT8BB//EACQQAAEDAwMEAwAAAAAAAAAAAAECERIAAyEEEDEiQVGBMlLC/9oACAEBAAY/AqKRJahzBJLVEOFfVQY7LKSymwfFW9Lp7Qu3cNafqUO59ck1aWlCpqE7eOC1BQLg5BpSFfFQY0JwuRwFHTk/qrlzEkSfw4oJJkecBhtIhHu2DUlWwT3Pnb//xAAgEAEAAQQCAgMAAAAAAAAAAAABEQAhMVFBYRBxgZHB/9oACAEBAAE/IaxBAPQlLHzTRIcy4tw5O/GL1NhsNZhAyk2p4HIc2WmGbZvuifeHpeJoAQoGEq9siDTUpHEik0oB9RHVWDjkHJT8oJcjgEswEsBO/Chldz9tKFUiDDTs6fH/2gAMAwEAAgADAAAAEIJIIIBIJP/EABQRAQAAAAAAAAAAAAAAAAAAAED/2gAIAQMBAT8QB//EABQRAQAAAAAAAAAAAAAAAAAAAED/2gAIAQIBAT8QB//EAB4QAQEAAwADAAMAAAAAAAAAAAERACExEEFRYYGh/9oACAEBAAE/EMoU0OuDEViMQx5h56r/ABBAiChFK98FM2uCKpHsUf1gSIHe1cgooUsaCfTysmjnYBkVdGEHaWjUFEfYmGyhpRhGJx33Gm/hPNjq1sNnDqV62lWugtzoJv3m1/E4XDE0AVA1CBhCIC6iT6OCx9qEvj/YPx4//9k=")}));
end iconTest;
Adeel.
Please share a minimal test model.
If you think it is a bug then report it here https://github.com/OpenModelica/OpenMod … new/choose
Adeel.
This issue is already fixed in https://github.com/OpenModelica/OpenMod … 9f0b275d57
Adeel.
Hello Santiago,
I just sent a reply to your question via email.
Where do you find information about simforge? Simforge is really really old and was replaced by OMEdit several years ago.
You should use OMEdit for graphical modelling.
Adeel.
Are you trying to export CSV of plotted values from OMEdit?
There were some issues with the export of CSV that are recently fixed. I suggest updating to a latest nightly build. Version 1.14 is anyway very old.
Adeel.
Ticket is a bug report about your issue on our trac system. Please go to the following link to report your bug.
https://trac.openmodelica.org/OpenModelica/newticket
Adeel.
It is hard to understand the problem without actual test model. Please create a ticket about this issue with example model here https://trac.openmodelica.org/OpenModelica/newticket
Adeel.
Continued discussion on https://www.openmodelica.org/forum/defa … to-save-it
Adeel.
Continued discussion on https://www.openmodelica.org/forum/defa … to-save-it
Adeel.
I remember an old bug with same issue but it was fixed a long time ago. Which version of OM are you using?
Adeel.
You need to install the debug binaries. Read the OMDev/INSTALL.txt section QT DEBUG DLLS (optional).
Adeel.
Yes you need to set an environment in Qt creator.
I personally use Qt creator for debugging purposes. My process is following,
- Compile everything form msys first time. So all dependencies are compiled as well.
- Set the environment in Qt Creator
- Set the tool chain in Qt Creator.
- Compile from Qt creator again. Note that Qt creator will only compile OMEdit and not the dependencies.
Adeel.
Recommended way is to compile in MSYS.
Which Qt creator you are using? The one that comes with OMDev?
Adeel.
Hello Brunad,
I looked at the zip fle you uploaded here https://trac.openmodelica.org/OpenModelica/ticket/6166
If your bug is related to seeing M icon in the library view under Fluid->Valves then I can say that it is not a graphical bug. We intentionally defer the loading of connectors when expanding the libraries. If you double click on them to open then they are loaded automatically in the libraries view.
Adeel.
Here is the basic users guide https://openmodelica.org/doc/OpenModeli … ugger.html
For detailed study you can also read the debugger papers,
https://ep.liu.se/ecp/096/020/ecp14096020.pdf
https://www.openmodelica.org/images/doc … 20copy.pdf
https://ep.liu.se/ecp/076/046/ecp12076046.pdf
Adeel.
Perhaps you are trying to do it on a model. Its only allowed on top level package.
Adeel.
In case you want to debug OSG then read the section OpenSceneGraph DEBUG DLLS (optional) in INSTALL.txt file in OMDev.
Adeel.
Make sure you have this commit checked out https://github.com/OpenModelica/OpenMod … bee2d55b1b
Adeel.
To update the canvas size, right click on the canvas and choose Properties and then update the extents accordingly.
I didn't understand what you mean by Goto reference tags.
Adeel.
Yes!
Adeel.
It was not implemented correctly and was buggy as well. A proper better implementation is planned for 2.0 release.
Adeel.
Time for a new ticket then https://trac.openmodelica.org/OpenModelica/newticket
Please provide us a test model as well.
Adeel.
How are you running the simulation?
You need to enable the LOG_STATS logging.
Adeel.
Can you see if the file (C:/Program Files/OpenModelica1.14.1-64bit//share/doc/omc/OpenModelicaUsersGuide/index.html) actually exists?
Adeel.
Can you try the following and see if it works.
- Go to %OPENMODELICAHOME%\tools\msys\mingw64\lib.
- Then rename libeay32.dll, libssl32.dll and ssleay32.dll to maybe something like libeay32-O.dll, libssl32-O.dll and ssleay32-O.dll.
- Try running OMEdit now.
Adeel.
You can set this in,
Code:
Simulation Setup->Translation Flags->Additional Translation Flags
In the additinal translation flags textbox write,
Code:
--simplifyLoops=1
Adeel.
If your model.mo is located in the same directory where the .mos file is then you can call,
Code:
loadFile("model.mo")
instead of
Code:
loadModel(grid)
Adeel.
Yes. You can use OpenModelica scripting.
Adeel.
You can play with %OPENMODELICAHOME%share/omc/scripts/Compile.bat
However, we only set paths for compilation and not for simulation.
Adeel.
You can enable the new frontend by calling `setCommandLineOptions("-d=newInst")` from OMPython.
Adeel.
For you as an engineering lab administrator, you can run the installer in the silent mode to be installed for all users.
Start the installer from command line with /S switch.
Adeel.
The installation directory where you installed OpenModelica.
Adeel.
There is a file "InstallMode.txt" in the installation directory.
What are the contents of it? Is it "AllUsers" or "CurrentUser"?
Adeel.
As I understand now we can generalized the actions in 2 ways. The actions on the Diagram view and the actions on the Documentation view. Whenever the Diagram view changes we update the Documentation View to it but when the Documentation View changes we don't update the Diagram View.
@casella note that this will again open the issue that you originally had i.e., when the Documentation view is not in sync with Diagram view and you update the documentation of the class. That was the original issue for you that you don't know for which model you are updating the documentation since they both are not synced.
Another solution which is probably more effective but requires more time to implement is that we make the Documentation view completely independent (as it was previously) but also make it just a read-only view. For editing we add a new view inside the Diagram view, so now we have have icon, diagram and text and instead we should have icon, diagram, text and info. Clicking on info opens the documentation in the diagram view and there you can also edit it. Clicking on any link inside the documentation will switch to a new model.
Adeel.
As far as I remember the correct way to use the script is to pass it the classname instead of the filename. So in your example it has to be,
Code:
python generate_icons.py Modelica.Fluid.Examples.HeatingSystem
It only generates the icon view not the diagram view.
Adeel.
There is no such API. However, there is a python script that you can use https://github.com/OpenModelica/OpenMod … e_icons.py
Adeel.
There is no GUI support available for this right now.
Adeel.
Hello Vivek,
Sorry for the late reply.
It might be that the line you are referring to is optimized out by the OpenModelica compiler.
Adeel.
Yeah that would be good.
Adeel.
The question is which one will take the preference?
Adeel.
__OpenModelica_simulationFlags is only read by OMEdit.
Adeel.
It has been removed to make the "prefferedView" annotation work properly. Also previously you can open the documentation of any model regardless of what you have opened in the modeling view. Now the two views are synced. If you navigate to some class in the documentation the modeling view will also open the same class. So it doesn't make sense to have documentation in the context menu.
Adeel.
This could also mean that it failed to find gdb. Check the gdb path in "Tools->Options->Debugger->Algorithmic Debugger->GDB Path" and see if its correct.
Adeel.
Did you check if the file exists or not "C:/Users/user/AppData/Local/Temp/OpenModelica/OMEdit/Debuggertest/Debuggertest.exe"?
Maybe the simulation has failed.
Adeel.
Yeah some of the functions are not documented yet.
getComponents takes a model name as input
It returns the list of components where each component is like this record,
Code:
record Component
String className;
String name;
String comment;
String access;
Boolean isFinal;
Boolean isFlow;
Boolean isStream;
Boolean isReplaceable;
String variability "'constant', 'parameter', 'discrete', 'unspecified'";
String innerOuter "'inner', 'outer', 'none'";
String inputOutput "'input', 'output', 'unspecified'";
String dimensions[:];
end Component;
Adeel.
Yes you can query them using the scripting API,
Code:
loadModel(Modelica);
getComponents(Modelica.Electrical.Analog.Interfaces.PositivePin);
getComponents(Modelica.Electrical.Analog.Interfaces.NegativePin);
Adeel.
Simulate first calls buildModel and then calls system using the simulation flags.
In your case you have to call system with the simulation flags e.g., `system("./model.exe -lv= \"LOG_NLS_RES,LOG_STATS\"")` otherwise the simulation flags are not used.
Adeel.
If the problem remain even after the latest nightly then post the omeditcommunication.log file from your temp folder. That will help us to figure out what is wrong.
Adeel.
sathishmswamy wrote:
1) Am trying to run Open Modelica from python. While doing so is it possible to generate the 3d visualization xml? if possible how?
Call setCommandLineOptions("-d=visxml") before simulating the model. It will generate the 3d visualization xml file.
sathishmswamy wrote:
2) can the xml and .mat result file used for Visualizing the result be opened in any other alternate open source software.
I don't know about any other software.
Adeel.
Yes please make a ticket about it. I believe saving this inside a model doesn't make sense but we could have a global optimization option that all models use during the compilation.
Adeel.
Unfortunately, there is no way to make this a default choice.
Adeel.
https://openmodelica.org/doc/OpenModeli … eneral-tab
C/C++ Compiler Flags (Optional) – the optional C/C++ compiler flags
Adeel.
This is a known bug. https://trac.openmodelica.org/OpenModelica/ticket/5397
Adeel.
See Modelica.Blocks.Interfaces.MIMO (https://build.openmodelica.org/Document … MIMO.html)
Adeel.
Done.
Adeel.
I can do that for you.
Which email you want to use?
Adeel.
I guess DynamicSelect is not what you want here since the Modelica specification says,
"DynamicSelect has the syntax of a function call with two arguments, where the first argument specifies the value of the editing state and the second argument the value of the non-editing state."
So in modeling view it will always use the first argument.
You could use a boolean parameter like this,
Code:
Rectangle(origin = {-2, -10}, fillColor = if isRed then {255,0,0} else {255,255,255}, pattern = LinePattern.Dash, fillPattern = FillPattern.Solid, lineThickness = 1.5, extent = {{-28, 32}, {36, -10}})
But note that it will always use the default value of the parameter. We don't support the parameter changes yet. See https://trac.openmodelica.org/OpenModelica/ticket/2081
Adeel.
I think we both are on different tracks. I am a bit lost actually.
Just to understand your problem again. You are having problems loading your models in OMEdit. So basically you just get the error and nothing is loaded, right? If yes then usually such error also points you to the exact file and line.
If you can't share your model then at least try to make a minimal model that depicts the problem. Unfortunately its very hard for us to solve the issue without the source code.
Adeel.
Right click and choose "Expand All".
Adeel.
It seems like somewhere in your code you have,
Code:
model A
end B;
In such cases you have the error The identifier at start and end are different.
Usually you end up with such errors when you manually try to edit the models.
Adeel.
This is not the right link. Where did you find it?
The correct link is https://openmodelica.org/doc/OMSimulato … ython.html or https://openmodelica.org/doc/OMSimulato … ython.html
Adeel.
Hello,
Well by decryption it doesn't mean that you can access the actual source code. However, you will be able to simulate the models.
Adeel.
The variable filter should be consistent regardless of the result format.
Create a ticket about it.
Adeel.
Its a default setting. The mat file contains the parameters.
Adeel.
It's a fixed toolbar you can't hide it.
Adeel.
This is a known issue and hopefully will be fixed soon.
Adeel.
Hello,
DynamicSelect annotation is only implemented for visible attribute. It is still work in progress.
Hopefully soon we will have full support of it.
Adeel.
> Unfortunately, a novice (like me) building a model using OMEdit is going to proceed by dragging a bunch of components into a new model and then create connections. Unless one actually checks the model each time after a connection is made, all connection errors are going to be unrecognized until such time that the model is manually checked or attempted to be simulated. Prohibiting improper connections in the graphical editor in the first place would make for a far better experience than the current behavior.
Yeah we use to have that functionality. But it was way too slow for real models. As I said earlier we can have that functionality possible with the new frontend.
> Further, if a model is created in OMEdit with improper connections, even double clicking its icon within a library will show it in the OMEdit canvas (is this not instantiation?) but any connection errors are not flagged by this operation.
No, that is not instantiation.
Adeel.
We don't check for types when making the connection. You will get the errors when you instantiate or translate the model.
Perhaps with the new faster frontend we can check for such connections.
Adeel.
Yes, read more about it here https://openmodelica.org/doc/OpenModeli … annotation
Adeel.
Yes, it depends on OMSimulator now. You need to update the OpenModelica submodules.
I have updated the OMEdit readme.
Adeel.
Code completion is still work in progress.
However, once you have activated it you should see its effect on the Modelica Text View. Press ctrl+space or start typing something like Real, Integer, model etc.
Adeel.
Can you describe the problems?
Adeel.
Unfortunately OpenModelica compiler is crashing hard on command "getComponents(FCSys.Conditions.Environment)". I have made a minimal example for testing,
Code:
loadModel(FCSys);
getErrorString();
getComponents(FCSys.Conditions.Environment);
getErrorString();
Here is the gdb output,
Code:
(gdb) r
Starting program: C:\OpenModelica\build\bin\omc.exe script.mos
[New Thread 3492.0x1038]
[New Thread 3492.0x4024]
[New Thread 3492.0x1b30]
[New Thread 3492.0x28ec]
[New Thread 3492.0xe18]
[New Thread 3492.0x21c8]
[New Thread 3492.0x4748]
[New Thread 3492.0x2c50]
[New Thread 3492.0x2624]
[New Thread 3492.0xd64]
[New Thread 3492.0x3830]
[New Thread 3492.0x4068]
[New Thread 3492.0x9c0]
[New Thread 3492.0x43d4]
[New Thread 3492.0x3db4]
[New Thread 3492.0x20b0]
[New Thread 3492.0x47c]
[New Thread 3492.0x2474]
[Thread 3492.0x1b30 exited with code 0]
[Thread 3492.0x28ec exited with code 0]
[Thread 3492.0x4024 exited with code 0]
Thread 1 received signal SIGSEGV, Segmentation fault.
0x000000006d0bbe41 in omc_InstUtil_splitInnerAndOtherTplLstElementMod ()
from C:\OpenModelica\build\bin\libOpenModelicaCompiler.dll
(gdb)
I suggest to make a bug report (https://trac.openmodelica.org/OpenModelica/newticket) so it can be assigned to the appropriate developer.
Adeel.
Use recursive parameter of getClassNames.
See here https://build.openmodelica.org/Document … Names.html
Adeel.
Yes. Tools->Options->Simulation->OMC Flags
Adeel.
I can load your model without any problem,
Code:
>> setCommandLineOptions("-g=Optimica")
true
>> loadFile("C:/Users/adeas31/Desktop/BangBangPkg.mo")
true
>> getClassNames()
{BangBangPkg}
>> getClassNames(BangBangPkg)
{BangBang,optBangBang}
Adeel.
Yeah you can combine both files into one file under a package and loadFile should work fine to load it. What is the error?
Yes optimize command accepts the qualified path.
Adeel.
You can choose File->Open Model/Library File(s) and then select the package.mo file.
OR
Choose File->Load Library and then select the folder Buildings latest.
Adeel.
Open a new plot window before clicking on the variable to plot.
https://openmodelica.org/doc/OpenModeli … #time-plot
Adeel.
I don't know about it.
Adeel.
Well there isn't any command to get this information straight away. You need to run several commands e.g.,
getComponents(dcmotor)
Gives you list of componets including resistor1 and its type i.e., Modelica.Electrical.Analog.Basic.Resistor. Now ask for its components Modelica.Electrical.Analog.Basic.Resistor
getComponents(Modelica.Electrical.Analog.Basic.Resistor)
In most cases the interface is a class component but you notice that n is not listed as class direct component so you need to read the inherited classes.
getInheritedClasses(Modelica.Electrical.Analog.Basic.Resistor)
{Modelica.Electrical.Analog.Interfaces.OnePort,Modelica.Electrical.Analog.Interfaces.ConditionalHeatPort}
Now read the components of inherited classes,
getComponents(Modelica.Electrical.Analog.Interfaces.OnePort)
{{Modelica.SIunits.Voltage,v,"Voltage drop between the two pins (= p.v - n.v)", "public", false, false, false, false, "unspecified", "none", "unspecified",{}},{Modelica.SIunits.Current,i,"Current flowing from pin p to pin n", "public", false, false, false, false, "unspecified", "none", "unspecified",{}},{Modelica.Electrical.Analog.Interfaces.PositivePin,p,"Positive pin (potential p.v > n.v for positive voltage drop v)", "public", false, false, false, false, "unspecified", "none", "unspecified",{}},{Modelica.Electrical.Analog.Interfaces.NegativePin,n,"Negative pin", "public", false, false, false, false, "unspecified", "none", "unspecified",{}}}
n is listed in the above output (I have made it bold) and its type is Modelica.Electrical.Analog.Interfaces.NegativePin.
What do you mean by connection type?
Adeel.
There isn't any command that returns connection or connector type. You could use getNthConnection(model, index) and then read the connector and check the type of the connector manually using is* like commands e.g., https://build.openmodelica.org/Document … Model.html
We don't have any command that returns image in any format.
What are you trying to achieve?
Adeel.
Use getComponentModifierNames(model, "component") https://build.openmodelica.org/Document … Names.html and then getComponentModifierValue(model, modifier) https://build.openmodelica.org/Document … Value.html
Adeel.
Code:
getComponents(model)
gives the list of elements.
Code:
getConnectionCount(model)
and
Code:
getNthConnection(model, index)
gives the connections.
Adeel.
Tools|Option|Simulation|OMC Flags are the compiler flags. You want to add a simulation flag so go to Simulation Setup|Simulation Flags|Logging and check LOG_INIT or write -lv=LOG_INIT in Additional Simulation Flags (Optional):.
Adeel.
You have to manually add the annotations to the existing model.
Adeel.
1) You can use a windows program called "depends.exe" to find out the list of dependencies. Compiling a version without dependencies requires that we link against the static versions.
2) Executable reads a file called model_init.xml and I don't think we have any formal description about it.
Adeel.
Siv wrote:
If you open my .mo file you will be able to see a 2m thick wall with fixed boundary conditions at both ends. I would like to change it in one of the end. How may I do it?
I am not a modeler so can't help you with that. In the original question you said "does not let me modify" so I though its something wrong with the tool but if you want to know "how to do it" then perhaps some other modeler can help you.
Siv wrote:
And moreover when I open Omedit I am getting this following error in the Messages browser:
[1] 15:44:00 Scripting Error
sh: 1: impact: not found
What does it mean?
You can ignore this error message.
Adeel.
Can you explain more? How are you opening the file? Which boundary condition and how are you trying to change them?
Adeel.
Follow the ticket https://trac.openmodelica.org/OpenModelica/ticket/4487
Adeel.
We don't support that feature.
Adeel.
No that's not possible.
Adeel.
Sorry didn't fully understand your question.
RealNetwork1 doesn't have any MultiBody component so no visualization.
Adeel.
Use the following,
Code:
cd();
loadModel(Modelica);
getErrorString();
loadFile("RCmodel.mo");
getErrorString();
buildModel(RCmodel, outputFormat="csv");
getErrorString();
for i in 1:3 loop
c := 0.1 + i;
system("RCmodel -override=C.C=" +String(c)+" -r=RCmodel" +String(i) + "_res.csv");
getErrorString();
end for;
Adeel.
I know. This is just for testing purpose.
However, if you use the new updated script then everything should work fine.
Adeel.
There is also a problem in the script. I have fixed it.
Use the following one,
Code:
cd();
loadModel(Modelica);
getErrorString();
loadFile("RCmodel.mo");
getErrorString();
buildModel(RCmodel);
getErrorString();
for i in 1:3 loop
c := 0.1 + i;
system("RCmodel -override=C.C=" +String(c)+" -r=RCmodel" +String(i) + "_res.csv");
getErrorString();
end for;
Basically there is no need to call the executable with "./".
Adeel.
1. Use %OPENMODELICAHOME% instead of typing the OpenModelica path.
2. Move the system command out of for loop. Because the commands in the for loop are executed but not printed to the console. You can also just comment out the for and end for lines.
Post the output again.
Adeel.
I need to see the output of the following commands otherwise I can't help much.
Code:
echo %OPENMODELICAHOME%
set PATH=%OPENMODELICAHOME%\bin;%PATH%
echo %PATH%
omc.exe script.mos
Run the above commands one by one. Replace the script.mos with your script.
Adeel.
Its the environment PATH variable. You need to run the command exactly as I posted.
Adeel.
You need to set the path in your terminal so it can find the libsundials_idas.dll.
Run the following command,
Code:
set PATH=%OPENMODELICAHOME%\bin;%PATH%
and then run your script.
Adeel.
I am interested in seeing the output of the mos script.
Your model is named RCmodel so you should get and executable with name RCmodel. I wonder then why you are calling RCserie with system command.
Also it has to be "_res.csv" instead of "_res.mat" if you want csv file.
Adeel.
No I mean the output of the mos script.
Adeel.
Usually the result files are generated in the working directory. In your case it is the one where your mos script is located.
Can you share the output of your mos script?
Adeel.
You need to fix your model. To see where exactly you need to fix use "-d=initialization".
So basically call your mos script like this,
Code:
omc.exe -d=initialization script.mos
And you will get more information about which initial condition are missing.
Adeel.
In the example change .mat to .csv
Adeel.
I think you need to update your OpenModelica to 1.12 https://build.openmodelica.org/omc/buil … ly-builds/
I have looked into the crash report and I have found references of code that is no longer used.
So please update OpenModelica and if you still have issues then report the bug at https://trac.openmodelica.org/OpenModelica/newticket
Adeel.
You can't run the animation via the mos script.
We could however help with fixing the crash. Can you provide more information about the model and the OM version you are using?
Adeel.
Probably you have saved the file in some path with spaces.
Adeel.
It is possible now https://github.com/OpenModelica/OMEdit/ … 2b5d4a6698
You need to download the new nightly build tomorrow which will have this feature.
Note that you need model_init.xml file for "display units", "value" and "description".
In case of OMShell this file is present so if you load the result file with new OMEdit you should be able to see "display units", "value" and "description".
Adeel.
It is exactly the same for Ubuntu.
Adeel.
You get different output because OMShell always call getErrorString() with every command.
The output of translateModelFMU(x, fileNamePrefix="model") is,
"SimCode: The model x has been translated to FMU"
The output of getErrorString() (in this case) is,
"Warning: The initial conditions are not fully specified. For more information set -d=initialization. In OMEdit Tools->Options->Simulation->OMCFlags, in OMNotebook call setCommandLineOptions("-d=initialization"). "
If you call following commands from OMPython you should get the same output,
Code:
omc.sendExpression('translateModelFMU(x, fileNamePrefix="model")')
omc.sendExpression('getErrorString()')
Adeel.
That's strange because I can run the commands without any issue,
Code:
>>> omc = OMCSession()
2017-02-23 15:58:58,647 - OMCSession - INFO - OMC Server is up and running at file:///c:/users/adeas31/appdata/local/temp/openmodelica.objid.2b4416f5aed74c6a8b907ae7b35b3aab
>>> omc.sendExpression("getVersion()")
'v1.12.0-dev-230-g40f70ce (64-bit)'
However, I am using the 64-bit version but I don't think that is the problem.
Can you post the output of setup.py and the commands above?
Adeel.
Have you installed OMPython after updating?
Code:
cd C:/OpenModelica1.11.0-32bit/share/omc/scripts/PythonInterface
python setup.py install
Adeel.
OMEdit can handle locale aware decimal separator. But using 1,5 fails with OpenModelica API since it is not locale aware.
I will change OMEdit to always send dot as decimal separator to omc.
Adeel.
Is because you might be using different locale. Change your language to English in "Tools->Options->General->Language".
I am guessing your decimal separator is comma instead of dot. However, I found out that OM fails to simulate the class if comma separator is used.
Adeel.
I have no idea about it.
Maybe someone else can help on this.
Adeel.
You need to create classes in Modelica.
Create a file called Sine.mo with the following contents,
Code:
model Sine "Generate sine signal"
parameter Real amplitude=1 "Amplitude of sine wave";
parameter Real freqHz(start=1) "Frequency of sine wave";
parameter Real phase=0 "Phase of sine wave";
parameter Real offset=0 "Offset of output signal";
parameter Real startTime=0 "Output = offset for time < startTime";
Real y;
protected
constant Real pi=Modelica.Constants.pi;
equation
y = offset + (if time < startTime then 0 else amplitude*
Modelica.Math.sin(2*pi*freqHz*(time - startTime) + phase));
end Sine;
Call the following command in OMShell,
Code:
loadModel(Modelica)
loadFile("Sine.mo")
simulate(Sine)
plot(y)
You can read more about Modelica here https://openmodelica.org/useresresource … ca-courses
Adeel.
You could create your model in any text editor, save the file as .mo and then load it in OMShell.
Code:
loadFile("Sine.mo")
simulate(Sine)
plot(x)
Adeel.
You need to call plot function after simulating the model.
https://build.openmodelica.org/Document … .plot.html
Adeel.
See https://trac.openmodelica.org/OpenModelica/ticket/4217
So far we don't know what is the reason.
Zoom level is very low for some reason.
Adeel.
Update your GDB path in "Tools->Options->Debugger->GDB Path".
Adeel.
I meant the log of your make command.
Revision 192 only gives instructions about how to install "OpenSceneGraph DEBUG DLLS" but you have to install them yourself. However, since you are not compiling debug version so it should work without any issue because we already have release dlls of OSG in OMDEV e.g., check the dlls in "C:/OMDEV/tools/msys/mingw64/bin".
Adeel.
If its updated then you should have these dlls in "C:/OMDEV/tools/msys/mingw64/bin".
Are you sure OMDEV environment variable is set?
Can you send me the full log? I want to see the linking command.
Adeel.
When was the last time you updated your OMDEV?
Seems like time to call svn update.
Adeel.
You don't need to copy the files.
The problem is you have set OPENMODELICAHOME to your installed version i.e., C:/OpenModelica1.9.6.
If you want to compile you should set OPENMODELICAHOME to your repository folder e.g., C:/OpenModelicaGit/build
(Note that OPENMODELICAHOME should point to a path where bin directory is located.)
Adeel.
Have you setup OPENMODELICAHOME environment variable?
OMEdit includes fmilib.h from "OPENMODELICAHOME/../OMCompiler/3rdParty/FMIL/install/include" so if OPENMODELICAHOME is set then make should find it.
Adeel.
Which ming64 are you using? The one from OMDEV ($OMDEV\tools\msys\mingw64_shell.bat)? Have you setup OMDEV for Qt?
Adeel.
See here how to use the linearize function https://build.openmodelica.org/Document … arize.html
You need to first load the file using the loadFile API https://build.openmodelica.org/Document … dFile.html
Then call the linearize on your model.
For example if your model is named "M" then,
loadFile("model.mo")
linearize(M)
Adeel.
We don't support this right now.
Adeel.
Unfortunately the framework code is in a private repository. We haven't decided to make it public yet. But hopefully it will soon be able with OSMC public license then you could contribute to the work.
Adeel.
This work is still in progress. You need TLM co-simulation framework in order to run the simulation. The framework is still not part of the OpenModelica codebase. We will soon release a OpenModelica version with complete TLM co-simulation framework.
Adeel.
Create a ticket here https://trac.openmodelica.org/OpenModelica/newticket
Provide as much information as you can with a sample test model to reproduce the bug.
Adeel.
Also check this https://openmodelica.org/doc/OpenModeli … eter-sweep
Adeel.
Basically you need a lot more than getIconAnnotation.
You need to check the inherited classes recursively. You need to get the components of the class and then icon annotation of each component class.
For example if you want to draw the icon for a Resistor component you need the following commands.
Code:
getInheritedClasses(Modelica.Electrical.Analog.Basic.Resistor)
{Modelica.Electrical.Analog.Interfaces.OnePort,Modelica.Electrical.Analog.Interfaces.ConditionalHeatPort}
getInheritedClasses(Modelica.Electrical.Analog.Interfaces.OnePort)
{}
getIconAnnotation(Modelica.Electrical.Analog.Interfaces.OnePort)
{}
getComponents(Modelica.Electrical.Analog.Interfaces.OnePort, useQuotes = true)
{{"Modelica.SIunits.Voltage","v","Voltage drop between the two pins (= p.v - n.v)", "public", "false", "false", "false", "false", "unspecified", "none", "unspecified","{}"},{"Modelica.SIunits.Current","i","Current flowing from pin p to pin n", "public", "false", "false", "false", "false", "unspecified", "none", "unspecified","{}"},{"Modelica.Electrical.Analog.Interfaces.PositivePin","p","Positive pin (potential p.v > n.v for positive voltage drop v)", "public", "false", "false", "false", "false", "unspecified", "none", "unspecified","{}"},{"Modelica.Electrical.Analog.Interfaces.NegativePin","n","Negative pin", "public", "false", "false", "false", "false", "unspecified", "none", "unspecified","{}"}}
getComponentAnnotations(Modelica.Electrical.Analog.Interfaces.OnePort)
{{},{},{Placement(true,-,-,-110.0,-10.0,-90.0,10.0,-,-,-,-,-,-,-,)},{Placement(true,-,-,110.0,-10.0,90.0,10.0,-,-,-,-,-,-,-,)}}
getInheritedClasses(Modelica.Electrical.Analog.Interfaces.PositivePin)
{}
getIconAnnotation(Modelica.Electrical.Analog.Interfaces.PositivePin)
{-100.0,-100.0,100.0,100.0,true,0.1,2.0,2.0,{Rectangle(true, {0.0, 0.0}, 0, {0, 0, 255}, {0, 0, 255}, LinePattern.Solid, FillPattern.Solid, 0.25, BorderPattern.None, {{-100, 100}, {100, -100}}, 0)}}
getComponents(Modelica.Electrical.Analog.Interfaces.PositivePin, useQuotes = true)
{{"Modelica.SIunits.Voltage","v","Potential at the pin", "public", "false", "false", "false", "false", "unspecified", "none", "unspecified","{}"},{"Modelica.SIunits.Current","i","Current flowing into the pin", "public", "false", "true", "false", "false", "unspecified", "none", "unspecified","{}"}}
getComponentAnnotations(Modelica.Electrical.Analog.Interfaces.PositivePin)
{{unassignedMessage="An electrical potential cannot be uniquely calculated.
The reason could be that
- a ground object is missing (Modelica.Electrical.Analog.Basic.Ground)
to define the zero potential of the electrical circuit, or
- a connector of an electrical component is not connected."},{unassignedMessage="An electrical current cannot be uniquely calculated.
The reason could be that
- a ground object is missing (Modelica.Electrical.Analog.Basic.Ground)
to define the zero potential of the electrical circuit, or
- a connector of an electrical component is not connected."}}
getDiagramAnnotation(Modelica.Electrical.Analog.Interfaces.PositivePin)
{-100.0,-100.0,100.0,100.0,true,0.1,2.0,2.0,{Rectangle(true, {0.0, 0.0}, 0, {0, 0, 255}, {0, 0, 255}, LinePattern.Solid, FillPattern.Solid, 0.25, BorderPattern.None, {{-40, 40}, {40, -40}}, 0), Text(true, {0.0, 0.0}, 0, {0, 0, 255}, {0, 0, 0}, LinePattern.Solid, FillPattern.None, 0.25, {{-160, 110}, {40, 50}}, "%name", 0, TextAlignment.Center)}}
getInheritedClasses(Modelica.Electrical.Analog.Interfaces.NegativePin)
{}
getIconAnnotation(Modelica.Electrical.Analog.Interfaces.NegativePin)
{-100.0,-100.0,100.0,100.0,true,0.1,2.0,2.0,{Rectangle(true, {0.0, 0.0}, 0, {0, 0, 255}, {255, 255, 255}, LinePattern.Solid, FillPattern.Solid, 0.25, BorderPattern.None, {{-100, 100}, {100, -100}}, 0)}}
getComponents(Modelica.Electrical.Analog.Interfaces.NegativePin, useQuotes = true)
{{"Modelica.SIunits.Voltage","v","Potential at the pin", "public", "false", "false", "false", "false", "unspecified", "none", "unspecified","{}"},{"Modelica.SIunits.Current","i","Current flowing into the pin", "public", "false", "true", "false", "false", "unspecified", "none", "unspecified","{}"}}
getComponentAnnotations(Modelica.Electrical.Analog.Interfaces.NegativePin)
{{unassignedMessage="An electrical potential cannot be uniquely calculated.
The reason could be that
- a ground object is missing (Modelica.Electrical.Analog.Basic.Ground)
to define the zero potential of the electrical circuit, or
- a connector of an electrical component is not connected."},{unassignedMessage="An electrical current cannot be uniquely calculated.
The reason could be that
- a ground object is missing (Modelica.Electrical.Analog.Basic.Ground)
to define the zero potential of the electrical circuit, or
- a connector of an electrical component is not connected."}}
getDiagramAnnotation(Modelica.Electrical.Analog.Interfaces.NegativePin)
{-100.0,-100.0,100.0,100.0,true,0.1,2.0,2.0,{Rectangle(true, {0.0, 0.0}, 0, {0, 0, 255}, {255, 255, 255}, LinePattern.Solid, FillPattern.Solid, 0.25, BorderPattern.None, {{-40, 40}, {40, -40}}, 0), Text(true, {0.0, 0.0}, 0, {0, 0, 255}, {0, 0, 0}, LinePattern.Solid, FillPattern.None, 0.25, {{-40, 110}, {160, 50}}, "%name", 0, TextAlignment.Center)}}
getInheritedClasses(Modelica.Electrical.Analog.Interfaces.ConditionalHeatPort)
{}
getIconAnnotation(Modelica.Electrical.Analog.Interfaces.ConditionalHeatPort)
{}
getComponents(Modelica.Electrical.Analog.Interfaces.ConditionalHeatPort, useQuotes = true)
{{"Boolean","useHeatPort","=true, if heatPort is enabled", "public", "false", "false", "false", "false", "parameter", "none", "unspecified","{}"},{"Modelica.SIunits.Temperature","T","Fixed device temperature if useHeatPort = false", "public", "false", "false", "false", "false", "parameter", "none", "unspecified","{}"},{"Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a","heatPort","Conditional heat port", "public", "false", "false", "false", "false", "unspecified", "none", "unspecified","{}"},{"Modelica.SIunits.Power","LossPower","Loss power leaving component via heatPort", "public", "false", "false", "false", "false", "unspecified", "none", "unspecified","{}"},{"Modelica.SIunits.Temperature","T_heatPort","Temperature of heatPort", "public", "false", "false", "false", "false", "unspecified", "none", "unspecified","{}"}}
getComponentAnnotations(Modelica.Electrical.Analog.Interfaces.ConditionalHeatPort)
{{Evaluate=true, HideResult=true, choices(error)},{Dialog("General","",true,-,false,"","","","","",false)},{Placement(true,-,-,-10.0,-110.0,10.0,-90.0,-,-,-,-10.0,-110.0,10.0,-90.0,)},{},{}}
getInheritedClasses(Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a)
{Modelica.Thermal.HeatTransfer.Interfaces.HeatPort}
getInheritedClasses(Modelica.Thermal.HeatTransfer.Interfaces.HeatPort)
{}
getIconAnnotation(Modelica.Thermal.HeatTransfer.Interfaces.HeatPort)
{}
getComponents(Modelica.Thermal.HeatTransfer.Interfaces.HeatPort, useQuotes = true)
{{"Modelica.SIunits.Temperature","T","Port temperature", "public", "false", "false", "false", "false", "unspecified", "none", "unspecified","{}"},{"Modelica.SIunits.HeatFlowRate","Q_flow","Heat flow rate (positive if flowing from outside into the component)", "public", "false", "true", "false", "false", "unspecified", "none", "unspecified","{}"}}
getComponentAnnotations(Modelica.Thermal.HeatTransfer.Interfaces.HeatPort)
{{},{}}
getIconAnnotation(Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a)
{-100.0,-100.0,100.0,100.0,true,0.1,2.0,2.0,{Rectangle(true, {0.0, 0.0}, 0, {191, 0, 0}, {191, 0, 0}, LinePattern.Solid, FillPattern.Solid, 0.25, BorderPattern.None, {{-100, 100}, {100, -100}}, 0)}}
getComponents(Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a, useQuotes = true)
{}
getDiagramAnnotation(Modelica.Thermal.HeatTransfer.Interfaces.HeatPort)
{}
getInheritedClasses(Modelica.SIunits.Temperature)
{Modelica.SIunits.ThermodynamicTemperature}
getInheritedClasses(Modelica.SIunits.ThermodynamicTemperature)
{Real}
errors:=getMessagesStringInternal()
{}
size(errors,1)
0
getIconAnnotation(Modelica.SIunits.ThermodynamicTemperature)
{}
getComponents(Modelica.SIunits.ThermodynamicTemperature, useQuotes = true)
{}
getIconAnnotation(Modelica.SIunits.Temperature)
{}
getComponents(Modelica.SIunits.Temperature, useQuotes = true)
{}
getDiagramAnnotation(Modelica.SIunits.ThermodynamicTemperature)
{}
getDiagramAnnotation(Modelica.SIunits.Temperature)
{}
getInheritedClasses(Modelica.SIunits.HeatFlowRate)
{Real}
getIconAnnotation(Modelica.SIunits.HeatFlowRate)
{}
getComponents(Modelica.SIunits.HeatFlowRate, useQuotes = true)
{}
getDiagramAnnotation(Modelica.SIunits.HeatFlowRate)
{}
getDiagramAnnotation(Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a)
{-100.0,-100.0,100.0,100.0,true,0.1,2.0,2.0,{Rectangle(true, {0.0, 0.0}, 0, {191, 0, 0}, {191, 0, 0}, LinePattern.Solid, FillPattern.Solid, 0.25, BorderPattern.None, {{-50, 50}, {50, -50}}, 0), Text(true, {0.0, 0.0}, 0, {191, 0, 0}, {0, 0, 0}, LinePattern.Solid, FillPattern.None, 0.25, {{-120, 120}, {100, 60}}, "%name", 0, TextAlignment.Center)}}
getIconAnnotation(Modelica.Electrical.Analog.Basic.Resistor)
{-100.0,-100.0,100.0,100.0,true,0.1,2.0,2.0,{Rectangle(true, {0.0, 0.0}, 0, {0, 0, 255}, {255, 255, 255}, LinePattern.Solid, FillPattern.Solid, 0.25, BorderPattern.None, {{-70, 30}, {70, -30}}, 0), Line(true, {0.0, 0.0}, 0, {{-90, 0}, {-70, 0}}, {0, 0, 255}, LinePattern.Solid, 0.25, {Arrow.None, Arrow.None}, 3, Smooth.None), Line(true, {0.0, 0.0}, 0, {{70, 0}, {90, 0}}, {0, 0, 255}, LinePattern.Solid, 0.25, {Arrow.None, Arrow.None}, 3, Smooth.None), Text(true, {0.0, 0.0}, 0, {0, 0, 0}, {0, 0, 0}, LinePattern.Solid, FillPattern.None, 0.25, {{-144, -40}, {142, -72}}, "R=%R", 0, TextAlignment.Center), Line(false, {0.0, 0.0}, 0, {{0, -100}, {0, -30}}, {127, 0, 0}, LinePattern.Dot, 0.25, {Arrow.None, Arrow.None}, 3, Smooth.None), Text(true, {0.0, 0.0}, 0, {0, 0, 255}, {0, 0, 0}, LinePattern.Solid, FillPattern.None, 0.25, {{-152, 87}, {148, 47}}, "%name", 0, TextAlignment.Center)}}
getComponents(Modelica.Electrical.Analog.Basic.Resistor, useQuotes = true)
{{"Modelica.SIunits.Resistance","R","Resistance at temperature T_ref", "public", "false", "false", "false", "false", "parameter", "none", "unspecified","{}"},{"Modelica.SIunits.Temperature","T_ref","Reference temperature", "public", "false", "false", "false", "false", "parameter", "none", "unspecified","{}"},{"Modelica.SIunits.LinearTemperatureCoefficient","alpha","Temperature coefficient of resistance (R_actual = R*(1 + alpha*(T_heatPort - T_ref))", "public", "false", "false", "false", "false", "parameter", "none", "unspecified","{}"},{"Modelica.SIunits.Resistance","R_actual","Actual resistance = R*(1 + alpha*(T_heatPort - T_ref))", "public", "false", "false", "false", "false", "unspecified", "none", "unspecified","{}"}}
getComponentAnnotations(Modelica.Electrical.Analog.Basic.Resistor)
{{},{},{},{}}
Add the following line to script,
Code:
setCommandLineOptions("--preOptModules+=unitChecking");
Adeel.
The type of exported FMU depends on what settings you have in Tools->Options->FMI.
Adeel.
It will not save all of the simulation settings. It will only save "StartTime, StopTime, Tolerance and Interval" because these are the only options supported by Modelica language through experiment annotation.
Adeel.
I tried it with "OpenModelica v1.9.4-dev-747-g47db7d2". Everything seems to work fine.
Adeel.
This problem is already solved. Try the latest nightly build https://build.openmodelica.org/omc/buil … ly-builds/
Adeel.
No there is no example. Normally you choose "Tools->Import ngspice netlist" and select ngspice netlist file. This will automatically create a Modelica file where your ngspice netlist file is located. OMEdit automatically opens the created Modelica file.
Adeel.
You are getting the message that class is already loaded so you can't open/load it again.
If you want to load it then first Unload/Delete the class.
Btw, if you have created the model and is already opened then why you want to open it again?
Adeel.
Unfortunately, it is not possible via GUI interface.
You can add an enhancement ticket about it.
Adeel.
There is some information about classes in my Thesis http://liu.diva-portal.org/smash/record … swid=6339. However, some of the information might be obsolete.
Adeel.
The error means that there is something wrong with your FMU dll/so.
I can't tell more without a FMU.
You could enable debug logging of the FMU. You can do this when importing the FMU or by double clicking on the FMU object. When you double click the FMU object it will open the parameters window. In the parameters window switch to FMI tab and set the "logLevel" to 6 and "debugLogging" to true. Also change the simulation output to "Formatted Text" in Tools->Options->Simulation->Output. Simulate the model again and post the output.
Adeel.
This is currently not possible via OMEdit.
Use OMShell or command line script.
Adeel.
By latest version you mean what? I need to know the revision.
I would also like to see the generated code from the latest version.
Adeel.
Did you check "Generate input connector pins" & "Generate output connector pins" (they are checked by default) when importing the FMU? If your FMU has input/output and you checked to generate pins for them then you should be able to connect them.
Note that we don't fully support the FMI co-simulation.
Yes you can create icon for your newly create class. Read more about it here https://openmodelica.org/doc/OpenModeli … apes-icons
What is the error message?
Adeel.
Which version of OpenModelica are you using?
The suggestion i proposed in (https://www.openmodelica.org/forum/defa … les#p4313) was implemented a long back.
I can see that your generated code is still old.
Adeel.
OpenModelica users guide chapter 2. You can open the guide from the editor via menu Help->OpenModelica Users Guide.
Adeel.
Seems like you didn't noticed Simulation Setup->Output->File Name (Optional):.
Adeel.
Sorry my bad. I thought you asked how to do parametric plot in OMEdit.
What you want is not possible. You need a new plot parametric window.
Adeel.
Ofcourse you can. Switch to Plotting Perspective and in the toolbar click on "New Parametric Plot Window". See also section 2.6.1.2 of users guide.
Adeel.
Starting from r25689 it is now possible to call plot and see the plots inside OMEdit.
Adeel.
adrpo wrote:
2. OMEdit should support some sort of scripting for ploting so you can plot using OMC API.
We can do this the same way we do for OMNotebook. Set plot to silent via `setPlotSlilent(true)`, plot API then output data, read the output and plot inside OMEdit.
The problem is i need some parsing on OMCLogger to know what command user has sent.
OMEdit handles the simulation and result file a bit differently. If you want to use plot API you should use it like this,
Code:
plot(x, fileName="model_res.mat")
Note that it will launch OMPlot and will show the plot there instead of integrated OMEdit plotting.
Adeel.
This is fixed now https://trac.openmodelica.org/OpenModel … et/25478/.
Try the new nightly build https://build.openmodelica.org/omc/buil … y-builds/.
Adeel.
Add a ticket about it with test example so that I remember to fix it.
Adeel.
For the graphical problem you can follow this ticket https://trac.openmodelica.org/OpenModelica/ticket/3255
For the simulation errors contact the library developer.
Adeel.
I will try to have the Save as feature available but as a workaround you can use the copy feature which is almost same.
Adeel.
I added a ticket about it https://trac.openmodelica.org/OpenModelica/ticket/3254
Adeel.
Add a bug report here https://trac.openmodelica.org/OpenModelica/newticket
Adeel.
No. I said use slashes in the path not to escape quotes. Use this code below,
Code:
OMPython.execute('loadFile("C:/OpenModelica1.9.1/share/doc/omc/testmodels/BouncingBall.mo")')
Adeel.
You can always call
Code:
OMPython.execute('getErrorString()')
to check the error message.
I think your problem is the back slashes in the path. Either use double back slash (\\) or use forward slash (/).
Adeel.
The message will show up in the simulation output window and not in Messages Browser.
Adeel.
You are using rather old OpenModelica. Interactive simulation has been removed now.
Download the latest version https://build.openmodelica.org/omc/buil … ly-builds/
OR
Download the old version perhaps 1.8.0 where interactive simulation was funtional.
Adeel.
No. 64 bit is only available on Linux. Windows versions only support 32 bit.
Adeel.
Yes it is the wrong MSL code. Notice the width. The width for RealInpout text is 0.
Note that the text size is calculated based on the width and height. If the font size attribute of text annotation is present then that fixed font size is used.
Adeel.
You can download the latest nightly build from here (recommended) https://build.openmodelica.org/omc/buil … ly-builds/
OR
Download the older nightly builds from https://build.openmodelica.org/omc/buil … lds/older/
Adeel.
Because you are trying to simulate a PACKAGE not a MODEL.
To simulate a model simply right click your model in the Libraries Browser and select Simulate.
Adeel.
You need r23234.
Adeel.
Why are you using something from January 2012 when we are in January 2015? Alot of things have changed since then. Uninstall 1.8.1 and install new nightly build https://build.openmodelica.org/omc/buil … y-builds/.
Note that interactive simulation is no longer supported.
Adeel.
Depends on your version of OMEdit. The new version from nightly builds have the copy command but I strongly recommend to not use it for nested classes unless this ticket is fixed https://trac.openmodelica.org/OpenModelica/ticket/2190
Adeel.
There is a ticket related to it https://trac.openmodelica.org/OpenModelica/ticket/3043
Adeel.
Again the error message says it all,
"Only single nonstructured entity is allowed to be stored in the file. The file /home/joaquim/estagio_oe/ESTAGIO_OE_1.mo contains following classes teste,Buildings,ModelicaServices,Modelica,teste_total."
Your file ESTAGIO_OE_1.mo contains 5 top-level classes i.e teste,Buildings,ModelicaServices,Modelica,teste_total. According to the specification you are only allowed to have one top-level class.
Adeel.
As I said in my previous post "Open your package.order file and remove Test_Cell1D_2 since it is not defined in the package. "
Did you remove Test_Cell1D_2 from C:/OpenModelica1.9.1/lib/omlibrary/ThermoCycle/Examples/TestComponents/package.order?
Btw I noticed that this bug is only present in ThermoCycle Library v1.0. Why don't you use ThermoCycle Library v2.0? OR more better use the version from github (https://github.com/thermocycle/Thermocycle-library)
Adeel.
No. It should work in any order. It is a bug (https://trac.openmodelica.org/OpenModelica/ticket/2393) which I have to fix .
Adeel.
Are the error messages not useful?
> [C:/OpenModelica1.9.1/lib/omlibrary/ThermoCycle/Examples/TestComponent
> s/package.mo:2:1-18:19]
> Error: Test_Cell1D_2 was referenced in the package.order file, but was
> not found in package.mo, Test_Cell1D_2/package.mo or Test_Cell1D_2.mo.
Open your package.order file and remove Test_Cell1D_2 since it is not defined in the package.
> [C:/OpenModelica1.9.1/lib/omlibrary/ThermoCycle/Examples/TestComponent
> s/package.mo:6:32-6:104]
> Warning: The file was not encoded in UTF-8:
>
> "<HTML> <p><big><dl><dt><b>Main Authors:</b> <br/></dt> <dd>Sylvain
> Quoil...".
>
> Defaulting to 7-bit ASCII with unknown characters replaced by '?'.
>
> To change encoding when loading a file: loadFile(encoding="ISO-XXXX-YY").
>
> To change it in a package: add a file package.encoding at the top-level.
>
> Note: The Modelica Language Specification only allows files encoded
> in UTF-8.
Create a file package.encoding and write your library encoding format in it and put the file at top-level where your package.mo is located.
If you don't know your library encoding format then,
- Use OMEdit menu File->Open/Convert Modelica File(s) With Encoding.
- Select the root package.mo file.
- Check Convert all files within the selected directory and sub-directories.
- Click Open and convert to UTF-8.
This is will convert your whole library to UTF-8 encoding.
Adeel.
When you reopen then you should first load the dependent models and then open the diagram view.
Its a known bug in OMEdit that it fails to update the component if dependent models are loaded later on.
Adeel.
Have you noticed the Welcome, Modeling & Plotting buttons on the right bottom?
Adeel.
- Index
- » Users
- » adeas
- » Profile