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
  • » adrpo
  • » Profile

Posts

Posts

Hi,

Ok, We forgot to add these packages to 1.6.0 default MSL3.1 library.
However, i don't know if the pltpkg is working fine or not and were to find it (I'll ask around).
We should re-write parts of this functionality and make it better.
The 3d libs should be installed if you use Windows. On Linux you might have to do it yourself.

SimpleVisual.mo you can find it here:
C:\OpenModelica1.6.0\lib\omc\omlibrary\msl22\msl22.zip
Inside Modelica\SimpleVisual.mo
Just copy it inside:
C:\OpenModelica1.6.0\lib\omc\omlibrary\msl31\Modelica\

Cheers,
Adrian Pop/

Hi,

trunk/c_runtime/simulation_result_mat.cpp
trunk/c_runtime/simulation_result_mat.h
In the emit() method the output to file is realized.
You can add your filters there.

Note that the generated model code is linked with libc_runtime.a

Cheers,
Adrian Pop/

Dec-14-10 19:13:28
Category: Programming

Hi,


modelsInArray[1].b should work to be accessible in the equation/algorithm sections or in the variable bindings.

Can you give a full model that doesn't work?

Cheers,
Adrian Pop/

Hi,

simulate(Model, startTime=0, stopTime=1, numberOfIntervals=5, outputFormat="mat")
the output interval (the step) is equal to (stopTime-startTime)/numberOfIntervals.

You can get the behavior you want only by changing the sources in trunk/c_runtime/.
Right now we do not have a way to set a callback on the emit function for the variable output.
We should support such functionality as it would be good.

Cheers,
Adrian Pop/

OMEdit is c++/qt, SimForge is Java.

Cheers,
Adrian Pop/

Hi,

Not really, there are 3-4 ways of doing it
1. via the bug tracker
2. via the forum
3. via email to OpenModelica@ida.liu.se or OpenModelicaIntrest@ida.liu.se
4. via direct email to developers

If we allow the anonymous user to post bugs we'll get a lot of spam.

Cheers,
Adrian Pop/

Hi,

To your question: you can re-load the file in OMEdit manually, but that's the only way right now.
Eclipse handles changes in the workspace as it has a file change listener, we might be able
to implement something similar in OMEdit. I'll add it to the trunk/doc/OMEdit/OMEdit-wish-list.doc

Well, from my point of view we should have everything in Eclipse, using tabs in the same editor:
- code
- Modelica diagram
- uml diagram
- even OMNotebook documents
Right now all these tools are separate, but we should be able to integrate them more.
Unfortunately implementing good tools with integrated functionality is not that easy and we do not have
the resources available to do it very fast. But is it in our plan to integrate these tools better in the future.

Right now we're focusing on implementing support for full MLS 3.1 (Media & Fluid) and to be able to
simulate most of the models and then we will have more time for the editors and supporting tools.

Cheers,
Adrian Pop/

Hi,

1.  yes. you use simulate(Model, outputFormat="mat");
2.  you could use sample in a when equation in which you have an (external) function call that writes to a file
      when (sample ...) then
         callFunctionWriteResults(x, y, z);
     end when;
     Your function will be called at that specific sample.
     If you only need the results output from the callFunctionWriteResults then you can simulate
     using simulate(Model, outputFormat="empty") which does not generate any result file.

Cheers,
Adrian Pop/

Dec-14-10 16:51:09
Category: Programming

You can do it like this:
ModelA modelsInArray[2](p = {1.2, 1.4});
There aren't any "references" yet in Modelica, everything is static!
The arrays have predetermined size (at compile time).

Cheers,
Adrian Pop/

Yes, is correct.
You need to make an account in CodeBeamer, or, alternatively, just
report the bug here and we can add it to the bug tracker.

Cheers,
Adrian Pop/

Hi,

Well, as a workaround you can trick OMC to think your library is part of the Modelica library.
Add your library (directory or just Library.mo) to:
c:\OpenModelica1.6.0\lib\omc\omlibrary\msl31\Modelica
Also, add in the your library top package:
within Modelica;
package YourLibrary
end YourLibrary;


Cheers,
Adrian Pop/

The OMC-API document is a bit old. Have a look into the .mos files here:
https://openmodelica.ida.liu.se/svn/Ope … nteractive
user: anonymous
pass: none <-- write none here
They contain tests fro the Interactive OMC API.

Cheers,
Adrian Pop/

Oct-21-10 10:40:40
How to read OMC's failtrace outputs?

It seems we have a bug in the back-end with equations - variables matching, most likely with array[array] indexing.
I added a bug report about it here, so our back-end experts can fix it:
https://openmodelica.org:8443/cb/issue/1329

Cheers,
Adrian Pop/

Oct-20-10 21:31:40
How to read OMC's failtrace outputs?

Hi,

Try the new nightly-build:
http://build.openmodelica.org/omc/builds/windows/

Cheers,
Adrian Pop/

Oct-20-10 18:35:05
Topic: C++ call

Fast enough for what? Maybe if you use a fixed size solver it will be faster.

Cheers,
Adrian Pop/

Hi,

Uh, rather hard question current/smile
The short answer is yes, OpenModelica can be used as an alternative.

The long answer is that things are not that easy.
OpenModelica is not yet at the Simulink/Matlab level of robustness, scalability and ease-of-use.
Now about features:
- Using a joystick to populate model inputs should be possible, but you'll need to write the code for this yourself.
- You can send simulation data to other programs via TCP/IP, we have an interactive mode  for simulation.

Well, in short you can do whatever you want with OpenModelica because you can change/adapt/enhance the
available features because the code is available (of course, you would need to understand and implement
some of these things yourself). However, is not that easy as point-and-click and things are not yet that integrated
as in commercial software.
If you want to give it at try, you could play with it and see if it works for you.

Let us know if you want more information on more specific things.

Cheers,
Adrian Pop/

Hi,

We moved to a new way of generating the code, from
templates and I think this is a new error that showed up.
I added it to our tracker and we will look into it soon:
https://openmodelica.org:8443/cb/issue/1322

Cheers,
Adrian Pop/

Oct-15-10 02:37:53
SimForge freezes during simulation even though the model passes check

There could be several reasons:
1. The simulation takes a lot of time to complete (the CPU is high and a Model.exe file is consuming CPU in TaskManager)
    (by the way, you can kill the .exe to return the control to SimForge).
2. The simulation goes into an infinite loop due to some bugs in simulation runtime.
3. It could be a problem in SimForge (but I doubt this).

If you can't provide a (public) model that has this behavior we  can't help you too much.
However, you can always try a nightly-build of OpenModelica:
  http://build.openmodelica.org/omc/builds/windows/
I assume you have Windows, but I might be wrong, so you use Linux.
Note that we haven't tested the nightly-builds with SimForge so they might not work nicely together.

You could also try to use a different solver (the default is method="dassl"):
simulate(model, method="dassl2") or "euler"

Cheers,
Adrian Pop/

Oct-09-10 04:23:13
How to read OMC's failtrace outputs?

Hi,

Well, it takes a while for open-source to reach the state of a commercial software.
I do agree with you that things could be much better, but it takes time to get there.

Unfortunately, looking at your log and not knowing anything about the structure of your model, I can only guess what the problems might be:
- possible wrong within statements (meaning that NNN does not exists and you use it: within NNN;)
- a lot of redeclares which we don't handle very well
- quoted identifiers might be an issue (I have to check if we escape them somehow before we reach C code)

I know that posting your models is not possible if they are private, but any kind of public model that has some error would help.
Alternatives are (if you can) to send models privately to me (or any of our developers) via e-mail [Adrian.Pop@liu.se] and then I
can check what the problems are.

We changed a bit our development strategy lately.
We're now not adding any new functionality, but we focus to fix problems to be able to flatten
as much as possible from Modelica Standard Library 3.1 (which mostly works except Media & Fluid).

Cheers,
Adrian Pop/

Oct-09-10 04:01:58
Usage of unit attributes impedes build of simulation binary

Hi,

Can you post a small non-private model that has this behavior?
Otherwise is rather hard to reproduce this issue.
You could also try the latest nightly-build as this problem might be fixed:
http://build.openmodelica.org/omc/builds/windows/

Cheers,
Adrian Pop/

Oct-09-10 03:50:38
dcmotor.mo simulation fails on 1.5.0 and xp

I think I already answered this by email.
You can always try to (backup first!!) uninstall your OpenModelica (then delete the directory c:\OpenModelica1.5.0)
and install our latest build:
http://build.openmodelica.org/omc/builds/windows/
Try the last .msi as the other ones have a small issue with Compile.bat script current/smile

Cheers,
Adrian Pop/

Oct-09-10 03:47:25
I want to read some values and use these values in a derivative eqn

It might be possible to fix this using derivative annotations, meaning you make another function that is the
derivative of Functions.Psat_T and add an derivative annotation to Functions.Psat_T pointing to the new
function.

See Section: 12.7 Declaring Derivatives of Functions
http://www.modelica.org/documents/ModelicaSpec32.pdf

Cheers,
Adrian Pop/

We fixed quite some bugs recently and it seems this started to work in OpenModelica.
I added a test for it so we don't break it again current/smile
http://openmodelica.org/svn/OpenModelic … cFilter.mo
http://openmodelica.org/svn/OpenModelic … Filter.mos
user: anonymous, pass: none    <- write none here.

You can download the latest nightly-build from here:
http://build.openmodelica.org/omc/builds/windows/

Cheers,
Adrian Pop/

Well, better late than never. Most of this is fixed in revision 6319.
Now the Random function works in OpenModelica (if you use a when in algorithm sections).
I just implemented String(x, format="...") and fixed some problems with calling functions with
no output. I also added tests for it to our testsuite:
http://openmodelica.org/svn/OpenModelic … /Random.mo
http://openmodelica.org/svn/OpenModelic … Random.mos
user: anonymous, password: none   <- write none here.

Cheers,
Adrian Pop/

With the latest (revision 6300) OpenModelica I get this error:
[test.mo:13:1-15:9:writable] Error: Failed to instantiate equation
when initial() then
  (Matrix1,Matrix2) = ret_2_matrix();
end when;
Error: Error occured while flattening model test
Note that in a .mos script you need to use getErrorString(); after the checkModel(); to get the errors, i.e.
loadFile("test.mo"); getErrorString();
checkModel(test); getErrorString();

The problem is that you use a function with multiple outputs which we don't support yet in when equations.
If you use only one output in the function, then it works fine.

Cheers,
Adrian Pop/

Oct-08-10 19:29:39
different results between dymola and openmodelica simple codes

There are many possible causes, bugs in the back-end, numerical problems, etc.
If you use simulate(Model, method="dassl2") the results are similar to Dymola.

Your model is rather strange, you increase a_steady via an algorithm.
It might be better to use a when equation instead to be able to specify when a_steady should be increased.

Cheers,
Adrian Pop/

You could probably use inner/outer, see Modelica Specification for more information.
Make vehicle_connector an inner in the vehicle class and outer in the motor class, and connect it to the motor in the motor class.

Cheers,
Adrian Pop/

Oct-08-10 19:09:17
Category: Programming

OpenModelica doesn't support the constrain(...) function that is not part of the Modelica specification.
With the current OpenModelica I get this:
ModelicaAdditions/MultiBody/CutJoints.mo:331:7-331:76:writable] Error: The language feature constrain function is not supported.
Suggested workaround: rewrite code without using constrain equation
  constrain(revolute2Dloop1.constraintResidue[2],revolute2Dloop1.constraintResidue_d[2],revolute2Dloop1.constraintResidue_dd[2]);

Cheers,
Adrian Pop/

The code generation might have problems with the use of quoted identifiers.
What happens if you use normal identifiers instead?

Cheers,
Adrian Pop/

Modelica.Media and Modelica.Fluid do not work yet in OpenModelica, so I assume you use another tool.
You should ask this question to the tool vendor for the Modelica tool you are using.

Cheers,
Adrian Pop/

Oct-08-10 18:49:02
Category: Programming

Nice post. Very easy to answer current/smile

Hi,

OpenModelica doesn't know how to do this by default.
As far as I can understand the math It might be possible to implement it in OpenModelica.
You need to extract the model equations and do some symbolic transformation on them to obtain the transfer function.
It could be also possible to get the model equations and do this transformation in another tool that knows how to handle this.

MathModelica by MathCore [http://www.mathcore.com/] has a Mathematica connection that can be used for this.

Cheers,
Adrian Pop/

Hi,

You could ask this question in the Modelica design list:
  Modelica-design@Modelica.org
as is more related to the Modelica language.
http://www.modelica.org/lists

Cheers,
Adrian Pop/

Oct-08-10 18:10:59
How to extract the Jacobian function

Well, now I don't know what you really want to do.
The linearization branch is a distinct branch that provides model linearization.
Is this what you want to use or you want the latest from trunk?
Hi,

If you have problems with linearization branch you can ask Willi Braun [ willi.braun <AT> fh-bielefeld <DOT> de ]
about these issues as we haven't implemented these things.

As far as I can tell when you build your model and generate C code from it, the generated code should contain these function_JacMat_X.
If these functions are not in the generated code, then the linking will not work. I think Willi might know more about this.

Cheers,
Adrian Pop/

Sep-29-10 01:37:41
Compiling C-Code with Visual Studio / C++ ?

Hi,

Is possible but not very easy. You will need to compile trunk/c_runtime as a .lib first.
Make a VC project, add all the .c*,.h* files in the trunk/c_runtime to the project and compile.
To break the Qt dependency use:
trunk/c_runtime/sendData/humbug.cpp, trunk/c_runtime/sendData/humbug.h
instead of
trunk/c_runtime/sendData/sendData.cpp, trunk/c_runtime/sendData/sendData.h.
Of course, you might need to fix some issues with some files as we haven't check
lately if they are compilable by VC++-

After you made a c_runtime.lib, generate the code using omc, say buildModel(Model).
Then include all the generated files in the previous made project and compile.
You should get an executable that runs the simulation. You will need Model_init.txt in the same directory as the executable in order to run it (or debug it).

If you want to inspire yourself you could take the (very old project) I put here:
http://www.ida.liu.se/~adrpo/omc/msvc-c_runtime/
You can also find some projects (old ones) in Subversion here:
https://openmodelica.ida.liu.se/svn/Ope … indows/VC7
but the c_runtime project form it is rather outdated.

We only use Visual Studio to pack the .msi release but everything is compiled with MinGW GCC.

Beware that all the projects are either VS2008 or VS2010. How come you're using the ancient 6.0?
You can download the VS express free.

Well, if you want to give it a try, post here any problems you encounter and I'll try to help you
when I get some free time.

Cheers,
Adrian Pop/

Sep-23-10 03:56:18
How to use a configuration file to initialize parameters

Hi again,

Well, i might have misunderstand you and you are asking on how to do this in Dymola, which I don't really know.
I answered your question thinking you want to do this in OpenModelica, which is a Modelica tool developed by us.
Please let us know what you're actually referring to, OpenModelica or Dymola?

Cheers,
Adrian Pop/

Sep-23-10 03:51:59
How to use a configuration file to initialize parameters

Hi,

That should be easy, you just need to:
1. generate your .exe for the model, say via buidlModel(Modelica)
2. rewrite the Model_init.txt file with new parameter values.
3. call the Model.exe then go to step 2.

Mohsen (http://www.ida.liu.se/~mohto/) has written a Python based framework
for doing the above thing and he has a paper about it. I sent him an email and
maybe he can help you out more.

Cheers,
Adrian Pop/

Sep-21-10 09:56:59
Unable to load the SimForge graphical tool under Windows Vista 64-bit

You could try to report this problem to the people that developed SimForge in their Trac system:
http://trac.ws.dei.polimi.it/simforge
The website seems to be down at the moment. I'll send an email to the SimForge developers
and point them to this forum too.

Cheers,
Adrian Pop/

You could use dumpXMLDAE(Model) or
./omc +d=bltdump Model.mo(s) to see it as a text output.

Cheers,
Adrian Pop/

You could ask the developers of SimForge about these issue. 
They also have a trac installation where you can report bugs and issues:
https://trac.ws.dei.polimi.it/simforge
However, the website seems to be down at the moment.

I will also send them an email and point them to this thread so they can answer here.

Cheers,
Adrian Pop/

I would suggest using plot2/plotParametric2 functions instead of plot/plotParametric. I think that the memory issue is mostly related to the storage of plot data.
If you use plot2 functions an external Java plotting package is called and the memory consumed by OMNotebook should not increase that much.

Cheers,
Adrian Pop/

Sep-21-10 09:40:32
We want to call OpenModelica externally for using the results

As far as I can understand your issue, the best strategy would be to integrate your C++ code in the runtime of OpenModelica
(c_runtime directory in the Subversion).
Then you can link the runtime with your code and with the generated code for the model and get the results directly via C calls.
This way you don't need to start executables and it would work much faster.

Cheers,
Adrian Pop/

Sep-21-10 09:37:11
To Obtain ODE formulation for a given DAE in OMC

You could also try dumpXMLDAE(Model) function. This will dump the result of flattening to an xml file.
As far as I know, depending on some flags you can also get the ODE, but I'm not 100% sure.
I don't know if all the info about this function is present in the documentation, but if not let me
know and I'll ask the developer which implemented this functionality.

Cheers,
Adrian Pop/

Hi,

I sent an email to the guy who implemented the interactive functionality, maybe he can help you.
I don't know enough about it to be able to help you ( and I'm in holidays and very un-eager to look
into the sources on how is implemented current/smile )

As far as I know there is a C++ client implementation already available inside c_runtime/interactive,
maybe you can do something similar in your gui (or use it directly).

Cheers,
Adrian Pop/

Hi,

I build a .msi out of the latest revision (5865).
I had to compile Qt and Mico Corba using Visual Studio 2010, but it worked.
I got non-crashing Qt clients (OMShell, OMNotebook and OMPlotWindow are now working).
Here is the .msi:
http://www.ida.liu.se/~pelab/modelica/O … -22_05.msi

Please let me know if is working fine for you.
I have VS2010 installed so it might be the case that on some systems we get missing .dlls.

Sorry for the delay but I'm in holidays and working from time to time.
I will try to push the changes to the projects and the Qt libs compiled with VS2010 but
I'm on a very slow upload internet connection in Romania, so it might take a while.

Cheers,
Adrian Pop/

Hi,

I'm in the process of building the 1.5.0 release myself and I hope I'll be ready with it soon.
I think the problem is that Qt is compiled with Visual Studio 2008 and OMNotebook and OMShell with VS 2010.
I now compiled Qt with VS 2010 and I'll do some testing. I'll let you know how it goes.

As your problem, you should copy all the dlls from Compiler/VC7/Setup/bin to build/bin
Then you also copy OMNotebook and OMShell to that folder. That should work, but unfortunately
the clients crash so I'm now trying to find a solution to that.

Cheers,
Adrian Pop/

Sorry about that, i should have told you. I'll update the readme soon enough.

Start the VS command line
go to:
> cd C:\OMDev\lib\antlr-win32-msvc\md-mdd
> nmake -f Makefile.win32 clean
> nmake -f Makefile.win32
Now you should have an antlr.lib there build with /md which should be fine for OMNotebook.

Cheers,
Adrian Pop/

Hi,

You DO NOT need to compile any projects from omc.sln rather than: OMShell, OMNotebook and UpdateEnv.
OMC should be compiled by Eclipse and MinGW, and it should be compiled statically, meaning you need
to add an environment variable OMC_BUILD_STATIC = /static to Eclipse project builder.

We only compile Qt clients with Visual Studio, not OMC as otherwise we cannot load dlls compiled with MinGW
into a Visual Studio compiled executable.

Cheers,
Adrian Pop/

You can try: ellipse(x1, x2, y1, y2); but I don't know if it will work.
You could also import the results into Excel and do it there.
See here how to transform for .plt into .cvs:
http://www.mail-archive.com/openmodelic … 00474.html

Cheers,
Adrian Pop/

Hi,

No you don't. The only one you need is the one from here:
https://www.openmodelica.org/index.php/ … ource-code
which is:
https://openmodelica.org/svn/OpenModelica/trunk/
and this one:
https://openmodelica.ida.liu.se/svn/Ope … indows/VC7

Where did you get this link from? Is rather old. Let me know so I can update it.

Cheers,
Adrian Pop/

Hi,

The correct SVN url for the VC7 is here:
https://openmodelica.ida.liu.se/svn/Ope … indows/VC7
The server back to normal now.

Cheers,
Adrian Pop/

This is the .dll hell in Windows.
I'll look into it and add the required .dlls in the .msi file.

You shouldn't install Visual Studio Express, but the Microsoft Visual C++ 2010 Redistributable Package (x86)
http://www.microsoft.com/downloads/deta … laylang=en
Even if you install the redistributable package, it might not work.

Cheers,
Adrian Pop/

Jul-05-10 10:42:24
OpenModelica Compiler Optimizatio related
Category: Developer

There is an OpenModelica development course here:
http://www.ida.liu.se/~pelab/modelica/O … ersCourse/
You can look at the slides and do the exercises to get more into it.

Cheers,
Adrian Pop/

Jul-05-10 09:27:26
Trying to find the derivative of a fucntion

The derivative annotations for a function now works.
As far as I know (from Jens Frenkel) some of the MultiBody models (Pendulum, DoublePendulum) now actually simulate.

Cheers,
Adrian Pop/

The answer for this was already posted here:
https://www.openmodelica.org/index.php/ … opic?id=19

Cheers,
Adrian Pop/

Hi,

You have in your stack dump: Caused by: java.net.SocketException: Network is unreachable
So it seems like your Java installation cannot connect to the network for some reason.
It might be firewall related or see below.

I searched a bit for this problem and it seems that when sockets are set to IPV6 only Java
will not be able to connect to the network:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=560056
https://issues.apache.org/jira/browse/CASSANDRA-628
Try to apply their fix.

Cheers,
Adrian Pop/

Hi,

We implemented mostly what is needed to flatten the libraries.
We'll get to it after we are able to flatten MSL 3.x MultiBody and Media libraries which are on highest priority right now.
MultiBody is almost ready and Media is on the way.

Cheers,
Adrian Pop/

May-14-10 01:53:35
As in MATLAB GUIDE, is there a facility to program an interactive GUI

We do have a interactive simulation feature that was added recently to the Subversion.
You can view variables interactively and change the input parameters interactively.

Check the latest OpenModelica Users/System guides:
http://openmodelica.org/svn/OpenModelica/trunk/doc/
user: anonymous
pass: none  <--- write "none" here.

You can contact Parham <DOT> Vasaiely <AT> informatik <DOT> haw-hamburg <DOT> de
to find out more about the feature. He is also working on integrating it into an Eclipse plugin if he didn't do it already current/smile.

The feature is not yet included in the 1.5.0-RC3 release.

Cheers,
Adrian Pop/

Hi,

1. See if any omc process is running or not, and then kill it.
2. Check if you have the firewall on and if you do, try to add rules to let omc, java (SimForge), OMShell, OMNotebook process to connect to the *local only* network.
3. Start OMShell and see if is starting an omc process and if is working correctly.
4. Start SimForge again and see if is working.

Cheers,
Adrian Pop/

May-05-10 21:36:44
Compiler fails to simulate rather complex model

Hi,

For me the simulation takes 13 minutes.

adrpo@KAFKA ~/dev/OpenModelica/build/bin/
$ time ./PulsatileCirculatory.exe -v
real    13m56.953s
user    0m0.015s
sys     0m0.031s
You can call the generated executable with -v to see how it progresses.

So there is no infinite loop, it just takes a long time.
OpenModelica does not optimize the simulation code very well.
It does not do tearing (by default) or other optimizations, that's why is taking so long.

We have some people looking into these things but it will
take time to implement optimizations for the generated code.

Cheers,
Adrian Pop/

May-04-10 14:30:26
Compiler fails to simulate rather complex model

You have a circular parameter:
  compliantPumpFR.contractionSource.amplitude
depends on
  compliantPumpFR.contractionSource.offset
which depends again on:
  compliantPumpFR.contractionSource.amplitude.

This is not allowed in Modelica, see Section:
4.4.3 Acyclic Bindings of Constants and Parameters
in the Modelica Specification:
http://modelica.org/documents/ModelicaSpec32.pdf

Cheers,
Adrian Pop/

May-04-10 13:47:33
Compiler fails to simulate rather complex model

Hi,

Yes, I can verify the problem. The compiler seems to go into an infinite loop.
We'll have a look at it.

Cheers,
Adrian Pop/

We also have a Java-Corba client as an Eclipse project that you can use to connect to OMC:
http://www.ida.liu.se/~adrpo/omc/corba/_java/

Cheers,
Adrian Pop/

May-04-10 13:18:51
Graphical objects: Usage of constants for RGB-triples in annotations
Category: Programming

The instantiated variables and constants from a class cannot yet be used in the annotations.
We should fix that in some future, but we're focusing on some other more important things right now.

Cheers,
Adrian Pop/

Hi,

By default OpenModelica uses the dassl solver which has a variable step size.
The stepSize for the solver is calculated as (stopTime-startTime)/numberOfIntervals.
However, the stepSize only gives the time where the solver should output values and is not the actual step size of the solver.
By default (if you don't give anything to the simulate command):
stopTime = 1.0
startTime = 0.0
numberOfIntervals = 500

You can also select as method="euler" when you call the simulate command.
In that case I think the step size is fixed.

You can send an email to Willi Braun [willi <dot> braun <at> fh-bielefeld <dot> de]
and ask how he  implemented events in the Euler solver (and maybe post back
here with the answer).
Another way would be to look into the code how is done:
https://openmodelica.org/svn/OpenModeli … _euler.cpp
user: anonymous
pass: none  <- write none here

Cheers,
Adrian Pop/

Hi,

Would be very good to post the solution you found so people
that run into the same problem can get some guidance.

Cheers,
Adrian Pop/

Apr-18-10 17:51:04
A simple question

Hi,

We're keeping an eye on the forum all the time but we're rather busy so it takes a while to reply.

I can't reproduce your error. For me plotting works rather fine for stopTime=5 and stopTime=20.
https://www.openmodelica.org/components/com_agora/img/members/55/plot-stopTime-04.png
https://www.openmodelica.org/components/com_agora/img/members/55/plot-stopTime-05.png
https://www.openmodelica.org/components/com_agora/img/members/55/plot-stopTime-20.png

I used this script file: Pendulum.mos

Code:

loadFile("Pendulum.mo");

getErrorString();
simulate(Pendulum, stopTime=4);
getErrorString();
plot2(x);
getErrorString();
simulate(Pendulum, stopTime=5);
getErrorString();
plot2(x);
getErrorString();
simulate(Pendulum, stopTime=20);
getErrorString();
plot2(x);
getErrorString();

What version of OpenModelica are you running?
I'm using 1.5.0 RC2: http://www.ida.liu.se/~pelab/modelica/O … dows/rc2/.
If you're not using the same version try to uninstall your current one and install this new one.

Cheers,
Adrian Pop/

Hi,

Well, well, well. Functions are a totally different kind of animal than normal classes.
If you think about it, an outer component in a function is just another input.
Truth is I never thought about using inner/outer in this fashion.

You could easily use constants from the current scope directly in the function
algorithm section (remove outer Real pi; and "inner" from your model to achieve this).
Also, you can use full qualified paths to constants in algorithm sections in functions if all
the names from the path are packages, i.e. Modelica.Constants.pi.

You could create a ticket here:
http://trac.modelica.org/Modelica/newticket
and select component Modelica Specification and ask about this.
This should be clarified in the Modelica specification, so it would
be really good if you create the ticket.

I could create the ticket myself (let me know) but it would not be
fair as credits for this should go to you.

Cheers,
Adrian Pop/

Apr-08-10 04:03:25
...related to type conversion.

As far as I can tell all of them should work, even line 2 and 4 even
if the specification:
http://www.modelica.org/documents/ModelicaSpec32.pdf
only shows calls with EnumType.component.

I know why the second (line 2) doesn't work, and I think it can be fixed rather easily.
Basically the type checking fails as Integer(x) expects x to have the type of an
enumeration value but its type is of an enumeration type and only its binding
is an enumeration value.

Cheers,
Adrian Pop/

Hi,

Your system is incomplete. You will need to add one more equation for x.
All models in Modelica need to be balanced, that is, the number of variables needs to be equal with the number of equations.

Cheers,
Adrian Pop/

Apr-08-10 03:35:03
Need to use LP, MILP, NLP solvers from OpenModelica

Hi,

lp_solve is actually linked with OpenModelica. It is used for unit checking.
However, it could be complicated (if not imposible) to translate an usual Modelica model into an lp problem.
By default any Modelica model will be translated into a Hybrid DAE system. Have a look at the Modelica specification:
http://www.modelica.org/documents/ModelicaSpec32.pdf
As far as I can see you would need some sort of language extension to specify
minimization functions and maybe some new type of equations to specify constraints.
Then after the flattening you would have an lp problem that you could give to an LP solver.

You could also have a look at JModelica.org (http://www.jmodelica.org) as they are using an extension of Modelica called Optimica for optimization problems.

Cheers,
Adrian Pop/

Apr-06-10 16:32:05
...related to type conversion.

Hi,

Some parts of the enumerations are not implemented yet.

We implemented just enough to get the Modelica Standard Library going
and will implement everything from the specification in the near future.

Cheers,
Adrian Pop/

Apr-01-10 11:03:58
every simulation run by omc fails

Hm. I think I found what the problem is.

Here http://lists-archives.org/mingw-users/1 … c-6-0.html
it say that msvcrt.dll version less than 8 does generate these problems.

Somehow you ended up with an older (than version 8) msvcrt.dll in:
c:\windows\system32\msvcrt.dll

See if that is the case and try to install a newer one, i.e.:
http://www.microsoft.com/downloads/deta … laylang=en

Cheers,
Adrian Pop/

Apr-01-10 10:12:25
every simulation run by omc fails

No. Do you by any chance installed a new version of MinGW?
OpenModelica distributes with MinGW 3.4.5 and if you install
another one it might be a problem.

As it worked fine before, is something that you did in the meantime.

Cheers,
Adrian Pop/

Mar-30-10 23:59:21
OMC error

Have a look in the task manager and see if there is a hanged omc.exe there. If it is then just kill it.
Then try to restart OMShell again.

Also make sure omc.exe, OMShell.exe, OMNotebook.exe and ext.exe are added to your firewall
exceptions as they need local network communication.

If this doesn't work post back and I can give you more detailed instructions on how you can
start omc.exe manually before starting OMShell.

Cheers,
Adrian Pop/

We didn't had any request like this before as when you become a member of
the consortium you can distribute any part of OpenModelica as part of your product.

I assume you want to model something in OpenModelica and distribute the binary
for simulation or integrate the generated model as part of another system.

I'll ask around and come back with an answer.

Cheers,
Adrian Pop/

Mar-30-10 23:51:22
every simulation run by omc fails

There are several ways of handling with this:

1. Have a look in any of the generated *.log files. It might point you to the error.
2. Add getErrorString(); after the simulate command as it may give you additional info.
3. Run the script from the command line:
    > cd C:\OpenModelica1.5.0\testmodels
    > ..\bin\omc +showErrorMessages +d=failtrace sim_BouncingBall.mos

Post back here with what you find.

Cheers,
Adrian Pop/

Mar-12-10 05:32:22
Simulation failed. g++ not found

Hi,

I think the problem is that you installed OpenModelica in Program Files which has a space in it.

The problem with that is that the MinGW gcc compiler doesn't support spaces in the paths, see here:
  http://www.mingw.org/wiki/Getting_Started
"... we strongly recommend that you do not install MinGW in any location
with spaces in the path name reference; i.e. you should avoid installing
into any subdirectory of "Program Files" or "My Documents", or the like."

Try re-installing OpenModelica in a path (directory) that contains no spaces.
If this doesn't work post back and we'll do more investigation.

Cheers,
Adrian Pop/

Mar-08-10 01:55:44
Perceived dearth of information/wikis...
Category: Programming

Hi Paul,

Just wanted to point out is not me that gave the latest replies, so the thanks go to Martin Sjölund, not me current/smile

Cheers,
Adrian Pop/

Feb-26-10 05:53:16
instructions installation in 64 bits linux machines

Hi,

I also found out about this today (oops, yesterday) and fixed it in revision 5049.
Just update to the latest revision.

$ cd /path/to/trunk
$ svn up
$ make

This should fix the plotting.

Cheers,
Adrian Pop/

Feb-24-10 02:29:57
instructions installation in 64 bits linux machines

Hi,

We don't have binaries for 64 bit machines yet.

If you are a skilled Linux user you could compile the source code yourself.
However, compiling from source is not an easy task and not for Linux beginners.

The sources are available via Subversion:
svn co https://openmodelica.org/svn/OpenModelica/trunk/
user: anonymous
pass: none

Then when you get the sources, read and perform the steps in README.Cygwin.or.Linux.txt
If you run into trouble, post here and we'll try to help you.

Cheers,
Adrian Pop/

Feb-22-10 18:33:47
Perceived dearth of information/wikis...
Category: Programming

Hi,

We could improve the documentation a bit about calling external functions.

For now you can read a bit about this in the Modelica Specification:
http://www.modelica.org/documents/ModelicaSpec31.pdf
OpenModelica implements the external interface explained in the specification.

We still have some problems with tables so the Neural Network won't yet work.
We're actively working on fixing bugs but it might take a while as now we're focusing
on getting the Modelica.Mechanics.MultiBody and Modelica.Media to work with OpenModelica.

You can also find a lot more examples in out testsuite:
https://openmodelica.org/svn/OpenModeli … testsuite/
user: anonymous
pass: none (actually write none here)

Basically to wrap external C/C++ functions or libraries there are 2 ways to go:
1. Implement the same functionality in Modelica (using functions)
2. Add Modelica external function wrappers to the external libraries

You need to understand that Modelica functions/external functions have some
limitations by comparison to C. Read about those in the Modelica specification.
Basically, things are mostly static, so you cannot dynamically create objects
on the fly.

Also, functions can be classified into two categories:
1. pure functions (same input gives exactly the same output, so no side effects)
    these are mostly mathematical functions
2. impure functions (same input gives different output, so they have side effects)
    these would be mostly called within when equations or initial equations/algorithms.
    these are mostly logging facilities or reading input files, etc.

Well, enough for now, let us know if we can help you more.

Cheers,
Adrian Pop/

Feb-12-10 02:15:33
Question how to successfully use external libraries within SimForge

Hi,

Some information on what you looking for is here: https://trac.ws.dei.polimi.it/simforge/wiki/UserGuide
Is enough to load package.mo as this will trigger the loading of the entire library.

However, SimForge (and partially OpenModelica) doesn't yet support Modelica 3.x annotations.
Also, Modelica.Fluid, Modelica.Media, Modelica.MultiBody and maybe others do not work yet with
OpenModelica.

We are working to support the full Modelica 3.x and the entire Modelica Standard LIbrary but it will take a while.

Cheers,
Adrian Pop/

Hi,

First, you should tell us what OpenModelica version you use (and what OS) and maybe also give an example model with your problem.

Enumerations are supported, the only missing thing is using enumeration constants as index in arrays, i.e.:
Real[EnumerationType] x; will generate in the flattened code:

Real x[1];
Real x[2];
...
instead of:

Real x[EnumerationType.enum1];
Real x[EnumerationType.enum2];
...

Cheers,
Adrian Pop/

The problem was that the first version of 1.5.0-RC2 I uploaded on the website was missing 2 header files.
You can re-download the file from: http://www.ida.liu.se/labs/pelab/modeli … ndows/rc2/
This will get rid of the simulation problems you had.

Cheers,
Adrian Pop/

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