- Index
- » Users
- » adrpo
- » Profile
Posts
Hi,
I think we're just stupid enough that we don't include the model_info.xml inside the .fmu.
We generate this file recently with debugging info but we forgot to add it to the .fmu:
https://trac.openmodelica.org/OpenModel … eset/15865
https://trac.openmodelica.org/OpenModelica/ticket/2136
I'll see where I should put this file in the .fmu and fix this issue.
Cheers,
Adrian Pop/
Hi,
Ok, now I get it. You use Susan templates to walk the SCode structure as far as I can see. Then you shouldn't mix it with the Dump package.
We do have a dumper for SCode, see Templates/SCodeDumpTpl.tpl so have a look how we walk the structure there.
In general if you get crashes I suggest to try make clean and make omc again. Also, do make omc twice so the new templates are used.
So, as a rule if you change templates:
> make clean
> make omc
> make omc
Cheers,
Adrian Pop/
Hi,
I assume you're talking about Absyn.mo.
I suggest you look at Dump.dump or Dump.unparseStr on how to walk the Absyn data structure starting from Absyn.Program.
How do you get segmentation dumps? That should not happen if you use MetaModelica (in general only if
you do something fishy in external functions) or you try to append strings more than 16MB on 32 bit.
Cheers,
Adrian Pop/
Hi,
Yes, the latest should work fine.
I'm just curious why would you want to build it from scratch?
You can get nightly builds each day:
https://build.openmodelica.org/omc/buil … ly-builds/
Cheers,
Adrian Pop/
Disabling some optimizations for gcc might also help, so instead of -O3 you could use -O0.
I think you can do that via MODELICAUSERCFLAGS env. variable, set it to -O0.
Cheers,
Adrian Pop/
Hi,
The story is a bit more involved.
The MinGW GCC that comes with OpenModelica is a 32 bit executable and compiles to 32 bit executable.
So basically gcc can use only 2GB of memory when compiling.
I did change gcc.exe to be large address aware (but i don't remember if i did that too for cc1.exe)
which means it can go up to 4GB of memory.
You could try to compile with omc +target=msvc which uses cl (Visual Studio) compiler to compile the executable.
Also you could try to restart your computer and then try to compile immediately after that as you'll have more
contiguous memory available that way.
Cheers,
Adrian Pop/
Hi,
Interactive simulation doesn't work in 1.9.0beta4.
A lot of changes happened in the meantime.
You could use version 1.8.1 or the latest nightly build:
https://build.openmodelica.org/omc/buil … ly-builds/
where we made it work again (but is not very well tested)
Your choice.
Cheers,
Adrian Pop/
You can check it via if str1 == str2 then ... or via assert assert(str1 == str2)
The rule you give is for statements, not equations.
I was talking about equations where left hand side is a multiple output and right hand side is a function call returning multiple outputs.
(1, 2, 3)^(4,5,6) makes sense if you think about it as tuples, so is actually equivalent to (1^4, 2^5, 3^6).
Cheers,
Adrian Pop/
Hi,
I guess it is for brevity and to allow "(" output_expression_list ")" = fcall(...);
Maybe it would be better to remove it and have equation include the case with output_expression_list on the left hand side.
You can add a ticket at http://trac.modelica.org with Modelica Specification as a component and point it out.
Cheers,
Adrian Pop/
Hi,
Have a look at this tutorial:
https://www.openmodelica.org/images/doc … torial.pdf
Then you can have a look at the ModelicaSpecification:
https://modelica.org/documents/ModelicaSpec33.pdf
Then have a look in section: Modelica Courses here:
https://www.openmodelica.org/index.php/ … umentation
Then you could get a book:
http://www.amazon.com/s/ref=nb_sb_noss_ … s=modelica
Well, that's it
Cheers,
Adrian Pop/
Hi,
Just send us an email at OpenModelica <AT> ida <dot> liu <dot> se
and we can put you in contact with the developers of the CPP Codegen module.
Cheers,
Adrian Pop/
Hi,
If you're using Windows, I suggest you do this:
1. restart the computer (so that all the omc processes are stopped)
2. uninstall OpenModelica and remove c:\OpenModelica1.x.y
3. get the latest nightly-build from here:
https://build.openmodelica.org/omc/buil … ly-builds/
4. install the nightly build
Start OMedit (OpenModelica Connection Editor), go to Modelica.Blocks.Examples.PID_Controller and try to simulate it.
Also, let us know what operating system are you using: Windows (Xp, 7, Vista) 32/64 bit, Linux, MacOS?
Cheers,
Adrian Pop/
Hi,
Try the latest nightly-build:
https://build.openmodelica.org/omc/buil … ly-builds/
make sure you uninstalled any previous OpenModelica installation.
Let me know how it goes.
Cheers,
Adrian Pop/
Hi,
I think i found the problem. I'll fix it and make a new nightly-build and let you know when is ready.
We will also make a beta4 soon to fix this issue.
Thanks for your input!
Cheers,
Adrian Pop/
Hi,
Ok. Something is definitely wrong with your installation.
In nightly build revision 15012 all DrModelica from OMNotebook has simulate instead of simulation.
Did you uninstalled 1.8.0?
In the HelloWorld example, instead of simulate or plot write: checkSettings()
and Shift+Enter. You should get something like this:
Code:
record OpenModelica.Scripting.CheckSettingsResult
OPENMODELICAHOME = "C:/OpenModelica1.9.0-r15012/",
OPENMODELICALIBRARY = "C:/OpenModelica1.9.0-r15012/lib/omlibrary",
OMC_PATH = "C:/OpenModelica1.9.0-r15012//bin/omc.exe",
OMDEV_PATH = "",
OMC_FOUND = true,
MODELICAUSERCFLAGS = "",
WORKING_DIRECTORY = "C:/Users/adrpo/AppData/Local/Temp/OpenModelica",
CREATE_FILE_WORKS = false,
REMOVE_FILE_WORKS = false,
OS = "Windows_NT",
SYSTEM_INFO = "",
RTLIBS = " -static-libgcc -luuid -lole32 -lws2_32 -lsundials_kinsol -lsundials_nvecserial -llapack-mingw",
C_COMPILER = "gcc",
C_COMPILER_RESPONDING = false,
HAVE_CORBA = true,
CONFIGURE_CMDLINE = "Manually created Makefiles for OMDev"
end OpenModelica.Scripting.CheckSettingsResult;
Let us know how your result from checkSettings looks like.
Another problem might be if your uninstall did not complete because omc.exe was still running (in the background).
To make sure everything is installed correctly:
1. reboot (so that no more omc or other OpenModelica programs are left running)
2. backup any models or notebooks you might have in c:\OpenModelica1.9.0\
3. uninstall the nightly-build
4. delete c:\OpenModelica1.9.0 folder
5. reinstall the nightly-build
Sorry about all this trouble.
We did not have these issues with anybody else and is rather complicated to find out what goes wrong.
Cheers,
Adrian Pop/
Hi,
Do you have an older OMDev installed? If you don't know what that is then the answer is no.
If not, you can uninstall the beta3, install the latest nightly build:
https://build.openmodelica.org/omc/buil … ly-builds/
and restart and try again. We changed simulation to simulate in OMNotebook.
Cheers,
Adrian Pop/
Hi,
Do you mean HelloWorld from DrModelica?
If so, it seems we made a mistake in the beta3 and used "simulation" command instead of "simulate" command.
Just change "simulation" to "simulate" and it should work.
We'll fix this as soon as possible with a beta4.
Cheers,
Adrian Pop/
The omc ran by MDT is run with +g=MetaModelica (mainly used for our compiler developing).
Just disable that (remove +g=MetaModelica) in Window->Preferences->Modelica.
Cheers,
Adrian Pop/
ModelicaAdditions is an rather old library and is as far as I know based on Modelica 2.x annotations which OMEdit does not support.
Most of this library is part of the Modelica Standard Library (MSL) now.
I guess Peter F. will update this example in his new book that should come out soon.
See if you cannot find a newer version of the PetriNet library that uses MSL 3.x.
You might be able to load the library with a few minor changes (fixing within, etc) and then
simulate the example but I think you will not be able to see the models in the library.
Cheers,
Adrian Pop/
Hi,
You should be in that current directory so system("./BouncingBall -override h=5") should work.
Or add ./ to the PATH variable.
Why don't you use OMEdit?
There is another way to modify the variable bindings and start values using the API as OMEdit does it
Code:
loadModel("BouncingBall.mo"); getErrorString();
list(BouncingBall); getErrorString(); // h should have the value from the file
// to modify a parameter or variable binding use:
// setParameterValue(BouncingBall, h, 5): getErroString();
// to modify a variable start value use:
setComponentModifierValue(BouncingBall, h.start, $Code(=5)); getErrorString();
list(BouncingBall); getErrorString(); // h should have h(start=5)
simulate(BouncingBall);
// plot ....
Hi,
You can also use: buildModel to build the model and then run from command line or via system command:
Code:
./Model.exe -override h=5
Cheers,
Adrian Pop/
Hi,
We don't have such option. However I guess it won't be hard to implement as everything you need is in our SimulationRuntime/c code.
Also you could do this as a post-processing step to get rid of the extra points.
We also have an API to compare .mat files directly in OpenModelica. See any of the .mos scripts here:
https://trac.openmodelica.org/OpenModel … ries/msl32
Cheers,
Adrian Pop/
Hi,
It will work like this (via a script.mos containing):
Code:
// start script.mos
loadModel(Modelica, {"3.2.1"}); getErrorString();
loadFile("swm.mo"); getErrorString();
setMatchingAlgorithm("PFPlusExt");
setIndexReductionMethod("dynamicStateSelection");
simulate(SpringWithMass); getErrorString();
// -- end script.mos
I guess you could also set these flags from OMEdit somehow, but I don't know for sure.
Cheers,
Adrian Pop/
Hi,
Unfortunately we're mostly compiler developers so modeling is a bit of foreign to us.
I would suggest trying to ask this here:
http://stackoverflow.com/questions/tagged/modelica
as you would reach more modelers.
Cheers,
Adrian Pop/
Hi,
It seems our back-end goes infinite on this model.
I reported a bug about this here:
https://trac.openmodelica.org/OpenModelica/ticket/1948
Cheers,
Adrian Pop/
Hi,
It was a question about this recently on our internal list.
Let me see if I can point the guy who responded there to respond also here.
Cheers,
Adrian Pop/
Hi,
Unfortunately the runtime has changed drastically and the merge has to be done manually again.
If you know a bit about these things you might be able to do it. Otherwise you could try to use an
older build and patch that.
Cheers,
Adrian Pop/
Hi,
I don't think you can. The FMU's compiled with OpenModelica are compiled using MinGW GCC.
You cannot blend compilers and their runtimes as it will not work.
That it works in MSVC debug mode is just a coincidence.
Maybe it might work if you load the dll in your C code and call its functions but linking directly with it is a recipe for incompatibility issues.
Cheers,
Adrian Pop/
Hi,
Bug:
https://trac.openmodelica.org/OpenModelica/ticket/1882
was fixed now.
Cheers,
Adrian Pop/
Hi,
You could try asking this on:
http://stackoverflow.com/questions/tagged/modelica
as you get more modelers there.
Cheers,
Adrian Pop/
Hi,
Try the latest Linux build. Also, make sure you have installed sundials package.
Cheers,
Adrian Pop/
Hi,
Unfortunately we are not modelers, but compiler developers.
You can try: http://stackoverflow.com/questions/tagged/modelica
as you get far more modelers there.
You could also ask this question on openmodelicainterest@ida.liu.se or openmodelica@ida.liu.se
as you might have a better outcome there.
Cheers,
Adrian Pop/
Hi,
Read more here:
https://modelica.org/documents/ModelicaSpec33.pdf
Chapter 13: Packages
Cheers,
Adrian Pop/
Hi,
use addComponent() and updateComponent().
See here:
https://trac.openmodelica.org/OpenModel … aAPI-Howto
Also in the testsuite here:
https://trac.openmodelica.org/OpenModel … active-API
Cheers,
Adrian Pop/
See here, down below on installing Visual C++ 2005 SP1 Redistributable Package:
http://stackoverflow.com/questions/3972 … n-c-projec
Cheers,
Adrian Pop/
Hi,
Try install only for me, not for all users and it should work even with a non-admin user.
Cheers,
Adrian Pop/
Hi,
Oh, you're talking about the C++ back-end. No that's not available in the installation yet.
You need to download OpenModelica:
https://openmodelica.org/svn/OpenModelica/trunk/
user: anonymous
pass: none <--- write none here
and compile the SimulationRuntime/cpp
make -f Makefile.omdev.mingw runtimeCPP runtimeCPPinstall
and you'll get in in the build directory.
You will nee many more things, read README-OMDev-MinGW.txt in the top folder.
I don't really know why we don't ship the CPP runtime, we should do that.
Cheers,
Adrian Pop/
Hi,
Not directly, but we are working on a new instantiation phase which should fix this (indirectly).
Unfortunately we have plenty of work to do so things move a bit slow, but we'll get to bug fixing from time to time.
That's why is good to have them in Trac so we can pick one up and fix them.
Cheers,
Adrian Pop/
Hi,
No, this is some other bug it seems. The bug I mentioned above [https://trac.openmodelica.org/OpenModelica/ticket/1882]
makes the system of equations overdetermined, so you cannot actually simulate it at all.
If you have a model that triggers your bug:
Code:
Error: Interner Fehler generateHelpVarsForWhenStatements failed
Error: Interner Fehler ./Compiler/BackEnd/SimCode.mo: function createSimCode failed [Transformation from optimised DAE to simulation code structure failed]
add it to our bug tracker here with a bug description: https://trac.openmodelica.org/OpenModelica
so we can have a look at it.
Cheers,
Adrian Pop/
Hi,
Of course they are, otherwise we could not compile the generated C code.
some of the libs/headers are in:
C:\OpenModelica1.X.Y\include\omc and C:\OpenModelica1.X:Y\lib\omc
some others are in:
C:\OpenModelica1.X.Y\MinGW
Have a look in your Windows TemporaryDirectory/OpenModelica/OMEdit/ after you simulate a model,
and you will see Model.exe and Model.makefile in there. Have a look in Model.makefile to see how we compile the Model.exe from code using MinGW gcc.
Cheers,
Adrian Pop/
Hi,
I think is fine the way you do it with overrideFile.
I don't know why initial equation doesn't work, I think it should.
If equations support is on the way, so that warning will disappear in the future.
We currently translate if equations in if expressions but that's not always possible, especially when you have asserts.
Cheers,
Adrian Pop/
Hi,
I converted the library to UTF-8 and Modelica 3.x with Modelica 3.x graphical annotations.
You can get it here: https://trac.openmodelica.org/OpenModel … leDynamics
(use Download in other formats: Zip Archive).
However even if you can load it into OMEdit (OpenModelica connection editor) simulating it is another story.
You would need to modify the library quite a bit so that you can simulate any of the Examples.
Cheers,
Adrian Pop/
Hi,
I actually reported this bug a while back:
https://trac.openmodelica.org/OpenModelica/ticket/1664
Should be fixed in the next weeks.
Cheers,
Adrian Pop/
Hi,
No it should be OK. I thought this model was working, but it seems I was wrong.
I had a look in our testsuite and we don't seem to test for that particular model only for oneAxis:
https://test.openmodelica.org/hudson/jo … ies_msl31/
It seems to be a bug and there is an infinite loop. I'll add a bug report about it.
Cheers,
Adrian Pop/
Hi,
What version of the Modelica library are you using? The default 3.1 or 3.2.1?
Cheers,
Adrian Pop/
Hi,
Use the latest nightly build:
https://build.openmodelica.org/omc/buil … ly-builds/
Cheers,
Adrian Pop/
Hi,
I now converted the library to Modelica 3.x and also the annotations to 3.x.
You can get it from here (using a Subversion client, i.e. TortoiseSVN):
https://openmodelica.org/svn/OpenModeli … /libraries
user: anonymous
pass: none
You can also get it as a zip file from here:
https://trac.openmodelica.org/OpenModel … WasteWater
Click on "Download in other formats: Zip Archive".
I found a strange bug in OpenModelica so you cannot simulate any of the plant models until is it fixed. The bug is reported here:
https://trac.openmodelica.org/OpenModelica/ticket/1882
Also, it seems the library is rather weird as you need to run a Dymola mos script to set the initial values of the plant models.
For example this script WasteWater\ASM1\small_asm1.mos should be used for the model: WasteWater.ASM1.Examples.SmallPlant
However Modelica has evolved since this library was made, so you don't need such a script anymore, you can just set the
start values of those components to the values given in the .mos file. I haven't done that yet.
Cheers,
Adrian Pop/
Hi,
This should work (script.mos file):
Code:
loadModel(Modelica,{"2.2.1"}); getErrorString();
loadFile("WasteWater/WasteWater/package.mo"); getErrorString();
simulate(WasteWater.Path.To.What.Model.You.Want.To.Simulate); getErrorString();
However you have to go to the directory where package.mo is and add a package.encoding file
containing: Windows-1252
Just make a package.txt, write Windows-1252 and rename it to package.encoding.
This way you're telling omc to expect to have the files encoded in Windows-1252 char set.
I doubt that loading parts of the WaterWaste package would work as things are dependent on each other.
You could try the latest Windows nightly build from here:
https://build.openmodelica.org/omc/buil … ly-builds/
The best way would be to use omc from command line, i.e. Start->cmd.exe
/path/to/your/mosfile/ > C:\OpenModelicaX.Y.Z\bin\omc script.mos
If this library is build for Modelica 2.x you can run OMC like this (also note i loaded Modelica 2.2.1 in script.mos):
/path/to/your/mosfile/ > C:\OpenModelicaX.Y.Z\bin\omc +std=2.x script.mos
run > C:\OpenModelicaX.Y.Z\bin\omc +help
to get a list of flags for the command line.
Cheers,
Adrian Pop/
Hi,
I now included OMVizualize in the latest nightly-build for Windows:
https://build.openmodelica.org/omc/buil … ly-builds/
Cheers,
Adrian Pop/
Hi,
We do not yet have functionality in OMEdit to connect components to expandable connectors.
The only way right now is to do it manually in the text editor, i.e.
connect(bus.yourVar, realVar);
Cheers,
Adrian Pop/
Hi again,
We now added a bug report for this here:
https://trac.openmodelica.org/OpenModelica/ticket/1866
Hopefully it will be fixed soon.
Cheers,
Adrian Pop/
Ok. I sent an email to the back-end developers and they will hopefully answer.
Note that we're quite busy with other things so it might take a while.
Cheers,
Adrian Pop/
Hi,
In you script:
loadFile("path/to/Library/package.mo"); getErrorString();
simulate(Library.Path.To.Your.Model); getErrorString();
Should do it.
Cheers,
Adrian Pop/
Hi,
I ran the executable from command line
./EMF3Test.exe -lv LOG_SOLVER,LOG_EVENTS
and it seems the solver enters into some sort of loop with the event handling generated by zero crossings from these 2 equations:
Code:
bearingfriction1.startForward = pre(bearingfriction1.mode) == 0 and (bearingfriction1.sa > bearingfriction1.tau0_max or pre(bearingfriction1.startForward) and bearingfriction1.sa > bearingfriction1.tau0) or pre(bearingfriction1.mode) == -1 and bearingfriction1.w_relfric > bearingfriction1.w_small or initial() and bearingfriction1.w_relfric > 0.0;
bearingfriction1.startBackward = pre(bearingfriction1.mode) == 0 and (bearingfriction1.sa < (-bearingfriction1.tau0_max) or pre(bearingfriction1.startBackward) and bearingfriction1.sa < (-bearingfriction1.tau0)) or pre(bearingfriction1.mode) == 1 and bearingfriction1.w_relfric < (-bearingfriction1.w_small) or initial() and bearingfriction1.w_relfric < 0.0;
Why this happens only the back-end and simulation runtime developers can answer (hopefully soon).
Part of the problem might be in the tau_pos = [0,0.001;5,0.005]. I changed it to tau_pos = [0,0.001;5,1] and then it works fine, but I'm not a modeler so I don't know.
Cheers,
Adrian Pop/
Hi,
simulate(Model, outputFormat="csv") for comma separated value.
simulate(Model, outputFormat="plt") for pt plot text format.
Cheers,
Adrian Pop/
Hi,
The old visualization from OMNotebook is based on SimpleVisual and OMVisualize which is an OpenModelica library for simple visual animation.
However this is not very detailed and will probably be discontinued when we integrate Modelica 3D library better.
You can do Modelica 3D animation also from OMNotebook via cells and using the commands I gave above.
You will however need to start dbus-server.py outside of OMNotebook or inside it via the system command.
Cheers,
Adrian Pop/
Hi,
Hmm, are you on Linux? Then maybe this can help: http://www.eclipse.org/forums/index.php/m/913523/
If you're on Windows then I recommend you re-install Eclipse or restart it.
MDT works also with Eclipse 4.2.1 you can try that one if 3.5.x does not work.
Cheers,
Adrian Pop/
Hi,
Have you restarted Eclipse since you installed OpenModelica?
I even suggest a Windows logoff and logon.
Cheers,
Adrian Pop/
Hi,
I don't know yet if we will make this available as we do have another way
to visualize 3D models that we are working on.
The new way is via Modelica 3D and ModelicaServices
which is more close to Modelica "standard" for visualization.
The old visualize command is based on SimpleVisual which is
not "standard" Modelica visualization. We will have to take a decision
about this. I will let you know how things develop.
If you want to play with visualize you can install an older OpenModeilca
version, i think 1.6 was the latest that had this functionality working:
https://build.openmodelica.org/omc/buil … /releases/
Cheers,
Adrian Pop/
Hi,
It seems we're missing the OMVisualize executable from the OpenModelica installation.
I'll talk with some developers to add it to the next nightly builds.
Cheers,
Adrian Pop/
Hi,
Done in revision 13104, see here:
https://trac.openmodelica.org/OpenModel … eset/13104
Cheers,
Adrian Pop/
Hi,
We'll talk with the author of the PlanarMechanics library to see if we can include it in OpenModelica for the next release.
Cheers,
Adrian Pop/
Hi,
There is some work in progress to make visualization available via
the Modelica 3D library and ModelicaServices, but is not yet integrated
with OMEdit.
You will need the latest nightly-build for this:
https://build.openmodelica.org/omc/buil … ly-builds/
Read OpenModelica user's guide, chapter 11 on python and dependencies. Install those.
Also, you will need to copy C:\OpenModelica1.9.0\lib\omlibrary-modelica3d\libdbus-1.a
to C:\OpenModelica1.9.0\lib\omc\ as we misplaced it in this nightly-build.
Make a file called script.mos containing:
Code:
loadFile("double_wishbone.mo"); getErrorString();
loadModelica3D();
loadString("
partial model Visualization
inner ModelicaServices.Modelica3D.Controller m3d_control;
end Visualization;
model Visualize_DoubleWishBone
extends Visualization;
extends double_wishbone;
end Visualize_DoubleWishBone;
");
simulate(Visualize_DoubleWishBone,stopTime=30); getErrorString();
I assume you're in Windows, if not, let me know.
Now start dbus-server.py from: C:\OpenModelica1.9.0\lib\omlibrary-modelica3d\osg-gtk\dbus-server.py
You can double click on dbus-server.py if you have python installed.
In a Windows command prompt go to where you created script.mos and run:
> C:\OpenModelica1.9.0\bin\omc script.mos
This will run the model and a visualization window will show via dbus-server.py.
Note that all this 3D support is rather preliminary, so not all things are working. For example the "spring" shape is not supported yet.
Hopefully we will fully integrate this into OMEdit for the 1.9.0 release due in 1 month or so.
Cheers,
Adrian Pop/
Hi,
You need to do this:
1. have both cmlScript.mos and cmlTest.mo in E:\OM\Tests\
2. run from command line:
> e:
> cd E:\OM\Tests
E:\OM\Tests> C:\OpenModelica1.9.0\bin\omc.exe cmlScript.mos
This will generate all the files in E:\OM\Tests
Note, you will need to change cd(e:/OM/Tests/); in cmlScript.mos to cd(). Empty cd() just displays the current directory, does not change it.
The cd("path") command takes a string, so if you want to change directory via cd in your script you would need to do it like cd("e:/OM/Tests/");
output.log is the result of the running of the generated cmlTest.exe for simulation. If is empty then is OK, there were no errors during simulation.
Cheers,
Adrian Pop/
Hi,
This should not happen. By default omc stores everything in the current directory where it is ran.
You can do a mos script:
Code:
// -start script
cd(); // display the current directory
loadFile("YourModel.mo"); getErrorString();
simulate(YourModel, stopTime=2); getErrorString();
// -- end script
cmdline> /path/to/omc script.mos
The generated YourModel_res.mat file should be in the current directory where you ran omc.
You might have just ran .mo files (which do nothing, just displays the flatten code) or generates code with +s.
And then you searched the temp directory and found .mat files made via OMEdit.
Cheers,
Adrian Pop/
Hi,
Add a file called package.encoding where package.mo is containing:
Windows-1252
.. or convert the files to UTF-8 using:
> for x in `find . -name '*.mo'` ; do iconv -f Windows-1252 -t UTF-8 $x > "$x.utf8"; rm $x; mv "$x.utf8" $x; done
Cheers,
Adrian Pop/
Yeah, i forgot about that:
user: anonymous
pass: none <-- write none here
Cheers,
Adrian Pop/
Hi,
Oh, things have changed a lot! There is no more the old c_runtime, the new simulation runtime is here:
https://openmodelica.org/svn/OpenModeli … nRuntime/c
As far as I know we can generate VS projects for compilation of the new simulation runtime using CMake.
You will also need OMDev:
https://openmodelica.org/svn/OpenModeli … dows/OMDev
as it contains a lot of libs that are needed (sundials, etc).
I will ask Jens Frenkel to reply on this post too as he knows more about the CMake things.
Cheers,
Adrian Pop/
Hi,
Yes it does.
Is used for scaling during initialization and I think also when solving non-linear systems.
Also, if the value exits outside the [min, max] interval a warning will be given in output.log file.
Cheers,
Adrian Pop/
Hi,
You can get the PlanarMechanics library from here:
http://www.robotic.de/Dirk.Zimmer
Cheers,
Adrian Pop/
Hi,
I will try to implement it until the end of next week.
Cheers,
Adrian Pop/
Hi,
Since a while now you can do the overrides at the command line directly, i.e.
WasteWater.ASM1.Examples.ComplexPlant.exe -override nitri2.Si=5.178780049396e+01,nitri2.Ss=2.156778436699e+00
run:
WasteWater.ASM1.Examples.ComplexPlant.exe -?
at the command line to see the -override help.
This is very fast and does not change the .xml file at all, just overrides the values after they are read from the .xml file.
However if you have a lot of values that you need to change then most likely you will run out of command line size (Windows has 2047 chars only).
We could probably extend this very easily with something like -overrideFile=f.txt where each line contains
x1=val1
x2=val2
etc...
Cheers,
Adrian Pop/
Hi,
If you want, you can uninstall OpenModelica and install version 1.8.0, the last that has the interactive simulation still working:
https://build.openmodelica.org/omc/buil … ses/1.8.0/
Cheers,
Adrian Pop/
Hi,
Any reason for using the ancient OpenModelica 1.7.0?
You can upgrade to our latest nightly build:
https://build.openmodelica.org/omc/buil … ly-builds/
or to the latest release: 1.8.1:
https://build.openmodelica.org/omc/buil … ses/1.8.1/
Cheers,
Adrian Pop/
Hi,
Alternative link without user/password via Trac:
https://trac.openmodelica.org/OpenModel … aAPI-Howto
Cheers,
Adrian Pop/
Hi,
That's easy, see how ModelicaPreferencePage class is used.
Note that the compiler is exposed via CompilerProxy so you might need to add some methods to that interface and OMCProxy.
I can give you write access to the repository to push in your changes if you want, or you can send them to me via email (Adrian DOT Pop AT liu DOT se).
Cheers,
Adrian Pop/
Hi,
There are some issues with Modelica packages and MDT so autocomplete or lookup doesn't always work.
Mostly because we use loadFileInteractive instead of loadModel for the files in the project.
There are some documents on how to build MDT but some of them are rather outdated:
https://openmodelica.org/svn/MDT/trunk/docs
See MDT_building_a_new_version.pdf to see which projects you need to add to your workspace.
Unfortunately I don't have time now to update the build documents for MDT, maybe later.
Cheers,
Adrian Pop/
Hi,
I think it will work if you put the libraries in your project or
where the Modelica Standard Library is but I'm not 100%
sure.
Cheers,
Adrian Pop/
Hi,
To check if MDT connection to OMC is working you can open a .mo file and
see if in the status bar you have something like: OpenModelica Compiler 1.8.1+ (rNNNNN) is Online.
In general you can safely ignore "problems while communicating with the Open modelica compiler".
The sources are here:
https://openmodelica.org/svn/MDT/trunk/
user: anonymous
pass: none <-- write none here.
Feel free to hack them away.
Cheers,
Adrian Pop/
Hi,
Version 1.8.1 does not yet support interactive simulation.
Yes, the Model_init file is an Model_init.xml file now since a long time.
If you want interactive simulation use version 1.8.0.
Cheers,
Adrian Pop/
Hi,
OpenModelica generates Model_res.mat files on simulate(Model)
so I guess you can just import those in Matlab and play with them
there.
Cheers,
Adrian Pop/
Hi,
Upgrade to the latest build:
https://build.openmodelica.org/omc/buil … ly-builds/
and you can use the new facility I developed for the OpenTurns connection:
Model -override x=v1,y=v2,z=v3
this will read the Model_init.xml file, override the variables on the command line with the new values, then run the simulation.
Run ./Model -help for more info
I also fixed some issues with replace-startValue.bat,/sh so you can run them better now.
Are you on Windows? Then use system("cmd /C C:/OpenModelica1.8.1/share/omc/scripts/replace-startValue.bat p 10 M_init.xml > New_M_init.xml");
Cheers,
Adrian Pop/
Hi,
Only if you structure your files as a library, i.e. have a package.mo in that directory that will trigger the load of the other files.
See more in the Modelica Specification Chapter 13 on how to structure your files/directories: https://modelica.org/documents/ModelicaSpec33.pdf
We should however extend OMEdit a bit to run a configurable script when started, this way you could add anything to the startup procedure.
Cheers,
Adrian Pop/
Hi,
We need more info. What OpenModelica version/revision you have? Windows, Linux, Mac?
Do you have a model/file that has this behavior?
Cheers,
Adrian Pop/
Hi,
We have issues with MultiBody models based on MSL 3.2 because the gravityAccelerationFunction is replaceable.
I suggest you use MSL 3.1 as we are far better there (about 8-9 examples models do not simulate correctly):
http://test.openmodelica.org/~marsj/MSL … rsive.html
http://test.openmodelica.org/hudson/job … /simulate/
Cheers,
Adrian Pop/
Hi,
We're working on supporting Fluid and the plan is to have it working by September (at least flattening,
simulation might take a while longer). Media is partially already working (flattening is working, simulation
not for all models in the Examples).
See here for a clear picture on what we can flatten/simulate:
http://test.openmodelica.org/~marsj/MSL … rsive.html
Cheers,
Adrian Pop/
Hi,
No.
The Model.exe will not display/plot the results and will never do that.
You can use OMPlot from the OpenModelica installation for that.
These are the command line options for OMPlot:
Code:
Usage: OMPlot [OPTION] [--filename=NAME] [variable names]
OPTIONS
--title=TITLE Sets the TITLE of the plot window
--filename=NAME Sets the NAME of the file to plot
--legend=[true|false] Display a variable legend in the window
--grid=[true|false] Enable a grid in the window
--logx=[true|false] Use log scale for the x-axis
--logy=[true|false] Use log scale for the y-axis
--xlabel=LABEL Use LABEL as the label of the x-axis
--ylabel=LABEL Use LABEL as the label of the y-axis
--plot Create a normal plot
--plotAll Create a normal plot containing every variable in the result-file
--plotParametric Create a parametric plot (plot variables as functions of each other)
--xrange=LEFT:RIGHT Sets the initial range of the x-axis to LEFT:RIGHT
--yrange=LEFT:RIGHT Sets the initial range of the y-axis to LEFT:RIGHT
--new-window=[true|false] Create a MDI dialog in the plot-window
So, in the command line you can do something like this to plot all the variables:
Code:
> %OPENMODELICAHOME%\bin\OMPlot --filename=Model_res.mat --plotAll
or like this to plot only one (change VARIABLE_NAME to the name of your variable):
Code:
> %OPENMODELICAHOME%\bin\OMPlot --filename=Model_res.mat VARIABLE_NAME1 VARIABLE_NAME2
You can ship OMPlot.exe (take also all the .dlls from OpenModelicaX.Y.Z/bin) with your Model.exe if you don't want the user to install OpenModelica.
You should learn more about .bat files if you want to automate this.
You can create a .bat that runs your model, then plots the variables automatically.
Cheers,
Adrian Pop/
Hi,
Double click on it works also. But is a console application so it doesn't display anything.
It just runs and creates Model.mat.
To run from command line (replace _YOUR_USERNAME_ with your Windows user name):
Start->cmd.exe
> c:
> cd \Users\_YOUR_USERNAME_\AppData\Local\Temp\OpenModelica\OMEdit
> Model.exe
> Model.exe -?
Like that you run from the command line.
Cheers,
Adrian Pop/
Hi,
No, there is no guide.
However, is an Model.exe so you run it and the result will be a Model.mat file with the same name as your model.
The Model.mat file then can be opened with OMPlot or other programs.
Is also possible to generate Model.csv instead of Model.mat.
By default the .exe is generated in your temporary directory, which in Windows 7 is:
C:\Users\_YOUR_USERNAME_\AppData\Local\Temp\OpenModelica\OMEdit
You need the Model.exe, the Model_init.xml files.
By default Model.exe should not depend on any other .dlls or anything else so is self sufficient.
You run Model.exe from the command line to get Model.mat.
If you want Model.csv, edit Model_init.xml and change outputFormat = "csv" or outputFormat = "plt" (PtPlot format)
Run Model.exe -? for a list of command line parameters.
You can edit Model_init.xml to change the start values of the parameter before re-running Model.exe.
You can also use the script from here:
C:\OpenModelica1.8.1\share\omc\scripts\replace-startValue.bat variableName variableStartValue Model_init.xml > NewModel_init.xml
Hope this helps a bit.
Cheers,
Adrian Pop/
Hi,
This is also the behavior of Dymola. You get that extra equation.
You can however do this (redeclare the type, not the component) to get the wanted behavior.
File: Redeclare.mo
Code:
package Pkg
class Equations
Real x;
end Equations;
class DefaultEquations
extends Equations;
equation
x = 0.0;
end DefaultEquations;
class Base
replaceable class T = DefaultEquations;
replaceable T equations extends Equations;
end Base;
model DuplicateEquations
import Pkg.*;
class CustomizedClass
extends Base(redeclare class T = Equations);
equation
equations.x = 3;
end CustomizedClass;
CustomizedClass customized;
end DuplicateEquations;
end Pkg;
File: Redeclare.mos
Code:
loadFile("Redeclare.mo"); getErrorString();
instantiateModel(Pkg.DuplicateEquations); getErrorString();
Command line execution:
Code:
adrpo@ida-liu050 ~/dev/OpenModelica/build/bin/bah
$ ../omc.exe Redeclare.mos > trace-Redeclare.mos.txt
File:trace-Redeclare.mos.txt
Code:
true
""
"class Pkg.DuplicateEquations
Real customized.equations.x;
equation
customized.equations.x = 3.0;
end Pkg.DuplicateEquations;
"
""
Cheers,
Adrian Pop/
Hi,
Yeah, we moved things around and the doPlot script is now in: share/omc/scripts.
It does not really matter if you have PTII set or not as the default plot command will use OMPlot.
We could probably remove ptplot.jar completely in the future.
I think we cannot update because we did some modifications to the code (but I'm not 100% sure).
If the PTII variable interferes with existing installation of Ptolemy II we could probably change it to OMPTII or something like that.
Cheers,
Adrian Pop/
Hi,
You need to learn some Modelica!
Read the tutorial form here:
https://www.openmodelica.org/index.php/ … umentation
Then at least read the Modelica specification:
https://www.modelica.org/documents/Mode … ision1.pdf
As far as I can tell your "model" is not a model, is a function and the equation is an algorithm.
Cheers,
Adrian Pop/
Incredible, MultiBody was around for some years now and it used this unspecified feature from the beginning.
It should have been specified together with operators as they have the same call via instance thing.
Well, we'll support it anyway via Per's work in the near future.
Cheers,
Adrian Pop/
Hi,
Because the gravityAccelerationFunction is replaceable in MSL32 and we don't handle yet replaceable functions called via the instance (component).
The call world.gravityAcceleration(...) is not even legal Modelica (maybe was added to the last Modelica specification, but I have to check), and we
used a hack to support it, which works in MSL31 but does not work in MSL32.
One of our developers (Per Östlund) works on a new flattening phase that should fix most of the issues with replaceable affecting MultyBody, Media and Fluid.
This is estimated to be available in 2-3 months.
Cheers,
Adrian Pop/
Hi,
You should have got an email from the CodeBeamer system to activate your user (have a look in Spam).
However, I now activated you user manually and you can login and Join the OpenModelica project, see here at the end:
https://www.openmodelica.org/index.php/ … ource-code
Cheers,
Adrian Pop/
We know about issues with Compile.bat. If you're using 1.8.0 you should upgrade to a latest nightly build which has this fixed:
http://build.openmodelica.org/omc/build … ly-builds/
Cheers,
Adrian Pop/
We're working on a new flattening phase in OpenModelica that will not break arrays.
Hopefully this will be available in the next months.
Cheers,
Adrian Pop/
Hi,
Each Modelica tool has its own way of generating Flat Modelica and no standard on how it should look has been made yet.
Basically the rules of getting from Modelica code to Flat Modelica code are in the Modelica Specification
and all tools are based on the interpretation of the specification.
Cheers,
Adrian Pop/
Hi,
Do you have non-English characters in your .mo file?
Have a look in the file dadadada_init.xml at line 67 to see what the problem is.
The file should be in your Temporary folder Temp/OpenModelica/OMEdit.
Let us know what is on that line 67.
Cheers,
Adrian Pop/
Yes. Is not possible to have 2 versions at the same time.
Cheers,
Adrian Pop/
Hi,
Nightly-builds are newer version of OpenModelica (not released yet officially).
You should try newer versions than 1.8.0 as this version can have some issues
with compilation of models depending of what you have installed on your system (like
some other MinGW compiler, etc).
Cheers,
Adrian Pop/
Hi,
What system do you have? Windows? Linux?
What OpenModelica version/revision you installed?
You could try to uninstall and install the latest nightly build from here:
http://build.openmodelica.org/omc/build … ly-builds/
Cheers,
Adrian Pop/
That's already ancient, take the latest build from here:
http://build.openmodelica.org/omc/build … ly-builds/
Cheers,
Adrian Pop/
Just remove the tick for Categories and you will find the MDT update as we have no category for it.
Cheers,
Adrian Pop/
Hi,
You could try to filter just some of them, i.e. "*dynometerController*", or "*DynoSetTorque*".
This would make the mat file smaller anyway.
Cheers,
Adrian Pop/
Continued on: http://www.openmodelica.org/index.php/f … pic?id=530
Ok, how do you import the FMU?
We do tests from command line via mos scripts, i.e. BouncingBall.mos
Code:
importFMU("BouncingBall.fmu"); getErrorString();
loadFile("BouncingBallFMUImport.mo"); getErrorString();
simulate(FMUImport_BouncingBall.FMUBlock); getErrorString();
then run omc BouncingBall.mos
See more tests here:
https://openmodelica.ida.liu.se/svn/Ope … tsuite/fmi
user: anonymous
pass: none <-- write none here.
Cheers,
Adrian Pop/
Hi,
You should try 1.8.0 release as in the nightly builds we have some FMI issues which will take a while to fix.
Cheers,
Adrian Pop/
Hi,
But it does, after all the attributes, before = "true" >.
Cheers,
Adrian Pop/
I don't have any missing end tags for elements in _init.xml. Everything is properly closed.
How do you get this? Do you have a model?
Code:
<ScalarVariable
name = "y"
valueReference = "1000"
variability = "continuous" isDiscrete = "false"
causality = "internal"
alias = "noAlias"
classIndex = "0" classType = "rSta"
fileName = "ArrayEqn.mo" startLine = "16" startColumn = "3" endLine = "16" endColumn = "23" fileWritable = "true">
<Real start="1.0" fixed="true" />
</ScalarVariable>
Cheers,
Adrian Pop/
You might be able to change the simulation runtime code to link it
directly with your application and call it via C calls and change the
variables directly in the input vectors.
Cheers,
Adrian Pop/
Hi,
We don't fully support Modelica.Fluid yet.
We can flatten Modelica.Media but we cannot simulate all models.
We are working on fully supporting these libraries but it will take some time.
Cheers,
Adrian Pop/
Hi,
The XML format is based on FMI with some OpenModelica additions.
http://functional-mockup-interface.org/fmi.html
Yes, we should provide some documentation on what everything
represents, but we had no time to do that yet.
Crash course here (on the additions from FMI):
classType = [r|i|b|s][Sta|Der|Par|Alg|Ali]
r=Real
i=Integer
b=Boolean
s=String
Sta=state
Der=state derivative
Par=Parameter
Alg=Algebraic
Ali=Alias
classIndex - differentiate between classType using a number
valueReference = index in the arrays generated in the C code by OMC
file position information is straightforward
The numberOf* at the begining you can see which ones are OMC and FMI
from the cmt_*
Cheers,
Adrian Pop/
Hi,
Have you tried the latest nightly build?
http://build.openmodelica.org/omc/build … ly-builds/
Cheers,
Adrian Pop/
You could try the latest nightly build:
http://build.openmodelica.org/omc/build … ly-builds/
You can also have a look into:
C:\OpenModelica1.8.0\share\omc\scripts\Compile.bat
as we use this script to compile models.
You could remove the echo off and see what is happening and why the PATH is not set correctly to:
C:\OpenModelica1.8.0\MinGW\bin
where gcc is.
Cheers,
Adrian Pop/
Hi,
Is not possible any longer to compile OpenModelica with Visual Studio.
We only compile it with MinGW GCC since a while now (a year or so).
We might resurrect the VS building later on but is not a priority for us.
Why do you want to compile OpenModelica with VS?
Cheers,
Adrian Pop/
Basically you can use external functions and send the data via tcp/ip or some other means.
You can have a look at this application:
https://www.openmodelica.org/index.php/ … es?start=5
Cheers,
Adrian Pop/
I think it was this bug: https://openmodelica.org:8443/cb/issue/1641
and is now fixed.
Cheers,
Adrian Pop/
Hi,
Well, it should be possible. You can hack the c_runtime to output the final values into omcfinal.txt if you want, it should be rather easy.
Cheers,
Adrian Pop/
Hi,
You can use the environment variable MODELICAUSERCFLAGS=-Wl,-Ldirectory or you can use the LibraryDirectory annotation:
annotation(LibraryDirectory="directory");
Cheers,
Adrian Pop/
Hi,
Try to use this one:
Code:
model Pendulum
parameter Real m=0.5;
parameter Real g=9.82;
parameter Real L=1;
Real x(start=L),y(start=0),xd,yd;
Real Fo;
equation
der(y)=yd;
der(x)=xd;
m*der(xd) = -x*Fo/L;
m*der(yd) = -m*g-Fo*y/L;
x*x+y*y=L^2;
end Pendulum;
Cheers,
Adrian Pop/
Hi,
This problems seems to have been solved in OpenModelica 1.8.0.
Cheers,
Adrian Pop/
You can send the file to OpenModelica <at> ida <dot> liu <dot> se.
If this is Media or Fluid you're trying to use we don't fully support them yet.
Cheers,
Adrian Pop/
Yes, tables need to have monotonically increasing values.
We added now a check for that and it should report a warning for it.
Cheers,
Adrian Pop/
Hi,
Yes, this seems to be a bug with escaping strings send to OMC.
You could try to use < instead of " for includes for now.
Cheers,
Adrian Pop/
This should be a setting in OMEdit, but we don't have that yet.
You might try Tools->OMC logger:
cd("/path/to/where/you/want/the/files"); + Send
then build the model.
You can also run scripts from command line, directly with omc via .bat files to put the generated files wherever you want.
Cheers,
Adrian Pop/
Hi,
I think the real error message is not show here.
The problem is that we're evaluating functions by dynamic loading and the
first getValue call builds the .dll and loads it in the process, then the next
call tries to do that again and fails to generate the .dll because is already
loaded in the OMC process. So the correct error should be "permission denied".
With the latest omc this seems to work fine:
Code:
adrpo@ida-liu050 ~/dev/OpenModelica/build/bin/romar_ro
$ ../omc f.mos Modelica
true
""
(235.15,7)
(101300.0,15)
""
adrpo@ida-liu050 ~/dev/OpenModelica/build/bin/romar_ro
$ cat f.mos
loadFile("f.mo"); getErrorString();
getValue("235.15,1.013e5,4.18");
getValue("235.15,1.013e5,4.18",7);
getErrorString();
Get the latest nightly build here:
http://build.openmodelica.org/omc/build … ly-builds/
Cheers,
Adrian Pop/
No problem. We're not the fashion police
Cheers,
Adrian Pop/
Unfortunately we're not Dymola experts.
Maybe you can ask this question on the Modelica forums:
https://modelica.org/users
Cheers,
Adrian Pop/
Hi,
Yes, this is a bug.
You can circumvent it by using this model:
Code:
model MyExtendingModel
package MyPackage = MyExtendingPackage;
extends MyPartialModel(redeclare package MyPackage = MyExtendingPackage/*MyPackage*/);
end MyExtendingModel;
I'll look more into why this happens.
Cheers,
Adrian Pop/
Yes, this is a bug, y and mySrc.y should be false until 1.5.
It might be a problem with initialization. I'll add a bug in our bug tracker so we can fix it.
Cheers,
Adrian Pop/
Hi,
As far as I know there is nobody else working on OMEdit (or other clients) for collaborative tasks.
Yes, is 3:10 here but we're night owls
Cheers,
Adrian Pop/
Hi,
Is easy to contribute back: Go here (read at the bottom):
https://www.openmodelica.org/index.php/ … ource-code
make a user in CodeBeamer, join the OpenModelica project and I can give you write access to Subversion so you can push your changes.
Just make sure you run the full testsuite and don't get any other failures than without your changes.
Read also here about legal issues when contributing:
https://www.openmodelica.org/index.php/ … -agreement
As far as I know , right now there is no API to get the annotations in string format, they are flattened out.
However, it might be that you can use getNamedAnnotation(path, "annotationname"), but as far as I know that is only for classes.
It might be that Adeel knows more about this, i'll send him an email and point him to this post so he can reply if he can.
Cheers,
Adrian Pop/
Hi,
It should be possible to set anything in there. Maybe you're not using the proper API syntax.
See here a bit (with examples) on how to use the API:
http://openmodelica.org/svn/OpenModelic … -HowTo.pdf
user: anonymous
pass:none <-- write none here.
If you get stuck add an small example here of what is not working so that we can better help you out.
Cheers,
Adrian Pop/
Fixed in revision 10651.
I had this fix for a while but didn't push it in as i'm having some other local modifications i'm working on.
Cheers,
Adrian Pop/
I now added bug:
https://openmodelica.org:8443/cb/issue/1664
about this.
Cheers,
Adrian Pop/
Hi,
There's definitely something strange with the model simulation.
From what I can see from OMEdit logs it takes: 279.89 secs (4.6 minutes) to build the model (about 1 minute to run gcc).
Seems our back-end is a bit slow as it only takes 5.6 seconds to flatten the model (i.e. via instantiateModel(...)).
buildModel(Modelica.Mechanics.MultiBody.Examples.Systems.RobotR3.fullRobot,startTime=0.0, stopTime=2.0, numberOfIntervals=500, method="dassl", tolerance=0.000001, outputFormat="mat") 23:43:34:465
{"C:/Users/adrpo/AppData/Local/Temp/OpenModelica/OMEdit/Modelica.Mechanics.MultiBody.Examples.Systems.RobotR3.fullRobot","Modelica.Mechanics.MultiBody.Examples.Systems.RobotR3.fullRobot_init.xml"} 23:48:14:355
Elapsed Time :: 279.89 secs
Then it starts the executable which doesn't seem to progress at all.
Seems it gets stuck at initialization (I ran the executable from the command line with debug flags)
Modelica.Mechanics.MultiBody.Examples.Systems.RobotR3.fullRobot.exe -lv LOG_DEBUG
.....
info | nelderMeadEx_initialization | initialization-nr. 0
and here it gets stuck. I'll add this as a bug so we can look at it.
Cheers,
Adrian Pop/
I might be that cd /d "c:/Programmi/OpenModelica//MinGW/bin" fails because of the double //.
Is strange anyway, as i have the same \ at the end of my OPENMODELICAHOME and is working fine.
Maybe cd has some weird and undocumented /P switch that we don't know about?
I'll play with it and see what's the issue.
Cheers,
Adrian Pop/
The problem mostly lies with your settings and the compile script in
C:\Programmi\OpenModelica\share\omc\scripts\Compile.bat
In the compile script we do cd to C:\Programmi\OpenModelica\MinGW
to set the path to it, then we cd back to your working directory.
It seems that the path settings to MinGW are not done correctly.
You can remove some of the REM in the .bat file to get more output out of the Compile.bat script
and see what the problem is.
Cheers,
Adrian Pop/
Hi,
I think I will enable the loading of Modelica.Fluid in OMEdit as omc doesn't go into infinite loops anymore (hopefully).
I'll make a new OMEdit build and a new OpenModelica build soon with this feature and let you know when is available.
Cheers,
Adrian Pop/
Hi,
This was fixed in revision: 10562.
If you're on Windows you will need a new build (let me know if you need one).
If you're on Linux then you can svn up and compile or wait for a new build package.
Cheers,
Adrian Pop/
I found the bug and also added a bug report about it here:
https://openmodelica.org:8443/cb/issue/1652
so it should be fixed in the near future.
Basically, during the simulation the values of the parameters are fine,
but we only write them to the result file once and we do that before
bound_parameters function is called so the value of the parameters
in the result file will always be the start value.
Cheers,
Adrian Pop/
Hi,
This is clearly a bug somewhere in the simulation runtime I think.
I'm running this script:
Code:
loadFile("RedeclarePackage.mo"); getErrorString();
instantiateModel(Test); getErrorString();
simulate(Test); getErrorString();
"mod.result1@0";
val(mod.result1, 0);
"mod.result2@0";
val(mod.result2, 0);
"mod.value@0";
val(mod.value, 0);
Code:
adrpo@ida-liu050 ~/dev/OpenModelica/build/bin/mburisch
$ ../omc RedeclarePackage.mos
true
""
"function TestModel.Function.func
input Real value;
output Real result;
algorithm
result := value;
end TestModel.Function.func;
class Test
parameter Real mod.value = 1.0;
parameter Real mod.result2 = 1.0;
Real mod.x;
parameter Real mod.result1 = TestModel.Function.func(mod.value);
equation
mod.x = TestModel.Function.func(1.0 + time);
end Test;
"
""
record SimulationResult
resultFile = "c:/bin/cygwin/home/adrpo/dev/OpenModelica/build/bin/mburisch/Test_res.mat",
simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-006, method = 'dassl', fileNamePrefix = 'Test', storeInTemp = false, noClean = false, options = '', outputFormat = 'mat', variableFilter = '.*', measureTime = false, cflags = ''",
messages = "",
timeFrontend = 0.00878583210949665,
timeBackend = 0.00225044799159258,
timeSimCode = 0.00803632437093511,
timeTemplates = 0.00941215418994843,
timeCompile = 1.5899761520265,
timeSimulation = 0.0866534113765805,
timeTotal = 1.70516167155239
end SimulationResult;
""
"mod.result1@0"
0.0
"mod.result2@0"
1.0
"mod.value@0"
1.0
The flattened model looks OK.
However the mod.result1 at time 0 should be 1.
The dependent parameters are calculated via a function in the generated c code called bound_parameters and the call to the function mod.result1 = TestModel.Function.func(mod.value) is there, but somehow the result is not propagated to mod1.result1.
If you run Test.exe with debug flags you get this:
Code:
adrpo@ida-liu050 ~/dev/OpenModelica/build/bin/mburisch
$ ./Test.exe -lv LOG_DEBUG
read start = 0 from init file.
read stop = 1 from init file.
read stepSize = 0.002 from init file.
read tolerance = 1e-006 from init file.
read method = dassl from init file.
read outputFormat = mat from init file.
read variableFilter = .* from init file.
read $dummy = 0 from init file.
read der($dummy) = 0 from init file.
read mod.x = 0 from init file.
read mod.value = 1 from init file.
read mod.result2 = 1 from init file.
read mod.result1 = 0 from init file.
Read parameter data from file Test_init.xml
| info LOG_EVENTS | Number of sorted, unique sample events: 0
initDelay called with startTime = 0.000000
Allocated simulation result data storage for method 'mat' and file='Test_res.mat'
Recognized solver: dassl.
| info LOG_SOLVER | Calculated bound parameters
....
so the function to calculate bound parameters is called, but somehow the result read via the _init.xml file "read mod.result1 = 0 from init file" is kept.
I'll add a bug about this.
Cheers,
Adrian Pop/
Hi,
It seems that our back-end enters an infinite loop and stack-overflows (that's why you see that large trace).
I reported this as a bug for the back-end here: https://openmodelica.org:8443/cb/issue/1651 so we can
have a look at it.
Cheers,
Adrian Pop/
I'm glad you fixed it. I think the problem is that OMEdit translates OPENMODELICAHOME to forward
slashes, i.e. C:/OpenModelica1.8.0/ and that poses problems for Windows commands it seems.
Well, I'll see what more I can do for our next build.
Cheers,
Adrian Pop/
Hi,
Yeah, I've been trying to fix an issue for people that have several MinGW and Msys installed (and
some of them are in the path) and I've ended up breaking our compile script for Windows.
Download Compile.bat from here:
http://openmodelica.org/svn/OpenModelic … r/scripts/
user: anonymous
pass: none <- write "none" here
and replace it in the OpenModelica installation here:
C:\OpenModelica1.8.0\share\omc\scripts
Let me know if this one works for you.
Cheers,
Adrian Pop/
Hi,
Improving performance is always tricky as we have a lot of legacy code in the compiler.
Of course one of our goals is to improve performance, but it will take a while as the
priority now is on fully supporting Modelica Standard LIbrary (MSL) 3.1.
Cheers,
Adrian Pop/
Hi,
Can you download Compile.bat from:
http://openmodelica.org/svn/OpenModelic … r/scripts/
user: anonymous
pass: none <-- write "none" here
and replace the Compile.bat in your OpenModelica installation here:
C:\Programmi\OpenModelica\share\omc\scripts
then try to compile again from OMEdit.
Let me know if is working.
Cheers,
Adrian Pop/
Hi,
Ok, this seems to be a bug in the last build. We'll try to fix it soon.
Cheers,
Adrian Pop/
Hi,
Is not a problem of lines of code or even number of equations in your model.
Most of the issues in OpenModelica come from complicated lookup in the presence of redeclares.
Modelica.Media and Modelica.Fluid use a lot of redeclares in a lot of different ways (redeclare as element,
redeclare model extends, redeclare in components, extends clause and short class definitions) and
several depths in the model hierarchy. Lookup in OpenModelica will sometime go into an infinite loop
and crash the compiler and that is mostly the only reason why you get crashes.
If you want strict limits, then they are easy: don't use really complicated replaceable classes
and redeclares and your model will most likely work (i know this is not reasonable).
We do handle Modelica.Media now (simulation of some examples is still an issue due to more functionality
we need in the back-end) and some parts of Modelica.Fluid and the goal is of course to get these to work.
But it will take some time to get there. As far as we known Dymola is the only tool right now that can actually
handle Modelica.Fluid (I know that the guys at SimulationX are working on it, they might have fixed it by now,
but I don't know for sure).
If you want, you can add your code in our bug tracker as a bug or just send it to us by email at
OpenModelica@ida.liu.se and we can have a look at it and see if we can fix some of your issues.
Let us know if the code is public or not as if it is public we can add it in the bug tracker.
If you want to know which models we support from Media and Fluid just search for Modelica.Media and Modelica.Fluid in the trace of our testsuite:
http://build.openmodelica.org/omc/build … -trace.txt
Note that by support I mean that the compiler can flatten the model hierarchy (without crashing) and generate flat Modelica code.
Cheers,
Adrian Pop/
Hi,
Run the simulation executable with -? to get a list of all the command line parameters you can use.
Unfortunately, right now you cannot set these from the OMC simulate command.
However, you can use buildModel command (with the same arguments as simulate) which generates
the simulation executable (but doesn't run it) and then use the system("shell command here") command
to run the executable with whatever parameters you want.
Code:
adrpo@ida-liu050 ~/dev/OpenModelica/build/bin
$ ./Model.exe -?
usage: Model.exe <-f initfile> <-r result file> -m solver:{dassl,euler,rungekutta,dopri5,inline-euler or inline-rungekutta} <-interactive> <-port value>
-lv [LOG_STATS] [LOG_INIT] [LOG_RES_INIT] [LOG_SOLVER] [LOG_EVENTS] [LOG_NONLIN_SYS] [LOG_ZEROCROSSINGS] [LOG_DEBUG]
So basically, you can use: -lv LOG_DEBUG to have the most detailed information ( I think ).
Cheers,
Adrian Pop/
Hi,
I guess you have some beta version.
Try the build I made some hours ago:
http://build.openmodelica.org/omc/build … ses/1.8.0/
Cheers,
Adrian Pop/
Hi,
This is the way we populate the r[1], r[2], .... r[17] right now by calling the function and indexing the result.
We should improve it to have just one call, but right now this is the way it goes.
We have a bug for it, so it will be fixed in some future:
https://openmodelica.org:8443/cb/issue/ … ation=true
Cheers,
Adrian Pop/
Hi,
You can contact Parham at EADS (parham <DOT> vasaiely <AT> eads <DOT> com) as he already implemented an interactive client in Java.
As far as I know the client is part of ModelicaML and I think the code is here:
https://openmodelica.org/svn/MDT/trunk/ … simulation
user: anonymous
pass: none
Cheers,
Adrian Pop/
Hi,
I'm uploading a new build now:
http://build.openmodelica.org/omc/build … ly-builds/
Sorry for the delay.
Cheers,
Adrian Pop/
Martin S. was talking about Linux/Mac builds (availability) which are automatic.
If you're using the windows builds I'll make one by tomorrow and let you know
when is available.
Cheers,
Adrian Pop/
Note that this is not the way, the OMC API commands (the text) below, you put them in a file called script.mos
Code:
loadModel(Modelica);
loadFile("MyModel.mo");
simulate(MyModel, ...);
plot(x);
then you use the SHELL script command:
Code:
> omc script.mos
to run this sequence of OMC API commands from Modelica script file script.mos.
Use the latest nightly-build to have plot3:
http://build.openmodelica.org/omc/build … ly-builds/
I only use omc from command line, i.e. (cmd.exe):
> cd path\to\where\the\files\are\
> c:\OpenModelica1.7.0\bin\omc petrou.mos
In OMShell, use forward slashes in loadFile, ie / instead of \.
You can use:
> cd("path/to/where/files/are");
> runScript("petrou.mos");
Cheers,
Adrian Pop/
Because of equation: "der(x) = A*x + F*v;" x is continuous, so you cannot make it discrete.
The value of x does not change between step times in the output file so the output is discrete,
however our plotting does interpolation, that's why you see it as continuous.
If you want the output to be discrete, then you do it like this:
Code:
model petrou
parameter Real A[14,14] = zeros(14,14);
parameter Real F[14,4] = ones(14,4) * 10.5;
// make it 12 to be sure we don't run out of bounds
parameter Real u[12,4] = ones(12,4) * 1.5;
Real x[14];
discrete Real y[14];
Real v[4];
Integer i(start = 0);
equation
i = integer(floor(time + 1));
for j in 1:4 loop
v[j] = u[i,j];
end for;
der(x) = A*x + F*v;
when sample(0, 1) then
y = x;
end when;
end petrou;
Code:
loadFile("petrou.mo"); getErrorString();
system("rm -f petrou.exe petrou.c petrou.l* petrou.makefile petrou.o petrou petrou_*"); getErrorString();
simulate(petrou, stopTime=10, numberOfIntervals=10); getErrorString();
plot3({y[1], y[2], y[3], y[4], y[5], y[6], y[7], y[8], y[9], y[10], y[11], y[12], y[13], y[14], v[1], v[2], v[3], v[4]});
simulate(petrou, stopTime=10, numberOfIntervals=10, outputFormat="csv"); getErrorString();
readFile("petrou_res.csv"); getErrorString();
Cheers,
Adrian Pop/
Here is it the model:
Code:
// file: petrou.mo
model petrou
parameter Real A[14,14] = zeros(14,14);
parameter Real F[14,4] = ones(14,4) * 10.5;
// make it 12 to be sure we don't run out of bounds
parameter Real u[12,4] = ones(12,4) * 1.5;
Real x[14];
Real v[4];
Integer i(start = 0);
equation
i = integer(floor(time + 1));
for j in 1:4 loop
v[j] = u[i,j];
end for;
der(x) = A*x + F*v;
end petrou;
The script to do the simulation and plotting.
Code:
// file: petrou.mos
loadFile("petrou.mo"); getErrorString();
system("rm -f petrou.exe petrou.c petrou.l* petrou.makefile petrou.o petrou petrou_*"); getErrorString();
simulate(petrou, stopTime=10, numberOfIntervals=10); getErrorString();
plot3({x[1], x[2], x[3], x[4], x[5], x[6], x[7], x[8], x[9], x[10], x[11], x[12], x[13], x[14], v[1], v[2], v[3], v[4]});
simulate(petrou, stopTime=10, numberOfIntervals=10, outputFormat="csv"); getErrorString();
readFile("petrou_res.csv"); getErrorString();
Code:
adrpo@ida-liu050 ~/dev/OpenModelicaBackend/build/bin/petrou
$ /c/OpenModelica1.7.0/bin/omc.exe petrou.mos
true
""
0
""
record SimulationResult
resultFile = "petrou_res.mat",
simulationOptions = "startTime = 0.0, stopTime = 10.0, numberOfIntervals = 10, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'petrou', storeInTemp = false, noClean = false, options = '', outputFormat = 'mat', variableFilter = '.*', measureTime = false, cflags = ''",
messages = "",
timeFrontend = 0.0374963188519052,
timeBackend = 0.0962468650091716,
timeSimCode = 0.025620405782819,
timeTemplates = 0.0350056492390369,
timeCompile = 2.18642527317487,
timeSimulation = 0.0637284207730315,
timeTotal = 2.44462340652001
end SimulationResult;
""
true
record SimulationResult
resultFile = "petrou_res.csv",
simulationOptions = "startTime = 0.0, stopTime = 10.0, numberOfIntervals = 10, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'petrou', storeInTemp = false, noClean = false, options = '', outputFormat = 'csv', variableFilter = '.*', measureTime = false, cflags = ''",
messages = "",
timeFrontend = 0.045258585014792,
timeBackend = 0.116084451792839,
timeSimCode = 0.0164164769151113,
timeTemplates = 0.0333903710789758,
timeCompile = 2.20739848211588,
timeSimulation = 0.0628626532368119,
timeTotal = 2.48147184330724
end SimulationResult;
""
"\"time\",\"x[1]\",\"x[2]\",\"x[3]\",\"x[4]\",\"x[5]\",\"x[6]\",\"x[7]\",\"x[8]\",\"x[9]\",\"x[10]\",\"x[11]\",\"x[12]\",\"x[13]\",\"x[14]\",\"der(x[1])\",\"der(x[2])\",\"der(x[3])\",\"der(x[4])\",\"der(x[5])\",\"der(x[6])\",\"der(x[7])\",\"der(x[8])\",\"der(x[9])\",\"der(x[10])\",\"der(x[11])\",\"der(x[12])\",\"der(x[13])\",\"der(x[14])\",\"v[1]\",\"v[2]\",\"v[3]\",\"v[4]\",\"i\",
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,441,441,441,441,441,441,441,441,441,441,441,441,441,441,10.5,10.5,10.5,10.5,1,
1,441.0000000000002,441.0000000000002,441.0000000000002,441.0000000000002,441.0000000000002,441.0000000000002,441.0000000000002,441.0000000000002,441.0000000000002,441.0000000000002,441.0000000000002,441.0000000000002,441.0000000000002,441.0000000000002,441,441,441,441,441,441,441,441,441,441,441,441,441,441,10.5,10.5,10.5,10.5,1,
2,882.0000000000002,882.0000000000002,882.0000000000002,882.0000000000002,882.0000000000002,882.0000000000002,882.0000000000002,882.0000000000002,882.0000000000002,882.0000000000002,882.0000000000002,882.0000000000002,882.0000000000002,882.0000000000002,441,441,441,441,441,441,441,441,441,441,441,441,441,441,10.5,10.5,10.5,10.5,1,
3,1323,1323,1323,1323,1323,1323,1323,1323,1323,1323,1323,1323,1323,1323,441,441,441,441,441,441,441,441,441,441,441,441,441,441,10.5,10.5,10.5,10.5,1,
4,1764,1764,1764,1764,1764,1764,1764,1764,1764,1764,1764,1764,1764,1764,441,441,441,441,441,441,441,441,441,441,441,441,441,441,10.5,10.5,10.5,10.5,1,
5,2205,2205,2205,2205,2205,2205,2205,2205,2205,2205,2205,2205,2205,2205,441,441,441,441,441,441,441,441,441,441,441,441,441,441,10.5,10.5,10.5,10.5,1,
6,2646,2646,2646,2646,2646,2646,2646,2646,2646,2646,2646,2646,2646,2646,441,441,441,441,441,441,441,441,441,441,441,441,441,441,10.5,10.5,10.5,10.5,1,
7,3087.000000000001,3087.000000000001,3087.000000000001,3087.000000000001,3087.000000000001,3087.000000000001,3087.000000000001,3087.000000000001,3087.000000000001,3087.000000000001,3087.000000000001,3087.000000000001,3087.000000000001,3087.000000000001,441,441,441,441,441,441,441,441,441,441,441,441,441,441,10.5,10.5,10.5,10.5,1,
8,3528.000000000001,3528.000000000001,3528.000000000001,3528.000000000001,3528.000000000001,3528.000000000001,3528.000000000001,3528.000000000001,3528.000000000001,3528.000000000001,3528.000000000001,3528.000000000001,3528.000000000001,3528.000000000001,441,441,441,441,441,441,441,441,441,441,441,441,441,441,10.5,10.5,10.5,10.5,1,
9,3969.000000000001,3969.000000000001,3969.000000000001,3969.000000000001,3969.000000000001,3969.000000000001,3969.000000000001,3969.000000000001,3969.000000000001,3969.000000000001,3969.000000000001,3969.000000000001,3969.000000000001,3969.000000000001,441,441,441,441,441,441,441,441,441,441,441,441,441,441,10.5,10.5,10.5,10.5,1,
10,4410,4410,4410,4410,4410,4410,4410,4410,4410,4410,4410,4410,4410,4410,441,441,441,441,441,441,441,441,441,441,441,441,441,441,10.5,10.5,10.5,10.5,1,
"
""
Cheers,
Adrian Pop/
No, that's the Subversion URL.
See if you don't have some other version in your path or in your configure.
Cheers,
Adrian Pop/
Now the libraries are directly in subversion, i.e.:
https://openmodelica.org/svn/OpenModeli … /libraries
Cheers,
Adrian Pop/
Hi,
It depends on how you want to specify the different u, via an external function call, via a parameter matrix, etc.
You can use a when equation with sample (for example):
when sample(0, 1) /* start at 0 and generate events at each of 1, 2, 3, etc */ then
index = index + 1;
reinit(u, differentU[index]); // note that you need to have enough columns in differentU for all the sample events you get during the simulation.
end when;
You can then use
simulate(Model, stopTime=10, numberOfIntervals=10);
plot({u[1],x[1],u[2],x[2]}); // here you can add all 14.
Cheers,
Adrian Pop/
You will need to update your rml to the latest revision.
Cheers,
Adrian Pop/
This might be also due to constant evaluation (function with constant input are evaluated at compile time, either via interpretation or via dll loading).
You might get better results if you use:
omc +d=nogen,noevalfunc script.mos
which will turn of function evaluation at compile time.
Cheers,
Adrian Pop/
Is not possible to downgrade OMEdit.
It might work if you load the library in Dymola (version 7.x) and do a conversion to Modelica 3.1. However, the result might not be usable.
Cheers,
Adrian Pop/
Hi,
Try using the nightly build:
http://build.openmodelica.org/omc/build … ly-builds/
Cheers,
Adrian Pop/
Hi,
I think you may have only stopped omc.exe and not the actual simulation.
Look in your task manager for any executable LRUCS and stop it.
We run a simulation as: Model.exe > output.log
so Model.exe has the hold on output.log file.
The safest way would be to restart your system, that would stop any
executable holding output.log.
Cheers,
Adrian Pop/
A new build is up that fixes this issue:
http://build.openmodelica.org/omc/build … ly-builds/
Cheers,
Adrian Pop/
You're doing nothing wrong. We had a name collision between our own dgesv_ and the one in Marices.LAPACK.
I now (hopefully) solved it in a new build:
http://build.openmodelica.org/omc/build … ly-builds/
Cheers,
Adrian Pop/
You can disregard my last relpy, it seems 10^(-5) is still 0 in when calling R_th_cap from inside Prullefunctie even with +d=nogen,noevalfunc.
Cheers,
Adrian Pop/
In the meantime, you could use:
omc +d=nogen,noevalfunc simulation.mos
This will disable function evaluation (by interpretation or via a .dll).
Cheers,
Adrian Pop/
Seems this was a bug that we fixed a while back.
With the current trunk I get this:
Code:
adrpo@ida-liu050 ~/dev/OpenModelicaBackend/build/bin/ruben
$ ../omc Simple.mo
function Prullefunctie
output Real[2] c;
protected Real[2] b;
algorithm
for i in 1:2 loop
b[i] := 23.916006983474;
end for;
c := {b[1],b[2]};
end Prullefunctie;
function R_th_cap
input Real m;
input Real cp;
output Real R_th;
algorithm
R_th := 1.0 / (cp * m);
end R_th_cap;
class Simple_case4
Real answer[1];
Real answer[2];
equation
answer[1] = 23.916006983474;
answer[2] = 23.916006983474;
end Simple_case4;
I'll try to make a new nighly-build later today that should fix this issue.
I'll let you know when is available.
Cheers,
Adrian Pop/
Hi,
It depends on your model. You could have an if and return 0 from the function if any of the cp or m are zero.
It seems you also have negative indexes in arrays, so you could also have a look there.
I could probably tell you more if you post the entire model (if is possible, i mean public).
If the model is not public you could send it to me via email (Adrian <dot> Pop <at> liu.se) and I can have a look and maybe I could tell you more.
Cheers,
Adrian Pop/
If your function has constant parameters it will be build into a dll during model compilation.
You can use +d=nogen to force not to generate the function during model compilation.
Cheers,
Adrian Pop/
Hi,
https://openmodelica.org/svn/OpenModelica/trunk
user: anonymous
pass: none <--- write none here
You're about 600 revisions short
Cheers,
Adrian Pop/
There is yet another way to change parameters and that's in the init file directly.
So you just say buildModel(MyModel) instead of simulate and that will generate
MyModel.exe and MyModel_init.txt. You can read MyModel_init.txt and write it back
with the same name or a different name (say MyModel_init.changeSet1.txt) and
with different parameters, then just call MyModel.exe -f MyModel_init.changeSet1.txt
and it will read the new parameters/start value from the new init file.
This will make things much faster because simulate instantiates, generates code
and compiles from scratch.
However note that in the current /trunk we changed the Model_init.txt file to Model_init.xml
and with a different format, so if you choose this method you will have to adapt it later on
when we make a new release or nightly build.
Cheers,
Adrian Pop/
You could also say list() to list the entire Abstract Syntax Tree or list(Path.ClassName) to see just parts of it.
That will dump the actual Modelica code (including the modifications you did to the parameters/variables).
For example:
list(MyModel);
You can also create the model on the fly using the available API, i.e:
createModel(MyModel);
addComponent(name, Type, MyModel);
setComponentModiferValue(...);
...
Then simulate and read variables at any timeValue.
simulate(MyModel);
val(var, timeValue);
Cheers,
Adrian Pop/
Hi,
You don't need to make Modelica.Blocks.Continuous.PI a parameter, in fact it *should not*
be a parameter as that would mean that ALL components inside it become parameters.
However, component k inside it it is a parameter already so you can change its value.
You can also change start values of variables if you want/need to via:
setComponentModifierValue(MyModel, PIctrl.x.start, $Code(=4));
See more examples of commands in:
https://openmodelica.org/svn/OpenModeli … teractive/ (all *.mos/*.mo files)
username: anonymous
pass: none <-- write none here.
See at least files:
interactive_api_param.mos
interactive_api_attributes.mos
Cheers,
Adrian Pop/
Hi,
This is possible. Read the user and system manuals.
Basically you start OMC from Java with +d=interactiveCorba (see here: http://www.ida.liu.se/~adrpo/omc/corba/_java/ for a client) .
Then you:
1. load your model
2. send setParameterValue commands to omc to change parameters
3. simulate (maybe you would like to simulate using outputFormat = "csv" so you can read the values easier)
4. search for the Model_res.csv file, read the values
5. calculate the sum of errors
6. go to step 2 and repeat until you're done
Alternatively you can see how is done in the OMOptim client (OpenModelica SVN) which is C++, but you
can get the idea.
Cheers,
Adrian Pop/
Hi,
The problem seems to be that you're trying to simulate from MTD Eclipse.
By default, MDT starts omc with +g=MetaModelica, see in Eclipse: Window->Preferences->Modelica.
The +g=MetaModelica flag tells the compiler to support MetaModelica and because of that the
code generation and compilation is done a bit different.
I suggest you remove +g=MetaModelica from Window->Preferences->Modelica tab, restart Eclipse
and try to simulate again again. Alternatively you can load your model inside OMEdit or OMShell and
simulate it there.
Cheers,
Adrian Pop/
There is an OMEdit wishlist here:
https://openmodelica.ida.liu.se/svn/Ope … oc/OMEdit/
user: anonymous
pass: none <-- write none here
We will add your things to it, but maybe will also be better to add a task or a bug with this things to the tracker.
"Long way off" I assume would be about half a year to get omc to handle the c-like comments.
We are working on doing minimal refactoring (keep everything in place and only add or replace
what is changed, such as adding components, etc) and we already build a prototype that works
but we still have to work on performance.
All the other suggestions besides C-like comment preserving should be rather easy to support
until September. However, note that we do not have so many resources as commercial companies
so things move more slowly (is expected from an open-source project). Also, OMEdit is a rather new
project (started half a year ago) which is already promising but we're working on further improving it.
Cheers,
Adrian Pop/
Hi,
Note that you *cannot* build (compile) Modelica models from MDT. You can only use it to edit Modelica text.
Also the features such as code completion does not work if you don't have OpenModelica
installed as all the information required is obtain via connection to the omc compiler.
If you want to build (compile) and simulate models I suggest you use OMEdit or OMShell.
Cheers,
Adrian Pop/
Hi,
I'm glad you fixed the issue.
You can use OMEdit to simulate/plot.
Otherwise in OMShell you use plot({x, y}).
See more in User's Manual in OpenModelica documentation.
Cheers,
Adrian Pop/
Hm, it seems like Visual Studio 2010 runtime is missing from your computer. Try to install it from this link:
http://www.microsoft.com/downloads/en/d … bf0912db84
I'll try to include the required dlls in the next build.
Question: what system are you on? Windows Xp, 7?
Cheers,
Adrian Pop/
Hi,
This was a bug that was fixed recently and it will be present in the next nightly build.
I'll try to make a build available this week.
Cheers,
Adrian Pop/
Hi,
Yes. Uninstall OpenModelica 1.6.0.
Remove environment variables (The ones you can find):
OPENMODELICAHOME, OPENMODELICALIBRARY, DRMODELICAHOME, PTII.
Then re-install OpenModelica 1.6.0, logoff/logon or restart and then it should work fine.
Cheers,
Adrian Pop/
This is not yet supported by OpenModelica. You would need an language extension, similar to Optimica, see:
http://www.JModelica.org.
We do plan to add something like this to OpenModelica, but it will be in the future.
Cheers,
Adrian Pop/
Why not OpenModelica 1.6.0? I think the hold issue was present in 1.5.0.
As far as I remember it works fine in 1.6.0.
Cheers,
Adrian Pop/
Where is the Rocket class? You need that too.
What OpenModelica version/revision are you using?
Cheers,
Adrian Pop/
I don't know how is on Mac, but the plotting is done by OMPlotWindow which is started by the simulation runtime.
Maybe OPENMODELICAHOME is wrong or so, probably Martin can tell you more.
You could use plot2/plotParametric2 instead, which is based on Java and should work fine.
Cheers,
Adrian Pop/
Found it and fixed it in revision 7905. Thanks for pointing it out.
Cheers,
Adrian Pop/
What page? I can fix it myself so at next build we can have a correct version.
You can report bugs/errors in these places:
- here on the forum
- in our Bug tracker:
https://openmodelica.org:8443/cb/proj/t … acker_id=1
- via email to openmodelica@ida.liu.se
Cheers,
Adrian Pop/
Also, note that correct is:
simulate(Model, startTime=0, stopTime=0)
not with start/end.
Cheers,
Adrian Pop/
You need to set the working directory where the executable should start.
In this working directory the _init.txt file should be present!
See here how to set the working directory:
http://stackoverflow.com/questions/1149 … -directory
Note that there might be additional issues if the process (the .exe) generates
output on standard output or on standard error (these streams needs to be processes).
Cheers,
Adrian Pop/
Read the System Documentation. There are several ways of doing this with OMC:
1. via command line:
omc script.mos
2. via corba
runScript("script.mos");
Cheers,
Adrian Pop/
A build of revision 5424 is uploading now:
http://build.openmodelica.org/omc/build … ses/1.6.0/
Cheers,
Adrian Pop/
Hi,
I don't think you can use SimForge yet with 1.6.
Some of the communication API has changed in OMC and SimForge needs to be updated.
The project is still active but it updates are rather slow.
You cannot fix this (unless you download SimForge and change the code to work with
the new API changes in OMC).
Cheers,
Adrian Pop/
Hi,
doc was moved in 1.6.0 into
C:\OpenModelica1.6.0\share\doc\omc.
zip is gone but the libraries are in
C:\OpenModelica1.6.0\lib\omc\omlibrary
This is to make the installation directory more portable Windows/Linux.
About the 2908 'component cannot be registered' i don't know, it works perfectly fine for us.
It might be that you have some problems with one of your installs. Can you uninstall and re-install OpenModelica?
Cheers,
Adrian Pop/
- Index
- » Users
- » adrpo
- » Profile