- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Plotting in OMShell
Plotting in OMShell
Plotting in OMShell
Hi everyone,
I have an issue with plotting in OMShell. I try to run the example of the "dc.motor" that is explained in the user guide. Everything goes smoothly until I reach the plot part. When I type in the command "plot ({load.phi,load.w})", I get a message that shows:
{"_omc_PlotResult","C:/Users/mshushku/AppData/Local/Temp/OpenModelica/dcmotor_res.mat","","true","plot","false","false","time","","0.0","0.0","0.0","0.0","1.0","1","top","load.phi","load.w"}.
For some reason the graph does not show up as it is suppose to. I can get the graph by going to OMEdit and open the result of the plot from there however I want to get the plot in OMShell. Could you please suggest me how to achieve this?
Re: Plotting in OMShell
If you get a message from plot command it means your plot command is silent. You need to enable it,
Code:
setPlotSilent(false)
Adeel.
- adeas
- 454 Posts
Re: Plotting in OMShell
https://build.openmodelica.org/Document … pting.html or read the help-text through help() (basically telling you to open OpenModelica.Scripting in OMEdit).
Note that the silent plotting is usually not enabled. You have to explicitly do it yourself. For example by sharing a session with OMNotebook...
- sjoelund.se
- 1700 Posts
Re: Plotting in OMShell
Thanks for the help.
I also wanted to inquire regardiong OM crashing whilst I am trying to save a model. This means I need to kill the file and start everything from the beginning. I am using OM on Windows and the version that I am using is OM-1.9.0-rwevision-17628.
I am not sure if there is a newer version that I can use?
Re: Plotting in OMShell
These ones are more recent:
https://build.openmodelica.org/omc/buil … 9.1/beta1/
https://build.openmodelica.org/omc/buil … ly-builds/
- sjoelund.se
- 1700 Posts
Re: Plotting in OMShell
We don't keep statistics on test coverage on Windows. It's a too minor platform The Linux tests for both of them are 100% (of the tested models).
I recommend the nightly builds unless you need to use a stable version for education or similar.
- sjoelund.se
- 1700 Posts
Re: Plotting in OMShell
Hi sjoelund.se
I wanted to ask if OpenModelica allows you to perform calculations with variables which are not the same in SI units. I wrote a simple code and tested it. Usually in C++ if there is a mismatch between variables units the compiler does not compile the code and outputs an error.
"
type Voltage=Real(unit="V");
type Current=Real(unit="A");
class testing
parameter Voltage v=13;
Current i;
equation
i=6*v;
end testing;
simulate(testing)
record SimulationResult
resultFile = "testing_res.mat",
messages = ""
end SimulationResult;
"
Re: Plotting in OMShell
In OpenModelica, we never do unit checking.
Some other tools also does not do unit checking by default (checkModel() command or similar in these tools will do unit checking).
- sjoelund.se
- 1700 Posts
Re: Plotting in OMShell
Hi sjoelund.se
I am a bit confused regarding the access control by prefixes. In Example 3.4 in Dr.Modelica I have this code:
class AccessDemo
parameter Real a = 2;
public Real x, z;
parameter Real y (fixed=true);
protected
parameter Real w (fixed=true), u(fixed=true);
Real u2;
public Real u3;
equation
x = 2;
z = 5;
u2 = 5;
u3 = 8;
end AccessDemo;
Then I create an instance of this class and try to give values to protected variables in the class AccessDemo by writing:
class inherited
AccessDemo ad(w=23, u=3);
end inherited;
I try and simulate the code and plot the values of "w" and "u" and get the desired values. However in the comments in the example it says this can not be performed (even though I did manage to get the values) since AccessDemo it is not inherited. Is the code above is valid and does this means that there is a typing mistake in Dr. Modelica?
Thanks in advance.
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Plotting in OMShell