-
Notifications
You must be signed in to change notification settings - Fork 1
/
model_simulate.mos.template
77 lines (38 loc) · 1.93 KB
/
model_simulate.mos.template
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
cd("PACKAGE_FOLDER");
loadModel(Modelica,{"MODELICA_VERSION"},false,"",false);
loadModel(ModelicaReference,{"MODELICA_VERSION"},false,"",false);
setMatchingAlgorithm("PFPlusExt");
setIndexReductionMethod("dynamicStateSelection");
setCommandLineOptions("-d=initialization");
setCommandLineOptions("--simCodeTarget=C");
setCommandLineOptions("--target=gcc");
DEPENDENCIES
parseFile("PACKAGE_FOLDER/package.mo","UTF-8");
loadFile("PACKAGE_FOLDER/package.mo","UTF-8",true);
cd("RESULT_FOLDER");
clearCommandLineOptions();
setMatchingAlgorithm("PFPlusExt");
setIndexReductionMethod("dynamicStateSelection");
setCommandLineOptions("+simCodeTarget=C");
setCommandLineOptions("+target=gcc");
setCommandLineOptions("-d=initialization");
setCommandLineOptions("+ignoreCommandLineOptionsAnnotation=false");
setCommandLineOptions("+ignoreSimulationFlagsAnnotation=false");
setCommandLineOptions("+profiling=none");
translateModel(MODEL_IN_PACKAGE, startTime=START_TIME, stopTime=STOP_TIME, numberOfIntervals=NUM_INTERVALS, method="dassl", tolerance=TOLERANCE, outputFormat="csv", variableFilter=".*");
errors:=getMessagesStringInternal();
writeFile("RESULT_FOLDER", errors);
buildModel(MODEL_IN_PACKAGE, startTime=START_TIME, stopTime=STOP_TIME, numberOfIntervals=NUM_INTERVALS, method="dassl", tolerance=TOLERANCE, outputFormat="csv", variableFilter=".*");
system("SIMULATION_BINARY");
clearCommandLineOptions();
setMatchingAlgorithm("PFPlusExt");
setIndexReductionMethod("dynamicStateSelection");
setCommandLineOptions("+simCodeTarget=C");
setCommandLineOptions("+target=gcc");
setCommandLineOptions("-d=initialization");
setCommandLineOptions("+ignoreCommandLineOptionsAnnotation=false");
setCommandLineOptions("+ignoreSimulationFlagsAnnotation=false");
cd("PACKAGE_FOLDER");
readSimulationResultSize("RESULT_FOLDER/MODEL_IN_PACKAGE_res.csv");
getErrorString(false);
readSimulationResultVars("RESULT_FOLDER/MODEL_IN_PACKAGE_res.csv",true,false);