Skip to content

Commit

Permalink
-added test for sortEqnsAndVars -expected output
Browse files Browse the repository at this point in the history
  • Loading branch information
vruge committed Jun 22, 2015
1 parent c3be20b commit 14bd6a3
Show file tree
Hide file tree
Showing 4 changed files with 263 additions and 0 deletions.
73 changes: 73 additions & 0 deletions openmodelica/debugDumps/lateInline.mos
Expand Up @@ -1199,6 +1199,79 @@ buildModel(testOptdaedump); getErrorString();
// Constraints (0)
// ========================================
//
//
// pre-optimization module sortEqnsVars:
//
//
// unspecified partition
// ========================================
//
// Variables (2)
// ========================================
// 1: y:VARIABLE() .testOptdaedump, .Real type: Real []
// 2: x:VARIABLE() .testOptdaedump, .Real type: Real []
//
//
// Equations (2, 2)
// ========================================
// 1/1 (1): x = testOptdaedump.f(time) [binding]
// 2/2 (1): y = exp(time ^ 3.0) + x [binding]
//
//
// State Sets
// ========================================
//
//
// no matching
//
//
//
// BackendDAEType: simulation
//
//
// Known Variables (constants) (0)
// ========================================
//
//
// External Objects (0)
// ========================================
//
//
// Classes of External Objects (0)
// ========================================
//
//
// Alias Variables (0)
// ========================================
//
//
// Simple Equations (0, 0)
// ========================================
//
//
// Initial Equations (0, 0)
// ========================================
//
//
// Zero Crossings (0)
// ========================================
//
//
// Relations (0)
// ========================================
//
//
// Time Events (0)
// ========================================
//
//
// When Clauses (0)
// ========================================
//
//
// Constraints (0)
// ========================================
//
// pre-optimization done.
//
// post-optimization module lateInlineFunction:
Expand Down
94 changes: 94 additions & 0 deletions openmodelica/debugDumps/optdaedump.mos
Expand Up @@ -1647,6 +1647,100 @@ buildModel(testOptdaedump); getErrorString();
// Constraints (0)
// ========================================
//
//
// pre-optimization module sortEqnsVars:
//
//
// unspecified partition
// ========================================
//
// Variables (8)
// ========================================
// 1: iC:VARIABLE() .testOptdaedump, .Real type: Real []
// 2: iL:STATE(1)() .testOptdaedump, .Real type: Real []
// 3: i2:VARIABLE() .testOptdaedump, .Real type: Real []
// 4: i1:VARIABLE() .testOptdaedump, .Real type: Real []
// 5: i0:VARIABLE() .testOptdaedump, .Real type: Real []
// 6: uC:STATE(1)() .testOptdaedump, .Real type: Real []
// 7: uL:VARIABLE() .testOptdaedump, .Real type: Real []
// 8: u1:VARIABLE() .testOptdaedump, .Real type: Real []
//
//
// Equations (8, 8)
// ========================================
// 1/1 (1): uC = cos(time) [dynamic]
// 2/2 (1): u1 = R1 * i1 [dynamic]
// 3/3 (1): u1 = uC - uL [dynamic]
// 4/4 (1): uL = R2 * i2 [dynamic]
// 5/5 (1): uL = L * der(iL) [dynamic]
// 6/6 (1): iC = C * der(uC) [dynamic]
// 7/7 (1): i0 = i1 + iC [dynamic]
// 8/8 (1): i1 = i2 + iL [dynamic]
//
//
// State Sets
// ========================================
//
//
// no matching
//
//
//
// BackendDAEType: simulation
//
//
// Known Variables (constants) (5)
// ========================================
// 1: v0:VARIABLE() = 0.0 .testOptdaedump, .Real type: Real []
// 2: R1:PARAM() = 1.0 .testOptdaedump, .Real type: Real []
// 3: R2:PARAM() = 2.0 .testOptdaedump, .Real type: Real []
// 4: L:PARAM() = 0.5 .testOptdaedump, .Real type: Real []
// 5: C:PARAM() = 3.0 .testOptdaedump, .Real type: Real []
//
//
// External Objects (0)
// ========================================
//
//
// Classes of External Objects (0)
// ========================================
//
//
// Alias Variables (4)
// ========================================
// 1: u0:VARIABLE() = uC .testOptdaedump, .Real type: Real []
// 2: u2:VARIABLE() = uL .testOptdaedump, .Real type: Real []
// 3: v1:VARIABLE() = uC .testOptdaedump, .Real type: Real []
// 4: v2:VARIABLE() = uL .testOptdaedump, .Real type: Real []
//
//
// Simple Equations (0, 0)
// ========================================
//
//
// Initial Equations (0, 0)
// ========================================
//
//
// Zero Crossings (0)
// ========================================
//
//
// Relations (0)
// ========================================
//
//
// Time Events (0)
// ========================================
//
//
// When Clauses (0)
// ========================================
//
//
// Constraints (0)
// ========================================
//
// pre-optimization done.
//
// post-optimization module lateInlineFunction:
Expand Down
1 change: 1 addition & 0 deletions simulation/modelica/tearing/Makefile
Expand Up @@ -9,6 +9,7 @@ Tearing5-celMC3.mos \
Tearing6-celMC3.mos \
Tearing7-celMC3.mos \
Tearing8-celMC3.mos \
Tearing8-celMC3sorted.mos \
Tearing9-celMC3.mos \
Tearing10-celMC11.mos \
Tearing10-celMC12.mos \
Expand Down
95 changes: 95 additions & 0 deletions simulation/modelica/tearing/Tearing8-celMC3sorted.mos
@@ -0,0 +1,95 @@
// name: Tearing8-celMC3
// keywords: tearing
// status: correct
// cflags: +d=backenddaeinfo


loadModel(Modelica); getErrorString();
loadFile("Tearing8.mo"); getErrorString();

setDebugFlags("backenddaeinfo"); getErrorString();
setTearingMethod("cellier"); getErrorString();
setCommandLineOptions("+tearingHeuristic=MC3 +d=sortEqnsAndVars"); getErrorString();
simulate(Tearing8); getErrorString();

val(R1.i,0.2); getErrorString();
val(R1.v,0.2); getErrorString();

// Result:
// true
// ""
// true
// ""
// true
// ""
// true
// ""
// true
// ""
// record SimulationResult
// resultFile = "Tearing8_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'Tearing8', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// messages = ""
// end SimulationResult;
// "Notification: Model statistics after passing the front-end and creating the data structures used by the back-end:
// * Number of equations: 126
// * Number of variables: 126
// Notification: Model statistics after passing the back-end for simulation:
// * Number of independent subsystems: 1
// * Number of states: 0 ('+d=stateselection' for list of states)
// * Number of discrete variables: 0 ('+d=discreteinfo' for list of discrete vars)
// * Number of discrete states: 0 ('+d=discreteinfo' for list of discrete states)
// * Top-level inputs: 0
// Notification: Strong component statistics for simulation (17):
// * Single equations (assignments): 16
// * Array equations: 0
// * Algorithm blocks: 0
// * Record equations: 0
// * When equations: 0
// * If-equations: 0
// * Equation systems (linear and non-linear blocks): 0
// * Torn equation systems: 1
// * Mixed (continuous/discrete) equation systems: 0
// Notification: Torn system details:
// * Linear torn systems: 1 {9 20}
// * Non-linear torn systems: 0
// [Modelica 3.2.1/Electrical/Analog/Basic.mo:62:3-63:40:writable] Warning: Parameter R1.R has no value, and is fixed during initialization (fixed=true), using available start value (start=1.0) as default value.
// [Modelica 3.2.1/Electrical/Analog/Basic.mo:62:3-63:40:writable] Warning: Parameter R2.R has no value, and is fixed during initialization (fixed=true), using available start value (start=1.0) as default value.
// [Modelica 3.2.1/Electrical/Analog/Basic.mo:62:3-63:40:writable] Warning: Parameter R3.R has no value, and is fixed during initialization (fixed=true), using available start value (start=1.0) as default value.
// [Modelica 3.2.1/Electrical/Analog/Basic.mo:62:3-63:40:writable] Warning: Parameter R4.R has no value, and is fixed during initialization (fixed=true), using available start value (start=1.0) as default value.
// [Modelica 3.2.1/Electrical/Analog/Basic.mo:62:3-63:40:writable] Warning: Parameter R5.R has no value, and is fixed during initialization (fixed=true), using available start value (start=1.0) as default value.
// [Modelica 3.2.1/Electrical/Analog/Basic.mo:62:3-63:40:writable] Warning: Parameter R6.R has no value, and is fixed during initialization (fixed=true), using available start value (start=1.0) as default value.
// [Modelica 3.2.1/Electrical/Analog/Basic.mo:62:3-63:40:writable] Warning: Parameter R7.R has no value, and is fixed during initialization (fixed=true), using available start value (start=1.0) as default value.
// [Modelica 3.2.1/Electrical/Analog/Basic.mo:62:3-63:40:writable] Warning: Parameter R8.R has no value, and is fixed during initialization (fixed=true), using available start value (start=1.0) as default value.
// [Modelica 3.2.1/Electrical/Analog/Basic.mo:62:3-63:40:writable] Warning: Parameter R9.R has no value, and is fixed during initialization (fixed=true), using available start value (start=1.0) as default value.
// [Modelica 3.2.1/Electrical/Analog/Basic.mo:62:3-63:40:writable] Warning: Parameter R10.R has no value, and is fixed during initialization (fixed=true), using available start value (start=1.0) as default value.
// [Modelica 3.2.1/Electrical/Analog/Basic.mo:62:3-63:40:writable] Warning: Parameter R11.R has no value, and is fixed during initialization (fixed=true), using available start value (start=1.0) as default value.
// [Modelica 3.2.1/Electrical/Analog/Basic.mo:62:3-63:40:writable] Warning: Parameter R12.R has no value, and is fixed during initialization (fixed=true), using available start value (start=1.0) as default value.
// [Modelica 3.2.1/Electrical/Analog/Basic.mo:62:3-63:40:writable] Warning: Parameter R13.R has no value, and is fixed during initialization (fixed=true), using available start value (start=1.0) as default value.
// [Modelica 3.2.1/Electrical/Analog/Sources.mo:359:5-359:61:writable] Warning: Parameter S.V has no value, and is fixed during initialization (fixed=true), using available start value (start=1.0) as default value.
// [Modelica 3.2.1/Electrical/Analog/Sources.mo:361:5-361:68:writable] Warning: Parameter S.freqHz has no value, and is fixed during initialization (fixed=true), using available start value (start=1.0) as default value.
// Notification: Model statistics after passing the back-end for initialization:
// * Number of independent subsystems: 2
// * Number of states: 0 ('+d=stateselection' for list of states)
// * Number of discrete variables: 0 ('+d=discreteinfo' for list of discrete vars)
// * Number of discrete states: 0 ('+d=discreteinfo' for list of discrete states)
// * Top-level inputs: 0
// Notification: Strong component statistics for initialization (49):
// * Single equations (assignments): 48
// * Array equations: 0
// * Algorithm blocks: 0
// * Record equations: 0
// * When equations: 0
// * If-equations: 0
// * Equation systems (linear and non-linear blocks): 0
// * Torn equation systems: 1
// * Mixed (continuous/discrete) equation systems: 0
// Notification: Torn system details:
// * Linear torn systems: 1 {7 22}
// * Non-linear torn systems: 0
// "
// 0.3170188387650511
// ""
// 0.3170188387650511
// ""
// endResult

0 comments on commit 14bd6a3

Please sign in to comment.