Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add scaling test and expected output
- Loading branch information
1 parent
1e8090d
commit 2965425
Showing
5 changed files
with
72 additions
and
11 deletions.
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
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,59 @@ | ||
// name: ScalingTest1 | ||
// status: correct | ||
// | ||
// | ||
|
||
loadModel(Modelica); getErrorString(); | ||
loadString(" | ||
model ScalingTest1 | ||
parameter Real nom1 = 1e30; | ||
parameter Real nom2 = 1e-12; | ||
parameter Real fnom1 = 1e25; | ||
parameter Real fnom2 = 1e-13; | ||
Real x1(start=4*nom1,nominal=nom1); | ||
Real x2(start=2*nom2,nominal=nom2); | ||
equation | ||
0 = sin(x1/nom1)*cos(x2/nom2)*fnom2 - cos(x1/nom1)*sin(x2/nom2)*fnom2; | ||
0 = log(x1/nom1)*log(x2/nom2)*fnom1 - log(3)^2*fnom1; | ||
end ScalingTest1; | ||
"); getErrorString(); | ||
|
||
simulate(ScalingTest1); getErrorString(); | ||
val(x1, 0.0); getErrorString(); | ||
val(x2, 0.0); getErrorString(); | ||
|
||
simulate(ScalingTest1, simflags="-override nom1=1,nom2=1,fnom1=1,fnom2=1"); getErrorString(); | ||
val(x1, 0.0); getErrorString(); | ||
val(x2, 0.0); getErrorString(); | ||
|
||
|
||
// Result: | ||
// true | ||
// "" | ||
// true | ||
// "" | ||
// record SimulationResult | ||
// resultFile = "ScalingTest1_res.mat", | ||
// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'ScalingTest1', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''", | ||
// messages = "stdout | info | The initialization finished successfully without homotopy method. | ||
// stdout | info | The simulation finished successfully. | ||
// " | ||
// end SimulationResult; | ||
// "" | ||
// 5.217839301454226e+30 | ||
// "" | ||
// 2.076246647864433e-12 | ||
// "" | ||
// record SimulationResult | ||
// resultFile = "ScalingTest1_res.mat", | ||
// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'ScalingTest1', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = '-override nom1=1,nom2=1,fnom1=1,fnom2=1'", | ||
// messages = "stdout | info | The initialization finished successfully without homotopy method. | ||
// stdout | info | The simulation finished successfully. | ||
// " | ||
// end SimulationResult; | ||
// "" | ||
// 5.217839301454226 | ||
// "" | ||
// 2.076246647864433 | ||
// "" | ||
// endResult |
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