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

Can't open some libraries

Can't open some libraries

I want to use those libraries
so I check  File -> System Libraries  -> MultiBondLib
but it have error ( No viable alternative near token: MultiBondLib)
so did  MotorcycleLib and  WheelsAndTires-release
How could i fix it?

Re: Can't open some libraries

This is fixed in https://github.com/OpenModelica/OMEdit/pull/165 (broke due to change in the Qt library)

Re: Can't open some libraries

Hi,thanks for answer my question.
But I still don't know how to revise it.
Can you show more detail or which file I need to change.

Re: Can't open some libraries

You should just need to install the latest nightly build. Otherwise you can do File->Open and browse to /usr/lib/omlibrary/XXX/package.mo and open that to load the library (it's only the libraries entries that are a bit broken with newer Qt; before the fix).

Re: Can't open some libraries

I update to lastest nightly build version 1.13.0.
But the MotorcycleLib was been removed.
So I go to Modelica Association to download MotorcycleLib.
When I open it, it still have error.    ([32] 18:14:21 Syntax Error [C:/Users/USER/Downloads/ModelicacycleLib/MotorcycleLib-release/MotorcycleLib 1.0/package.mo: 1:0-1:6]: Parser error: Unexpected token near: import (IMPORT))

I know you want me to revise Qt library.
But I didn't see any file named as "MainWindow.cpp" or even the path "OMEditGUI".

Or I need to download "OMEdit-master",but how can I load "MainWindow.cpp" into OpenModelica.

Sorry about asking many questions, I apologize for the inconvenience.
 

Re: Can't open some libraries


I encountered the same problem and get the exact same error message:
/MotorcycleLib 1.0/package.mo: 1:0-1:6]: Parser error: Unexpected token near: import (IMPORT))
Moreover, I get the same error message when I try to load the MultiBondLib and the WheelsAndTires Lib, as well.

Hence, I started to adjust the source code of the package.mo files. I removed line 1 (import...) in the package.mo file of the MultiBondLib and loaded the BondLib manually (You'll see that the directory that the BondLib is supposed to be imported from does not exist on your local machine anyway). After that, it was possible to load the MultiBondLib. Subsequently, I did the same for the WheelsAndTires Lib which depends on the Bond and MultiBondLib. However, I stumbled across a few other syntax errors and thus far I haven't managed to load the MotorcycleLib successfully.

I'm new to Modelica and just started using OMEdit (I was working with Dymola before). I assume that the problem is caused by incompatibility between the different releases of the libraries. For example, the MultiBondLib is encoded in Modelica 2.2.1 and has been tested with Dymola and the BondLib 2.1. The MotorcycleLib as well as the WheelAndTires lib were developed in the course of Master theses in 2009 and are strongly based on the MultiBondLib. I fear that the libraries are not maintained or updated. However, those are just assumptions.

Has anyone used the MotorcycleLib with OMEdit before and has some hints on its use? Any help is much appreciated.



Edited by: salokin - Jun-04-18 11:40:24

Re: Can't open some libraries


@caibigbear,,
have you found a solution to your problem?

Edited by: salokin - Jun-04-18 11:44:58

Re: Can't open some libraries

Hi salokin,
I had reported this issue to OpenModelica.
The management replied me

"
The Motorcycle library was developed at Politecnico di Milano 12 years ago, using Dymola. At the time, Modelica 2.2.x and the corresponding Modelica Standard Library were used, which had a lot of issues w.r.t. with portability to other Modelica tools.
Eventually, version 3.2 rev2 of the language and the corresponding Modelica Standard Library 3.2.1 were released in 2013, which are fully supported by OpenModelica, as well as by other Modelica tools.
"
--------------------------------------------------

And I also wrote a letter to the writer of MotorcycleLib
He replied me

"
the library was developed in 2009. It uses the following libraries:

uses(
      MultiBondLib(version="1.3"),
      Modelica(version="2.2.1"),
      BondLib(version="2.3"),
      LinearSystems(version="0.9"),
      Modelica_LinearSystems(version="0.91"),
      Vectors(version="0.8"),
      WheelsAndTires(version="1.0")


So, unfortunately, it wouldn't be enough to just upgrade the MotorcycleLib. You should also know that all the single track vehicles in the library are based on multi-bond graphs (MultiBondLib) and bond graphs (BondLib) and partly on the WheelsAndTires library. Furthermore, we developed the MotorcycleLib in Dymola and never tested it with OpenModelica since it was simply not possibly at that time.

Basically, you have these options:
Try to find an older version of Dymola that supports all the libraries used in the MotorcycleLib, e.g. Dymola V6.1 or V7.
Use the corresponding master’s thesis (https://www.inf.ethz.ch/personal/cellie … tt_ms.pdf) and rebuild the models using the Multibody Library which is part of the Modelica Standard Library (MSL). Of course you have to modify some function but that should be feasible. This, I would say, is the only chance to get it work with OpenModelica.
Best regards
Thomas

"

-------------------------------------------------------
Have you have any idea about upgrade those libraries?
I am look forward for your reply.

Re: Can't open some libraries

Hi caibigbear,

as the author of the MotorcycleLib told you, I think it is quite hard and especially time consuming to get the library working in OM.
I don't even manage to get the BondLib working properly in OMEdit. I can load it but most of the examples fail with translation errors. As the developers said this is properly due to the fact the the libs are based on Modelica 2.x.x.

I don't know if you already have those papers/theses. They'll give you a nice overview of the functions of the single libraries and what they are composed of. Maybe that helps you to model your desired system with the MSL 3.2.2.

BondLib: http://people.inf.ethz.ch/~fcellier/Pub … ica_05.pdf
MultiBondLib: http://people.inf.ethz.ch/~fcellier/Pubs/BG/sne_07.pdf
WheelsAndTires: https://www.inf.ethz.ch/personal/cellie … res_ms.pdf
MotorcycleLib: https://www.inf.ethz.ch/personal/cellie … itt_ms.pdf

If you're really interested in updating all of those libraries (in order to make them work in OM) it's probably worth contacting Dr. Dirk Zimmer from the DLR. He might have some hints on how to approach the further development. Good Luck!

There are 0 guests and 0 other users also viewing this topic
You are here: