-
Notifications
You must be signed in to change notification settings - Fork 5
/
load.mos
37 lines (30 loc) · 1.29 KB
/
load.mos
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Script to load the QCalc library in Dymola, with custom settings
// ------------
// Settings
// ------------
// Options to (possibly) increase simulation performance
// The settings below are all the non-default ones. Comment the lines to use
// the defaults.
Advanced.ImprovedPackageConstants := true "Improved code generation for package constants";
// ------------
// Startup
// ------------
// Load the QCalc package.
openModel("QCalc/package.mo");
cd("..");
// Establish the unit system.
QCalc.Units.setup();
// Work in the directory above this package.
cd("..")
// Don't check the unit consistency of equations. The "unit" attribute is
// used to denote the dimension (see QCalc.Quantities), and Dymola doesn't
// recognize its symbols.
Advanced.CheckUnits := false;
// Save a static, translated copy of the values of all the constants and units.
// The constants and units will also be available in the workspace, but only
// until the next model is simulated. To load the and retain the variables
// until Dymola is closed, translate a model besides QCalc.Units.Evaluate and
// then run "units.mos" as a script.
Advanced.OutputModelicaCode := true "Output dsmodel in Modelica style";
translateModel("QCalc.Units.Examples.Evaluate");
Modelica.Utilities.Files.copy("dsmodel.mof", "units.mos", true);