Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register
  • Index
  • » Users
  • » janpeter
  • » Profile

Posts

Posts

Hi

Several years since you posted this problem.
But I have come across bout the same thing.
Discussed at Stackoverflow, see
https://stackoverflow.com/questions/595 … untu-18-04

If you have got a solution I would appreciate to know it!

Jan Peter

Hi again,

I posted the question at Stackoverflow and here is now a guide.

https://stackoverflow.com/questions/595 … untu-18-04

But, note here is an open question a the end!

Hi,

I am interested to run exported FMU in a Python3 environment.
Consider to use PyFMI for this.

Is this possible? Does the FMU need to be made or set in some special
way to be able to run in Python3? Can this be done?

Jan Peter

Hi,

I also installed the VM and run a simple example and works!

I updated the guest-additions for VirtualBox 6.0.14 and at least re-sizing of window work
but not shared folders.

The problem with shared folders is that "permission is denied".

In my other VM with an older version of OpenModelica 1.13.2 also downloaded from your site
then no problem with shared folder. But at that time guest-additions where done in a special way, see post 2019-01-09.

With this new VM I could not install guest addition as done before.
Instead I could directly attach guest addition disc and run it more as I do for all other VMs.
But OpenModelica VM is after all Xubuntu and may need special care?

Would appreciate some advice, although not really an OpenModelica question but
most likely face people who try to use this VM

Jan Peter

Hi,

I see that the latest VM with OpenModelica 1.14 is beta 3 at the end of November,
while the formally released 1.14 is dated December 6. When will a VM come with the
released 1.14 come?

Jan Peter

The answer to this questions I have found is both easy and difficult.

The easy part is that you should in OpenModelica load both the library and application code in the same way using command “File/Open Modelica/Library File(s). Then the library and the application land side by side, sort of. The icons for them appear in the pane to the left and below the MSL library Modelica. The application code can then import (and redeclare) from both the loaded library and from MSL if needed in a similar way.

The difficult part is that here seems to be bugs in OpenModelica when you refer to models in two (or more) steps instead of one. 

A code that works to import as described above are library DEMO_v15 and application D15_app7 and shown below (and slightly modified from DEMO_v11 and D11_app7 mentioned and described in another thread). The example with D11_app7 and DMEO_v11 does not work and seems to be a bug, I think.

I enclose all four files then you better see what I mean.


d11-app7.mo

DEMO-v11.mo


d15-app7.mo

DEMO-v15.mo




I try to use OpenModelica 1.14 nightly build 2019-03-18.
It works directly for the most basic models I have.

For more recent models where I use “redeclare” etc like in the enclosed example  I get all the translation error message like

“Translation error:
Cannot instantiate DEMO_v10 due to class specialisation PACKAGE”

If I check the code for the system Test that I want to run and that combine the different components then I get the error:

“Translation error:
Class Medium.Concentration not found in scope DEMO_v10.Equipment.LiquidCon

In one way I can understand the comment but in another not.
The “LiquidCon” is used as a kind formal parameter for the package and is defined outside the package when Equipment3 is made from Equipment using redeclare and giving Medium the “value” Medium3”.

I think this is the technique to make packages parametrizesed and easy to adapt to various application codes. So what is wrong here?

The code works both in OpenModelica 1.13 as well as in JModelica.

Thanks for your help!

Jan Peter




Good! The installation of guest additions worked with your instruction.
Now I finally can have a larger window! But problems with shared folders but I will
sort that out with VBox community.

I tried to simulate some model but needed to get back to very, very basic models
to have something that works directly.

I get the warning that 1.14 use Modelica 3.2.3 an not 3.2.2 that I am used to before.
But I am willing to adapt code to the newer standard. Where can I see the major basic
changes that likel affect most of the code I want to run?

Looking at Modelicas homepage https://www.modelica.org/documents
I do not find anything about ver 3.2.3 do you actually mean 3.3 (3.3.1 or 3.3.2) or?

Is 3.2.3 mainly about including MSL 3.2.3?
This document central https://doc.modelica.org/Modelica%203.2 … _2_3.html.

Jan Peter

Good! The installation of guest additions worked with your instruction.
Now I finally can have a larger window! But problems with shared folders but I will
sort that out with VBox community.

I tried to simulate some model but needed to get back to very, very basic models
to have something that works directly.

I get the warning that 1.14 use Modelica 3.2.3 an not 3.2.2 that I am used to before.
But I am willing to adapt code to the newer standard. Where can I see the major basic
changes that likel affect most of the code I want to run?

Looking at Modelicas homepage https://www.modelica.org/documents
I do not find anything about ver 3.2.3 do you actually mean 3.3 (3.3.1 or 3.3.2) or?

Jan Peter

I try to get a dialog on the issue with VBox forum. A key aspect is whether the VM you have on nighly built is made from VirtualBox,
or it is still another software (Vagrant?). If it is not done form VirtualBox it complicates trouble-shooting, I am afraid. So it was list time when I discussed with people there and we started to look at error logs.

Another aspect of the VM is why "auto-run" of virtual discs are disabled.? Is there a good reason for that?
Best would likely be to enable auto-run since with every upgrade of VBox guest additions need to be updated too
and I want a simple, safe procedure.  / Jan Peter

Good. It seems to work. Couple of related VBox questions

1) When I update software system ask is I want PC-GRUB installation something.
After some hesitation I said yes to that.

2) VBox guest additions need to be installed and I get err "Invalid byte sequence in version input"
Do you happen to know what to do? I will also check with VBox forum.
Just thought you may know.

Found this link. but not really not sure https://forums.virtualbox.org/viewtopic … nce#p42479

Thanks

Jan Peter

Hi,

I have installed VBox pre-built 64-bit stable VM about a year ago and updated in the fall to 1.13.0.
That installation I got help from https://www.youtube.com/watch?v=LGo8oT5NmkM

However, your routine for installation has shifted somehow.
What I get from your homepage is a vdi (not an ovf).

So I am not sure how to proceed actually - can you give me some instruction?
I decided to follow your recommendation to use nightly build and have that downloaded 7.68 GB only.

Would be good to know if this VM is actually building on VirtualBox or it is some other software.
The VM I installed a year ago have some problem with mounting VBox goest-additions and I found with help
from VBox forum that your VM was actually done on other software that made if not possible to run with
for instance re-sizing of the window etc, when I run it in VBox.

Thanks

Jan Peter




Hi,

I have installed VBox pre-built 64-bit stable VM about a year ago and updated in the fall to 1.13.0.
That installation I got help from https://www.youtube.com/watch?v=LGo8oT5NmkM

However, your routine for installation has shifted somehow.
What I get from your homepage is a vdi (not an ovf).

So I am not sure how to proceed actually - can you give me some instruction?
I decided to follow your recommendation to use nightly build and have that downloaded 7.68 GB only.

Would be good to know if this VM is actually building on VirtualBox or it is some other software.
The VM I installed a year ago have some problem with mounting VBox goest-additions and I found with help
from VBox forum that your VM was actually done on other software that made if not possible to run with
for instance re-sizing of the window etc, when I run it in VBox.

Thanks

Jan Peter




Good! Today I run 1.13.0 on a Virtualbox VM with Linux downloaded from you homepage last spring and then updated during the fall.
I do not know how to set this flag you are talking about.
I tried Tools/Options/Simulation and found field with a flag - and I tried your suggestion, although this likely was only
possible on recent highly builds. So it did not work.

With new frontend do you mean OM 1.4 or perhaps 2.0?
There are otherwise cases where JModelica is much more "forgiving" than OpenModelica
and that what almost expected here.

Look forward to you response.

I work with an example of dividing in library code and application code.
The library code contain an example and can be run alone.
The enclosed file can run very well in JModelica but with OpenModelica I get compilation error:

Translation error:
... Class Concentration not found in scope DEMO_v10.EquipmentMedium
... Class Medium.Concentration not found in scope DEMO_v10.Equipment.LiquidCon

I have struggled back and forth with this example during the week and I am stuck.

Would appreciate some "fresh eyes" on the code.

To make it complete I also enclose the application code d10_app7.mo that also works well in JModelica
together with the library DEMO_v10.mo. But not yet tested in OM. And I do not know how to put these two
files so that the application code read the library file. Would appreciate instruction here too.

Jan Peter

PS. I work with another example DEMO_v11 where I get rid of the base model EquipmentMedium and that
does not even work in JModelica. I thought understanding the error for DEMO_v10 in OpenModelica might shed light
on the next problem too - hopefully.




Great!
You saved my day, if not the whole week.
Jan Peter

PS It is somewhat interesting how "forgiving" the JModelica compiler is compared to the OpenModelica compiler.

PS2. And I take away the file when now the problem is solved.

I have cut down the model now and it still has the same problem.
When I load I just get a read error line as described above and nothing is really loaded.
So it is some very, very basic problem.

The problem has come this week.
But I have also managed this week to do very small models that do work.

Enclosed the file.

Jan Peter

In what context should I right click and "Expand all"?

I work in Linux and use Mouspad - there is not that option when I right click.
Out in the file system I can choose the (closed) file and right click but no such option as "Expand all" there either.

Jan Peter

I have checked for this error and it is not that.
But I worried for that "hidden" symbols can come in that the editor do not show.
How do I check for such things?

Other ideas?

I have Modelica code divided in a small library DEMO_v11.mo and an application D11_APP7.mo The application code include parts that adapt interface of the library to the application using: import-extend-redeclare. It all works in JModelica. Now I want to set it up in OpenModelica but I do not know how to handle my two different files. Browsing through the documentation I could find little help.

I have before managed to bring in a library and in OpenModelica add graphical notation and then compose a new model based on components from the library. However, now I need to do a more “advanced” import that extend-redeclare the imported models. Thus my problem is how to do this more “advanced” part.

Appreciate some advice, or suggestion on where to read.

It is quite a long file - but perhaps I can cut it down and still keep the problem.

Is there no general ideas of how to trouble-shoot this?

Jan Peter

Hi,

I run OpenModelica 1.13.0 still.

When I start OMEdit and do Open Modelica/Library Files(s) and choose  one file - then I get the error message

Parse error: The identifier at start and end are different

I get it repeatedly of several different files that I can without problem run independently in JModelica.
Still older files I have moved from JModelica to OpenModelica works as usual.
(And I use the same editor TexMate - out in the Mac - while OM is a VM with Linux from downloaded from your homepage)

Any idea of what the problem can be?

Jan Peter

Hi,

I run OpenModelica 1.13.0 still.

When I start OMEdit and do Open Modelica/Library Files(s) and choose  one file - then I get the error message

Parse error: The identifier at start and end are different

I get it repeatedly of several different files that I can without problem run independently in JModelica.
Still older files I have moved from JModelica to OpenModelica works as usual.

Any idea of what the problem can be?

Jan Peter

I made a ticket (very first one) myself #5375 / Jan Peter

Hi

I get an error message "Translation error - Cannot instantiate DEMO_v9 due to class specialization PACKAGE.",
when I run the enclosed model. I use OpenModelica 1.13.0 in Linux.

See also Stackoverflow https://stackoverflow.com/questions/549 … um-package

If you agree it is a bug, I suggest you make a ticket and post it also at the Stackoverflow post above.

Best regards

Jan Peter Axelsson

Hi

I get an error message "Translation error - Cannot instantiate DEMO_v9 due to class specialization PACKAGE.",
when I run the enclosed model. I use OpenModelica 1.13.0 in Linux.

See also Stackoverflow https://stackoverflow.com/questions/549 … um-package

If you agree it is a bug, I suggest you make a ticket and post it also at the Stackoverflow post above.

Best regards

Jan Peter Axelsson

Jan-19-19 14:14:41
How to include OpenModelica Runtime in the Python Application

Hi,

Yes using PyFMI you need to load the FMU for each new simulation (but you need not re-compile).
I think there is some re-init functionality in FMU from JModelica but I am. not too sure.
About OpenModelica FMU I do not know.

Jan-17-19 12:09:57
VirtualBox VM with OpenModelica and guest additions and more

I wait with testing change of general settings for the VBox. I have a discussion running in VirtualBox forum on the subject. They wonder what role "Vagrant" has - which they find in my log file. Now I also see that OpenModelica organisation has made a new VM dated 2019-01-16 that hopefully works better than the one released in December. But I see here here two files with Vagrant in their fila names. In the readme documentation there are not mentioned. Do I need to download them also? Why are they there? Is perhaps the VM made in Vagrant software originally?

Jan-16-19 19:38:24
VirtualBox VM with OpenModelica and guest additions and more

Hi again,

I discuss the issue on VirtualBox forum.

They ask me why under general settings for the VM the Version
of Linux is stated as 2.6 /3.x /4.x (64-bit) and not just Ubuntu?
Someone who know?

They also think the procedure I used (after recomendationd here) to install "guest additions"
described above is not proper - it only gives some third party version of guest additions, see

https://forums.virtualbox.org/viewtopic … mp;t=91300

Would appreciate to get VM OpenModelica to work better!

Jan-10-19 07:25:44
How to include OpenModelica Runtime in the Python Application

Hi,

I am quite new to OpenModelica but I have used JModelica for long time and that work with PyFMI in Python environment.

Recently I have started to use OpenModelica as a complement. There is an export function labelled FMI on the top row in OMEdit and there you choose export FMU.

The actual FMU-module you then find here: /tmp/OpenModelica_openmodelica/OMEdit

Here you after export get a folder with a name related to your application.
If you open that you find several files and one with extension .fmu
This fmu-file you bring to your Python environment.

Note that since the fmu is made in Linux environment you can only run it in another Linux environment.

Information about PyFMI you find here https://pypi.org/project/PyFMI/
I have used PyFMI in Python 2.x environment but there is now also versions for Python 3.5 and 3.6.

I guess OMPython is a good alternative to PyFMI and would be interesting to understand the differences and similarities.

Jan-09-19 16:41:18
VirtualBox VM with OpenModelica and guest additions and more

Hi,

Thanks for the advice and links!
I have played around with a clone of my working VM with OpenModelica and found the following
detailed recipe DOES work (for me at least):

First I did the new small upgrade that I got today.

Then the following:

1. Before starting the VM open up settings/storage and for the Controller select add Optical  Drive and choose Leave empty
2. Start VM
3. Open terminal
    1. Cd /media
    2. Sudo apt-get install VirtualBox-guest-additions-iso
    3. Sudp apt-get install VirtualBox-guest-utils
    4. Shut down VM
4. Open
    1. VM settings/Shared folders and choose folder you want to share
    2. VM settings/Storage and for the Controller right-click and choose remove attachment
5. Start VM
6. Now the folders are shared!

The other important functionality that guest-additions should is to make it possible to resize
the window and make it larger. This did still NOT work.

I made one small observation that might be interesting.
In the VM (Ubuntu-Xenial) I opened up settings/Display and see the resolution 1024x768
When I change the size of the window nothing happens to the shown resolution and
very logical since making the window largerer only introduce white borders.

I happen to have another VM with standard Ubuntu LTS 16.04 and started that and looked at the
same setting/Dispaly - when I change the size of the window then the resolution do change.

I would be very glad if the window could be made to be re-sized!
OMEdit requires a quite large screen to be comfortable.

Appreciate further advice!



Jan-08-19 06:52:46
VirtualBox VM with OpenModelica and guest additions and more

Good that you have found the recent build is broken and made a ticket!

Concerning installing guest additions to my older still working VM with OpenModelica I have a few questions.

Exactly what operating system is it?
- in the text here https://openmodelica.org/download/virtual-machine
   you say it is 32-bit, but in the download section you can choose both 32-bit and 64-bit and I chose 64-bit
   does this refer to the same thing?
- understand it is Xubuntu you use that is a lightweight Ubuntu, but what version is it?
  are you sure that your link with recommendations for Ubuntu on guest additions also hold for Xubuntu?

I also want to say that I have used VBox over about 10 years mainly with guest Windows but also Ubuntu and also tried Fedora
but never hade problems with mounting the virtual disc with guest additions. Occasionally there have been smaller problems
with actually making guest additions to work, but that is easily overcome. But with VM OpenModelica I cannot even mount the disk.

Jan-07-19 15:07:01
VirtualBox VM with OpenModelica and guest additions and more

Hi,
I installed VirtualBox VM with OpenModelica in the spring, but I was never able to install guest additions from VirtualBox. That meant that I could not share files with the host computer and I had to leave with a small windows of OpenModelica. During the fall I got some updates and now I run version 1.13.0, but still I cannot mount the (virtual) disk with the guest additions.

The last week I re-installed the new VM on your homepage dated 2018-12-22 and I use stable64 versions.
This VM get stuck when started at the line: random: nonblocking pool is initialised.
Normally you get the Linux desktop after a few seconds. I have waited more than 10 minutes without success.
I have a screenshot but could not be uploaded for some reason.

The easiest would be to just give me some advice how to actually install guest additions on the installation that otherwise work.

One aspect is that my installation runs in current VirtualBox platform 5.2.22 while you on the home-page recommend
a much older VirtualBox ver 4.3 about 4 years old. I hope you do not mean that we must use and old version of VirtualBox
to run OpenModelica current/smile

My host computer is a Mac laptop and I run macOS 10.13..6 High Sierra and I have the new new files system that
came a year or two ago and I use flash hard-disk.

Would appreciate some advice!

Jan Peter

  • Index
  • » Users
  • » janpeter
  • » Profile
You are here: