- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » omc enable unit consistency check
Page Start Prev 1 Next End
omc enable unit consistency check
omc enable unit consistency check
Mar-01-16 12:58:54
Hi all,
I want to enable warnings about unit mismatches (dimentionality) on modelica code. Here is the test code I mis-formulated on purpose:
Code:
class test
Real v(final unit="V");
Real i(final unit="A");
parameter Real r(start = 120, final unit="Ohm");
equation
v = i * i * r;
v = sin(time);
end test;
Here is the script I used for compiling:
Code:
loadModel(Modelica);
loadFile("test.mo");
simulate(test, stopTime=10);
plot(i);
I compile the code above with the following command:
Code:
omc t.mos --debug=dumpEqInUC --debug=dumpEqUCStruct --debug=dumpUnits
But there is no warning about units. How to enable unit check? Thanks.
omc version: 1.9.3+dev (r25940)
Edited by: semicolon - Mar-01-16 12:59:14
Re: omc enable unit consistency check
Mar-01-16 13:12:56
Add the following line to script,
Code:
setCommandLineOptions("--preOptModules+=unitChecking");
Adeel.
- adeas
- 454 Posts
Re: omc enable unit consistency check
Mar-01-16 13:14:47
(I think the 1.9.3 pre-release did not support preOptModules+=xxx.)
- sjoelund.se
- 1700 Posts
Re: omc enable unit consistency check
Mar-01-16 13:46:19
Did you see the readme that said the repository has moved to git?
- sjoelund.se
- 1700 Posts
Page Start Prev 1 Next End
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » omc enable unit consistency check
There are 0 guests and 0 other users also viewing this topic