-
Notifications
You must be signed in to change notification settings - Fork 298
/
testSteamPipe.mos
60 lines (55 loc) · 2.12 KB
/
testSteamPipe.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// name: testSteamPipe
// keywords: jacobian differentiation linearization
// status: correct
// teardown_command: rm -rf testSteamPipeLin* output.log
//
loadModel(Modelica);getErrorString();
loadFile("./SteamPipe.mo");
loadString("
model testSteamPipeLin
extends SteamPipe(N=2);
end testSteamPipeLin;
");
setCommandLineOptions("--generateSymbolicLinearization");
linearize(testSteamPipeLin, stopTime=0.0);getErrorString();
loadFile("linearized_model.mo");
list(linearized_model);
// Result:
// true
// ""
// true
// true
// true
// record SimulationResult
// resultFile = "testSteamPipeLin_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 0.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'testSteamPipeLin', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// messages = "stdout | info | Linearization will be performed at point of time: 0.000000
// LOG_SUCCESS | info | The initialization finished successfully without homotopy method.
// LOG_SUCCESS | info | The simulation finished successfully.
// stdout | info | Linear model is created.
// "
// end SimulationResult;
// ""
// true
// "model linearized_model \"testSteamPipeLin\"
// parameter Integer n = 4 \"number of states\";
// parameter Integer m = 0 \"number of inputs\";
// parameter Integer p = 0 \"number of outputs\";
// parameter Real x0[n] = {3100000, 3100000, 1000000, 1000000};
// parameter Real u0[m] = zeros(0);
// parameter Real A[n, n] = [0, 0, -7.506579624472663, 7.506579624472661; 0, 0, 7.506579624472663, -15.01315924894532; 0, 0, -27.8910278969507, 27.8910278969507; 0, 0, 27.8910278969507, -55.78205579390141];
// parameter Real B[n, m] = zeros(n, m);
// parameter Real C[p, n] = zeros(p, n);
// parameter Real D[p, m] = zeros(p, m);
// Real x[n](start = x0);
// input Real u[m];
// output Real y[p];
// Real 'x_h[1]' = x[1];
// Real 'x_h[2]' = x[2];
// Real 'x_p[1]' = x[3];
// Real 'x_p[2]' = x[4];
// equation
// der(x) = A * x + B * u;
// y = C * x + D * u;
// end linearized_model;"
// endResult