- Index
- » Users
- » Vestal
- » Profile
Posts
Posts
I have an existing textual model to which I would like to add some diagram views. It was straight-forward to add an icon to a class. When I opened the diagram view on a second class that contained an instance of the first class, I expected to see an icon show up, but it didn't. Before I just start drawing diagrams on top of an existing text model, can someone give me a tip or two to help get me started in the right direction of adding graphics to an existing textual model? I want to do this in a way that adds only annotations without making any changes to the definition of the model itself.
I eventually found the solution. In OMEdit, select Simulation, Simulation Setup, Output tab, then check Protected Variables. Check the save experiment and simulation flags at the bottom to have these remembered in the annotation in the model.
Using OMEdit, when I go to the Variables tab in the Plotting tab, I only see what appear to be variables selected as actual state variables for the purposes of solution. How can I plot other declared variables that may not have been selected for direct solution?
// I'm trying to understand how expandable connectors
// work. Hopefully the following simple model gets
// across the idea of what I'd like to do. The comments
// in 'block Obfuscate' show the errors I'm encountering.
// Corrections and suggestions would be appreciated.
package ExpandTest
expandable connector ExCon
input Real ins[:];
output Real outs[:];
//input Real ins; // OK
//output Real outs; // OK
end ExCon;
block Obfuscate
ExCon ex;
equation
// The four choices below will result in
// different error messages as indicated.
// Commands check model, instantiate, then
// simulate were applied in that order (i.e.
// simulate: means it passed checks and instantiated).
//for i in 1:size(ex.ins) loop // check model: fails to elaborate
//for i loop // check model: dimension of ex.outs and ex.ins differ
//for i in 1:size(ex.ins,1) loop // instantiate: range not constant or parameter
for i in 1:1 loop // simulate: internal error createSimCode failed
ex.outs[i] = ex.ins[i];
end for;
//ex.outs = ex.ins; // OK
end Obfuscate;
model Trivial
Real xin (start = 0.0);
Real xout (start = 0.0);
Real der_x (start = 1.0);
Obfuscate io;
equation
connect (xin, io.ex.ins[1]);
connect (xout, io.ex.outs[1]);
//connect (xin, io.ex.ins); // OK
//connect (xout, io.ex.outs); // OK
xin = sin(time);
der_x = der(xout);
end Trivial;
end ExpandTest;
I am using OpenModelica1.11.0-64bit on Windows 7. OMEdit will crash using the examples in the standard MultiBody packages. One way I can reproduce a crash is to simulate with animation DoublePendulum and then try to resize a window in the plotting perspective (or whatever that tab is called). A second way I can crash it is to do successive simulates with animation. The first one after starting OMEdit will work. On the next attempt, it will get through the compile but then crash. (It is this latter behavior that is most annoying, as it prevents iterative simulate then fix model then simulate then ...)
I did push "Send Report" on this a few times (I just did it again after reproducing the last case). I assume the log files got uploaded.
If you point me to the right place in your tracking system, I can move this discussion there.
I am getting the following message. Is this just an obscurely worded error message about the model, or does it mean omc encountered a bug? (The instance file looks OK to me, for what little that's worth.)
[12] 14:52:23 Translation Error
[C:/OM111/OpenModelica64bit/OMCompiler/Compiler/SimCode/SimCodeUtil.mo: 552:5-552:146]: Internal error function createSimCode failed [Transformation from optimised DAE to simulation code structure failed]
Can someone post example commands to put in a mos file to launch the 3D animation/visualization display after a simulation? (I've been using OMEdit, but it crashes frequently when doing a simulate with animation.)
- Index
- » Users
- » Vestal
- » Profile