Skip to content

Commit

Permalink
ticket:3888 - add new example
Browse files Browse the repository at this point in the history
  • Loading branch information
jhag authored and OpenModelica-Hudson committed May 3, 2016
1 parent 617816f commit 3912e00
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions simulation/modelica/unitcheck/UnitCheck16.mos
@@ -0,0 +1,34 @@
// name: UnitCheck16
// keywords: initialization
// status: correct

loadString("
model test
Real x(fixed=true, start=1);
equation
der(x) = time;
end test;
"); getErrorString();
setCommandLineOptions("--preOptModules+=unitChecking -d=dumpUnits"); getErrorString();
simulate(test); getErrorString();


// Result:
// true
// ""
// true
// ""
// #####################################
// HashTable:
// {x,{MASTER(x)}}
// HashTable:
// {x,{1.0 * s^(2)}}
// ######## UnitCheck COMPLETED ########
// record SimulationResult
// resultFile = "test_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'test', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// messages = ""
// end SimulationResult;
// "Notification: "x" has the Unit "s2"
// "
// endResult

0 comments on commit 3912e00

Please sign in to comment.