Skip to content

Commit

Permalink
- revised dynamic tearing test model
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaeuber committed Aug 4, 2015
1 parent 3663a5b commit 2138055
Showing 1 changed file with 35 additions and 35 deletions.
70 changes: 35 additions & 35 deletions simulation/modelica/tearing/dynamicTearing1.mos
Expand Up @@ -5,16 +5,16 @@
loadString("
model dynamicTearing1
Real x,y,z,x1,y1,z1,z2;
parameter Real a=10;
parameter Real b=5;
parameter Real c=2;
final parameter Real a=10;
final parameter Real b=5;
final parameter Real c=2;
equation
(a-5-b)*y = x * time + time;
a + b - 7*c = x*y +1;
(a-4-b-time)*y = x * time +time;
a + b - 7*c = x*y +1 +y;
z = x - y;

(a-5-b)*y1 = x1 * time + time;
a + b - 7*c = x1*y1 +1;
(a-4-b-time)*y1 = x1 * time +time;
a + b - 7*c = x1*y1 +1 +y;
z1 = x1 - y1;

z2 = z + z1;
Expand All @@ -24,7 +24,7 @@ end dynamicTearing1;
setTearingMethod("cellier"); getErrorString();
setCommandLineOptions("+forceTearing"); getErrorString();
setCommandLineOptions("+dynamicTearing"); getErrorString();
simulate(dynamicTearing1); getErrorString();
simulate(dynamicTearing1,startTime=0,stopTime=2,numberOfIntervals=500,simflags="-nls=newton"); getErrorString();

print("x at time=0.0");
val(x,0.0); getErrorString();
Expand All @@ -41,19 +41,19 @@ val(z1,0.0); getErrorString();
print("z2 at time=0.0");
val(z2,0.0); getErrorString();
print("x at time=0.1");
val(x,0.1); getErrorString();
print("x1 at time=0.1");
val(x1,0.1); getErrorString();
print("y at time=0.1");
val(y,0.1); getErrorString();
print("y1 at time=0.1");
val(y1,0.1); getErrorString();
print("z at time=0.1");
val(z,0.1); getErrorString();
print("z1 at time=0.1");
val(z1,0.1); getErrorString();
print("z2 at time=0.1");
val(z2,0.1); getErrorString();
val(x,1.1); getErrorString();
print("x1 at time=1.1");
val(x1,1.1); getErrorString();
print("y at time=1.1");
val(y,1.1); getErrorString();
print("y1 at time=1.1");
val(y1,1.1); getErrorString();
print("z at time=1.1");
val(z,1.1); getErrorString();
print("z1 at time=1.1");
val(z1,1.1); getErrorString();
print("z2 at time=1.1");
val(z2,1.1); getErrorString();


// Result:
Expand All @@ -67,7 +67,7 @@ val(z2,0.1); getErrorString();
// ""
// record SimulationResult
// resultFile = "dynamicTearing1_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'dynamicTearing1', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// simulationOptions = "startTime = 0.0, stopTime = 2.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'dynamicTearing1', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = '-nls=newton'",
// messages = ""
// end SimulationResult;
// "Warning: There are iteration variables with default zero start attribute. Use +d=initialization for more information.
Expand All @@ -94,24 +94,24 @@ val(z2,0.1); getErrorString();
// 0.0
// ""
// x at time=0.1
// -1.0
// -0.9999997219956582
// ""
// x1 at time=0.1
// -1.0
// x1 at time=1.1
// -2.780044190558462e-07
// ""
// y at time=0.1
// 0.0
// y at time=1.1
// -3.058047759463276e-06
// ""
// y1 at time=0.1
// 0.0
// y1 at time=1.1
// -10.99999694195138
// ""
// z at time=0.1
// -1.0
// z at time=1.1
// -0.9999966639478988
// ""
// z1 at time=0.1
// -1.0
// z1 at time=1.1
// 10.99999666394696
// ""
// z2 at time=0.1
// -2.0
// z2 at time=1.1
// 9.999999999999062
// ""
// endResult

0 comments on commit 2138055

Please sign in to comment.