Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added DrumBoiler as testcase for linearization
- Loading branch information
1 parent
1cd286d
commit 118b3d0
Showing
2 changed files
with
69 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// name: testDrumBoiler | ||
// keywords: jacobian differentiation linearization | ||
// status: correct | ||
// teardown_command: rm -rf testDrumBoilerLin* output.log | ||
// | ||
|
||
loadModel(Modelica);getErrorString(); | ||
loadString(" | ||
model testDrumBoilerLin | ||
extends Modelica.Fluid.Examples.DrumBoiler.DrumBoiler(use_inputs=true); | ||
end testDrumBoilerLin; | ||
"); | ||
|
||
setCommandLineOptions("--generateSymbolicLinearization"); | ||
linearize(testDrumBoilerLin, stopTime=0.0);getErrorString(); | ||
|
||
loadFile("linear_testDrumBoilerLin.mo"); | ||
list(linear_testDrumBoilerLin); | ||
|
||
|
||
// Result: | ||
// true | ||
// "" | ||
// true | ||
// true | ||
// record SimulationResult | ||
// resultFile = "testDrumBoilerLin_res.mat", | ||
// simulationOptions = "startTime = 0.0, stopTime = 0.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'testDrumBoilerLin', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''", | ||
// messages = "stdout | info | Linearization will performed at point of time: 0.000000 | ||
// stdout | info | The initialization finished successfully without homotopy method. | ||
// stdout | info | The simulation finished successfully. | ||
// stdout | info | Linear model is created! | ||
// " | ||
// end SimulationResult; | ||
// "Warning: There are iteration variables with default zero start attribute. For more information set -d=initialization. In OMEdit Tools->Options->Simulation->OMCFlags, in OMNotebook call setCommandLineOptions("-d=initialization"). | ||
// " | ||
// true | ||
// "model linear_testDrumBoilerLin | ||
// parameter Integer n = 3; | ||
// // states | ||
// parameter Integer k = 2; | ||
// // top-level inputs | ||
// parameter Integer l = 4; | ||
// // top-level outputs | ||
// parameter Real x0[3] = {0, 67, 100000}; | ||
// parameter Real u0[2] = {0, 0}; | ||
// parameter Real A[3, 3] = [-0, -0.008333333333333333, -0; 0.01044245597663854, -0.01044245597663854, 1.734723475976807e-18; 0.329426456282044, -0.3294264562820693, -1.265654248072678e-14]; | ||
// parameter Real B[3, 2] = [0, 0; -0.001782707655225083, 0.0003271130816094902; -53.49729114463396, 23.68285223957279]; | ||
// parameter Real C[4, 3] = [0, 0, 0.0001439468903880629; 0, 1, 0; 0, 0, 1e-05; 0, 0, 0]; | ||
// parameter Real D[4, 2] = [0, 0; 0, 0; 0, 0; 1, 0]; | ||
// Real x[3](start = x0); | ||
// input Real u[2](start = u0); | ||
// output Real y[4]; | ||
// Real 'x_controller.x' = x[1]; | ||
// Real 'x_evaporator.V_l' = x[2]; | ||
// Real 'x_evaporator.p' = x[3]; | ||
// Real 'u_Y_Valve' = u[1]; | ||
// Real 'u_q_F' = u[2]; | ||
// Real 'y_T_S' = y[1]; | ||
// Real 'y_V_l' = y[2]; | ||
// Real 'y_p_S' = y[3]; | ||
// Real 'y_qm_S' = y[4]; | ||
// equation | ||
// der(x) = A * x + B * u; | ||
// y = C * x + D * u; | ||
// end linear_testDrumBoilerLin;" | ||
// endResult |