Skip to content

Commit

Permalink
Add tests for total tearing
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaeuber committed Mar 30, 2016
1 parent be78147 commit 8cc8b1e
Show file tree
Hide file tree
Showing 5 changed files with 461 additions and 41 deletions.
3 changes: 3 additions & 0 deletions simulation/modelica/tearing/Makefile
Expand Up @@ -75,6 +75,9 @@ Algorithm2-omc.mos \
MixedTearing1-omc.mos \
AnnotationTest-omc.mos \
AnnotationTest2-omc.mos \
totalTearing1.mos \
totalTearing2.mos \
totalTearing3.mos \



Expand Down
68 changes: 27 additions & 41 deletions simulation/modelica/tearing/dynamicTearing3.mos
Expand Up @@ -53,10 +53,10 @@ simulate(dynamicTearing3,startTime=0,stopTime=2,numberOfIntervals=500); getError
//
// Variables (4)
// ========================================
// 1: y:VARIABLE() .dynamicTearing3, .Real type: Real
// 2: z:VARIABLE() .dynamicTearing3, .Real type: Real
// 3: a:VARIABLE() .dynamicTearing3, .Real type: Real
// 4: x:VARIABLE() .dynamicTearing3, .Real type: Real
// 1: y:VARIABLE() .dynamicTearing3, .Real type: Real
// 2: z:VARIABLE() .dynamicTearing3, .Real type: Real
// 3: a:VARIABLE() .dynamicTearing3, .Real type: Real
// 4: x:VARIABLE() .dynamicTearing3, .Real type: Real
//
//
// Equations (4, 4)
Expand Down Expand Up @@ -142,25 +142,20 @@ simulate(dynamicTearing3,startTime=0,stopTime=2,numberOfIntervals=500); getError
//
//
// ****************************************
// * TEARING RESULTS (STRICT SET):
// * TEARING RESULTS - STRICT SET:
// * (Local Indexes)
// *
// * No of equations in strong Component: 4
// * No of equations in strong component: 4
// * No of tVars: 2
// *
// * tVars: 2,4
// *
// * resEq: 4,2
// *
// * innerEquations ({eqn,vars}):
// * {1:3}, {3:1}
// *
// * Related to entire Equationsystem:
// * =====
// * tVars: 3,1
// * =====
// *
// * =====
// * resEq: 2,4
// * =====
// ****************************************
// *****************************************
//
// Note:
// =====
Expand Down Expand Up @@ -190,10 +185,10 @@ simulate(dynamicTearing3,startTime=0,stopTime=2,numberOfIntervals=500); getError
//
// Variables (4)
// ========================================
// 1: y:VARIABLE() .dynamicTearing3, .Real type: Real
// 2: z:VARIABLE() .dynamicTearing3, .Real type: Real
// 3: a:VARIABLE() .dynamicTearing3, .Real type: Real
// 4: x:VARIABLE() .dynamicTearing3, .Real type: Real
// 1: y:VARIABLE() .dynamicTearing3, .Real type: Real
// 2: z:VARIABLE() .dynamicTearing3, .Real type: Real
// 3: a:VARIABLE() .dynamicTearing3, .Real type: Real
// 4: x:VARIABLE() .dynamicTearing3, .Real type: Real
//
//
// Equations (4, 4)
Expand Down Expand Up @@ -280,25 +275,20 @@ simulate(dynamicTearing3,startTime=0,stopTime=2,numberOfIntervals=500); getError
//
//
// ****************************************
// * TEARING RESULTS (STRICT SET):
// * TEARING RESULTS - STRICT SET:
// * (Local Indexes)
// *
// * No of equations in strong Component: 4
// * No of equations in strong component: 4
// * No of tVars: 2
// *
// * tVars: 4,2
// *
// * resEq: 4,1
// *
// * innerEquations ({eqn,vars}):
// * {2:3}, {3:1}
// *
// * Related to entire Equationsystem:
// * =====
// * tVars: 1,3
// * =====
// *
// * =====
// * resEq: 2,1
// * =====
// ****************************************
// *****************************************
//
//
//
Expand Down Expand Up @@ -337,25 +327,21 @@ simulate(dynamicTearing3,startTime=0,stopTime=2,numberOfIntervals=500); getError
//
//
// ****************************************
// * TEARING RESULTS (CASUAL SET):
// * TEARING RESULTS - CASUAL SET:
// * (Local Indexes)
// *
// * No of equations in strong Component: 4
// * No of equations in strong component: 4
// * No of tVars: 1
// *
// * tVars: 4
// *
// * resEq: 4
// *
// * innerEquations ({eqn,vars}):
// * {2:3}, {1:1}, {3:2}
// *
// * Related to entire Equationsystem:
// * =====
// * tVars: 3
// * =====
// *
// * =====
// * resEq: 2
// * =====
// ****************************************
// *****************************************
//
//
// Note:
// =====
Expand Down
65 changes: 65 additions & 0 deletions simulation/modelica/tearing/totalTearing1.mos
@@ -0,0 +1,65 @@
// name: totalTearing1
// keywords: total tearing, linear
// status: correct

loadFile("Tearing1.mo"); getErrorString();

setCommandLineOptions("+d=backenddaeinfo, +tearingMethod=totalTearing"); getErrorString();
simulate(Tearing1); getErrorString();


// Result:
// true
// ""
// true
// ""
// record SimulationResult
// resultFile = "Tearing1_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'Tearing1', 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: 7
// * Number of variables: 7
// Notification: Model statistics after passing the back-end for initialization:
// * 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 initialization (2):
// * Single equations (assignments): 1
// * Array equations: 0
// * Algorithm blocks: 0
// * Record equations: 0
// * When equations: 0
// * If-equations: 0
// * Equation systems (linear and non-linear blocks): 1
// * Torn equation systems: 0
// * Mixed (continuous/discrete) equation systems: 0
// Notification: Equation system details:
// * Constant Jacobian: 0
// * Linear Jacobian (size,density): 1 {(5,44.0%)}
// * Non-linear Jacobian: 0
// * Without analytic Jacobian: 0
// 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 (2):
// * Single equations (assignments): 1
// * 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 for strict tearing set:
// * Linear torn systems: 1 {(4,56.2%) 1}
// * Non-linear torn systems: 0
// "
// endResult

0 comments on commit 8cc8b1e

Please sign in to comment.