- Index
- » Users
- » adeas
- » Profile
Posts
Hi Lorenzo,
If you want to use the commands then use OMShell. In OMShell first type in your model or load a model file,
Code:
class HelloWorld
Real x(start=1);
parameter Real a = 1;
equation
der(x)=-a*x;
end HelloWorld;
Then send the simulate command,
Code:
simulate(HelloWorld)
and then plot,
Code:
plot(x)
OMEdit allows users to use the GUI to performs these commands. You can create you model and then you can click on simulate button to simulate the model rather than typing the simulate command.
Adeel.
Hi,
Its not possible to increase or decrease the size of the canvas. Modelica does support it using the coordinate annotation,
Code:
annotation (Diagram(coordinateSystem(extent={{-100,-100}, {100,100}}));
but currently this is not implemented in OMEdit.
However, you can zoom-out a bit to get more space (but thats ofcourse not a very good solution).
Adeel.
Hi,
We use mingw for compilation. If you want to use visual studio 2010 you should compile everything from scratch which i suppose you are doing. You must build OMPlot.lib before building OMEdit and link it with OMEdit.
You can also try to remove the --enable-auto-import flag. I guess its just a gcc flag.
Adeel.
Hi,
No Its not needed. Just put your library in some appropriate path as mentioned by Martin. For example, if you put your library in,
Code:
/opt/local/lib/omlibrary/ThermoPower/package.mo
then in OMEdit you add a new library in libraries list under Tools->options with name ThermoPower and value default.
Adeel.
Hi,
Add your library to the libraries list of OMEdit. Tools->Options->libraries. Restart OMEdit. Now OMEdit always load your library automatically.
Adeel.
Hi lepokorp,
I have now fixed it in r(10996). Scrollbars are added.
Adeel.
This is now fixed in r10942.
Hi Lewis,
Is this happening with all the models? I have recently changed few things about OMEdit simulation functionality which seems to work fine on my windows machine perhaps that functionality is not working on Linux.
Can you share your model?
Adeel.
Removing the last semicolon will print the output for sure but there are some more problems with your script. Like,
- You should add loadModel(Modelica) as the first command in your script file. Since you are using Modelica Standard Library models.
- Change loadModel(pendulum.mo) to loadFile("pendulum.mo").
Adeel.
The simulation of Modelica.Electrical.Analog.Examples.Rectifier is crashing and OMEdit doesn't check whether the executable was crashed or not. I have now fixed it in OMEdit so that it will show the error message if the simulation executable fails. You have to wait for the new nightly build now.
Adeel.
OK. Then i will also need the log file. Please attach your omeditcommands.log file. You can find it in <your_temp_dir/OpenModelica/OMEdit>
Adeel.
Hi,
It seems like you are using OMEdit. Can you check the messages window at the bottom and see if any error recorded there?
You can send an email with attachment to openmodelicadevelopers@ida.liu.se
Adeel.
What kind of modifications do you have in your custom annotations?
For non flattened annotations you can use,
- getAnnotationCount(M1) // returns the annotation count e.g 2
- getNthAnnotationString(M1, 1) // returns the Nth annotation as a string.
But it only works for classes, it doesn't give you components annotations.
Adeel.
Ok. I have found the bug. I will try to fix it ASAP.
Adeel.
I have tried to create your model again in OMEdit from scratch and everything works fine for me. I am also using Windows 7 with OpenModelica 1.8.0 (r10637).
I don't get any wrong indexing. I suppose it is a bug but i am unable to created it on my end.
Deleting a component deletes all the connections associated with it. But if your connection is wrong like the one with wrong indexing that will not be deleted.
I unable to simualte your model it throws compilation errors.
here is the code that is generated using OMEdit,
model ipfc
Modelica.Electrical.Analog.Sources.SineVoltage Source(V = 230, freqHz = 50) annotation(Placement(visible = true, transformation(origin = {-84.8263,-2.55944}, extent = {{-12,12},{12,-12}}, rotation = -90)));
Modelica.Electrical.Analog.Ideal.IdealDiode D2(Ron = 0.001, Goff = 0.001, Vknee = 2) annotation(Placement(visible = true, transformation(origin = {-36.1975,-56.3071}, extent = {{12,-12},{-12,12}}, rotation = -270)));
Modelica.Electrical.Analog.Ideal.IdealDiode D1(Ron = 0.001, Goff = 0.001, Vknee = 2) annotation(Placement(visible = true, transformation(origin = {-39.4882,20.8409}, extent = {{12,-12},{-12,12}}, rotation = -270)));
Modelica.Electrical.Analog.Ideal.IdealDiode D4(Ron = 0.001, Goff = 0.001, Vknee = 2) annotation(Placement(visible = true, transformation(origin = {6.58132,-55.5759}, extent = {{12,-12},{-12,12}}, rotation = -270)));
Modelica.Electrical.Analog.Basic.Capacitor Cbus(C = 0.01) annotation(Placement(visible = true, transformation(origin = {36.5631,-13.894}, extent = {{-12,12},{12,-12}}, rotation = -90)));
Modelica.Electrical.Analog.Basic.Resistor Rload(R = 5) annotation(Placement(visible = true, transformation(origin = {81.17,-13.1627}, extent = {{-12,12},{12,-12}}, rotation = -90)));
Modelica.Electrical.Analog.Ideal.IdealDiode D3(Ron = 0.001, Goff = 0.001, Vknee = 2) annotation(Placement(visible = true, transformation(origin = {3.65631,21.2066}, extent = {{12,-12},{-12,12}}, rotation = -270)));
Modelica.Electrical.Analog.Basic.Inductor inductor1 annotation(Placement(visible = true, transformation(origin = {-71.298,58.5009}, extent = {{-12,-12},{12,12}}, rotation = 0)));
Modelica.Electrical.Analog.Basic.Ground ground2 annotation(Placement(visible = true, transformation(origin = {-81.9013,-62.1572}, extent = {{-12,-12},{12,12}}, rotation = 0)));
equation
connect(Source.n,ground2.p) annotation(Line(points = {{-84.8263,-14.5594},{-81.9013,-14.5594},{-81.9013,-50.1572},{-81.9013,-50.1572}}));
connect(D3.n,Cbus.p) annotation(Line(points = {{3.65631,33.2066},{36.5631,33.2066},{36.5631,-1.894},{36.5631,-1.894}}));
connect(Cbus.p,Rload.p) annotation(Line(points = {{36.5631,-1.894},{81.17,-1.894},{81.17,-1.16273},{81.17,-1.16273}}));
connect(Cbus.n,Rload.n) annotation(Line(points = {{36.5631,-25.894},{81.5356,-25.894},{81.5356,-25.1627},{81.17,-25.1627}}));
connect(Source.n,D4.n) annotation(Line(points = {{-84.8263,-14.5594},{-12.0658,-14.5594},{-12.0658,-43.5101},{6.58132,-43.5101},{6.58132,-43.5759}}));
connect(D2.p,D4.p) annotation(Line(points = {{-36.1975,-68.3071},{6.58135,-68.3071},{6.58135,-67.5759},{6.58132,-67.5759}}));
connect(D4.p,Cbus.n) annotation(Line(points = {{6.58132,-67.5759},{36.1974,-67.5759},{36.1974,-25.894},{36.5631,-25.894}}));
connect(Source.p,D1.p) annotation(Line(points = {{-84.8263,9.44056},{-39.1225,9.44056},{-39.1225,8.84094},{-39.4882,8.84094}}));
connect(D3.p,D4.n) annotation(Line(points = {{3.65631,9.20663},{6.94698,9.20663},{6.94698,-43.5759},{6.58132,-43.5759}}));
connect(D1.n,D3.n) annotation(Line(points = {{-39.4882,32.8409},{4.02194,32.8409},{4.02194,33.2066},{3.65631,33.2066}}));
connect(D1.p,D2.n) annotation(Line(points = {{-39.4882,8.84094},{-36.1974,8.84094},{-36.1974,-44.3071},{-36.1975,-44.3071}}));
end ipfc;
Adeel.
Hi Peter,
Your model is pretty strange because if you have created it in OMEdit why it is missing all the annotations that are heart of OMEdit. Also your connection equation shows wrong indexing as well e.g connect(D3.n[-1],Cbus.p[-1]) , since D3.n is not an array Cbus.p is also not an array so it should be connect(D3.n,Cbus.p).
Can you explain how you build your model? Which platform you are using. Wrong indexing problem is known bug on linux.
Adeel.
Hi,
The file is created in the working folder of OMC. The easiest way to find out that folder is,
Go to Tools->OMC Logger and then send command cd(). It will print the current working directory.
Adeel.
OK then OMEdit will always delete it because it is defined as Modelica.Fluid.............
open the package.mo file and remove the first line that says
within Modelica;
but this change makes this library almost unusable beacuse everything is linked from Modelica pacakge.
Adeel.
Hi,
Your Fluid folder should contain a file package.mo that defines your library structure. Otherwise OMC can't read it. And makesure you restart OMEdit after adding the library in options page.
Adeel.
Hi,
Not sure what is causing the segmentation fault. I will look into this problem soon. Also it looks like you are using interactive simulation. Try to use static simulation.
Adeel.
Hi,
Can you explain more about the problem? Does the simulation fails? Or you are not able to plot variables? Or you get an empty Plot window? We need more information.
Adeel.
Compile OMPlot. OMPlot is located at /OpenModelica/OMPlot/OMPlotGUI. You need to compile a lib so use the OMPlotLib.pro. Put the generated libOMPlot in the bin directory of OMPlot.
Adeel.
You need Mingw based Qt since the OmniORB you find out in OMDEV is build using Mingw.
OR
Build your own OmniORB using MSVC (if you really want to use it).
Adeel.
Hi,
Can you make sure your OMDEV environment variable is set up properly? Also i would like to know how you are compiling the project. Mingw is provided by QT so you should not get error for any Mingw header files.
Adeel.
Your generated file omc_communication.h line 6 should be,
#include <omniORB4/CORBA.h>
your error indicates that it is,
#include <CORBA.h>
Try this command it will create correct files with appropriate extensions,
omniidl.exe -bcxx -Wbh=.h -Wbs=.cc omc_communication.idl
Adeel.
Hi,
You need to built omc_communication.cc again using the omniidl.exe. I guess the one located in /OpenModelica/Compiler/runtime is build using mico. The omniidl.exe is located at '\OMDev\lib\omniORB-4.1.4-mingw\bin\x86_win32\omniidl.exe'. You need to give idl file to omniidl.exe and the idl file is located here, '\OpenModelica\Compiler\runtime\omc_communication.idl'
Adeel.
The type "transalation" was already fixed
Adeel.
Hi,
"MyModel.exe -f MyModel_init.txt" is wrong. AFAIK this file not generated any more, instead an xml file is generated but with the same name. Create a bug report for it.
Using WaitFor() is not recommended because it normally hangs the interface (but thats just an implementation issue).
Adeel.
Its fixed in r10125.
Adeel.
Fritz,
I guess you are Windows user. That problem was fixed but you have to wait for the new release/nightly build.
Adeel.
This feature is available in both MDT and OMEdit, in MDT its called component browser and in OMEdit its called Model Browser.
Adeel.
Hi
This is fixed in revision 9896. Update your OMEdit.
If you still get the same problem then try to change the tmp path. Go to Tools->OMCLogger and then send this command,
cd("your_temp_path")
Adeel.
Yes, do it please.
Adeel.
This bug was already reported but i haven't get time to fix it.
You can look into the TextAnnotation.cpp file which is responsible for drawing the text.
Adeel.
Check revision 9619.
Fixed in revision 9616.
Adeel.
Fixed in Revision 9507.
Adeel.
Can you post some more details? Which platform you are using and how you are trying to build from sources?
Adeel.
Hi,
The Motorcycle dynamic library is built using Modelica annotations 2.2.1 and OMEdit supports Modelica annotations 3.x. You can add the library and its components but you can't see them graphically.
Adeel.
The solver name is changed from runge-kutta to rungekutta but its not updated in OMEdit. This will be fixed in next nightly build.
Adeel.
Hi james,
I tried it and it looks like its not possible to start or end the connection on connector type components. I will try to fix it ASAP. Can you report this bug in the bug tracker?
Adeel.
Hi,
It looks like your model crashes the omc. Can you send your model?
Adeel.
Hi Alex,
OpenModelica does not support code indentation and comments structuring.
But this feature will be available soon. So that you can preserve your comments.
Adeel.
Hi Lisa,
There are some problems with OMI in OMEdit. We are working on them to fix it.
OMEdit does not send parameters change to OMI which is a bug. It will be soon fixed.
Adeel.
But try running directly OMNotebook.exe instead of opening some file with it.
Adeel.
This error is fixed. Hopefully a new release of OpenModelica is available tomorrow.
Adeel.
Hi Christian,
The missing menu entries are enabled back. Try the new revision 8259.
Regards,
Adeel.
Hi Christian,
That is my mistake. I have disabled that feature by mistake.
I will let you know once its enabled again.
Adeel.
Try the new nighly build http://build.openmodelica.org/omc/build … y-builds/. This problem is solved now,
I tried your code and it works fine,
- Run OMEdit create a package Package0
- Then go to Modelica Text view select All and replace it with your text.
- Save the package.
- Clode OMEdit.
- Start OMEdit again.
- Open your package.
These are the steps i followed.
Regards,
Adeel.
Hi,
You can load your model in OMEdit and plot some graphs.
- Start OMEdit.
- Open the SystemDynamics.mo file from OMEdit
- Go to SImulation->Simulate and then simulate your model.
- You will get the plot variables list on the RHS after the simulation is finished.
- Select/check the variable that you want to plot.
Adeel.
It won't be too hard to implement it. Hopefully i will implement this stuff ASAP. But for now adding the library to Modelica is the only solution.
Adeel.
You can create your own blocks. But in order to use them in the rest of the system. Right now OMEdit doesn't have the interface to include customs models/blocks to the system. So you need to include them through the code by your own.
Adeel.
Can you post your model? It seems as your model crashes the OMC which in turn forces OMEdit to close. That is why you get the message that the connection to the server is lost.
Adeel.
I will check this thing real quick and try to respond to you before this weekend.
Adeel.
- Index
- » Users
- » adeas
- » Profile