Skip to content

Commit 28cd7de

Browse files
committed
Add tests for PowerSystems library
1 parent 4523ec1 commit 28cd7de

File tree

132 files changed

+6404
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+6404
-0
lines changed

testsuite/libraries-for-testing/index.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,20 @@
341341
}
342342
}
343343
},
344+
"PowerSystems": {
345+
"versions": {
346+
"1.0.1": {
347+
"path": "PowerSystems",
348+
"sha": "07b5d32cc291e2397becd2f97351c0bc1a375d54",
349+
"support": "support",
350+
"uses": {
351+
"Modelica": "3.2.3"
352+
},
353+
"version": "1.0.1",
354+
"zipfile": "https://github.com/modelica-3rdparty/PowerSystems/archive/07b5d32cc291e2397becd2f97351c0bc1a375d54.zip"
355+
}
356+
}
357+
},
344358
"SiemensPower": {
345359
"versions": {
346360
"0.0.0-OMCtest": {
Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
TEST = ../../../../rtest -v
2+
3+
TESTFILES = \
4+
PowerSystems.Examples.AC1ph_DC.Drives.BLDC.mos \
5+
PowerSystems.Examples.AC1ph_DC.Drives.BLDCcharSpeed.mos \
6+
PowerSystems.Examples.AC1ph_DC.Drives.DCcharSpeed.mos \
7+
PowerSystems.Examples.AC1ph_DC.Drives.DCmotor_par.mos \
8+
PowerSystems.Examples.AC1ph_DC.Drives.DCmotor_pm.mos \
9+
PowerSystems.Examples.AC1ph_DC.Drives.DCmotor_ser.mos \
10+
PowerSystems.Examples.AC1ph_DC.Elementary.Breaker.mos \
11+
PowerSystems.Examples.AC1ph_DC.Elementary.DoubleLine.mos \
12+
PowerSystems.Examples.AC1ph_DC.Elementary.Fault.mos \
13+
PowerSystems.Examples.AC1ph_DC.Elementary.Impedance.mos \
14+
PowerSystems.Examples.AC1ph_DC.Elementary.ImpedanceOneTerm.mos \
15+
PowerSystems.Examples.AC1ph_DC.Elementary.Inverter.mos \
16+
PowerSystems.Examples.AC1ph_DC.Elementary.Line.mos \
17+
PowerSystems.Examples.AC1ph_DC.Elementary.LoadAC.mos \
18+
PowerSystems.Examples.AC1ph_DC.Elementary.LoadDC.mos \
19+
PowerSystems.Examples.AC1ph_DC.Elementary.Machines.mos \
20+
PowerSystems.Examples.AC1ph_DC.Elementary.Rectifier.mos \
21+
PowerSystems.Examples.AC1ph_DC.Elementary.Sensor.mos \
22+
PowerSystems.Examples.AC1ph_DC.Elementary.Source.mos \
23+
PowerSystems.Examples.AC1ph_DC.Elementary.Transformer.mos \
24+
PowerSystems.Examples.AC1ph_DC.Inverters.Chopper.mos \
25+
PowerSystems.Examples.AC1ph_DC.Inverters.InverterAvToGrid.mos \
26+
PowerSystems.Examples.AC1ph_DC.Inverters.InverterToGrid.mos \
27+
PowerSystems.Examples.AC1ph_DC.Inverters.InverterToLoad.mos \
28+
PowerSystems.Examples.AC1ph_DC.Inverters.Rectifier.mos \
29+
PowerSystems.Examples.AC1ph_DC.Transformation.OnePhase.mos \
30+
PowerSystems.Examples.AC1ph_DC.Transformation.TapChanger.mos \
31+
PowerSystems.Examples.AC3ph.Drives.ASM.mos \
32+
PowerSystems.Examples.AC3ph.Drives.ASM_Y_D.mos \
33+
PowerSystems.Examples.AC3ph.Drives.ASM_ctrl.mos \
34+
PowerSystems.Examples.AC3ph.Drives.ASM_ctrlAv.mos \
35+
PowerSystems.Examples.AC3ph.Drives.ASMav.mos \
36+
PowerSystems.Examples.AC3ph.Drives.ASMav_icontrol.mos \
37+
PowerSystems.Examples.AC3ph.Drives.ASMcharacteristic.mos \
38+
PowerSystems.Examples.AC3ph.Drives.SM_ctrl.mos \
39+
PowerSystems.Examples.AC3ph.Drives.SM_ctrlAv.mos \
40+
PowerSystems.Examples.AC3ph.Elementary.Breaker.mos \
41+
PowerSystems.Examples.AC3ph.Elementary.Fault.mos \
42+
PowerSystems.Examples.AC3ph.Elementary.Impedance.mos \
43+
PowerSystems.Examples.AC3ph.Elementary.ImpedanceYD.mos \
44+
PowerSystems.Examples.AC3ph.Elementary.Inverter.mos \
45+
PowerSystems.Examples.AC3ph.Elementary.Line.mos \
46+
PowerSystems.Examples.AC3ph.Elementary.Load.mos \
47+
PowerSystems.Examples.AC3ph.Elementary.Machines.mos \
48+
PowerSystems.Examples.AC3ph.Elementary.Rectifier.mos \
49+
PowerSystems.Examples.AC3ph.Elementary.Sensor.mos \
50+
PowerSystems.Examples.AC3ph.Elementary.Source.mos \
51+
PowerSystems.Examples.AC3ph.Elementary.Transformer.mos \
52+
PowerSystems.Examples.AC3ph.Generation.GenOrder3and7.mos \
53+
PowerSystems.Examples.AC3ph.Generation.Islanding.mos \
54+
PowerSystems.Examples.AC3ph.Generation.LocalGeneration.mos \
55+
PowerSystems.Examples.AC3ph.Generation.PQsource.mos \
56+
PowerSystems.Examples.AC3ph.Generation.PVsource.mos \
57+
PowerSystems.Examples.AC3ph.Generation.PowerAngle.mos \
58+
PowerSystems.Examples.AC3ph.Generation.TieLine.mos \
59+
PowerSystems.Examples.AC3ph.Generation.TurbineGenerator.mos \
60+
PowerSystems.Examples.AC3ph.Generation.TurbineGeneratorLine.mos \
61+
PowerSystems.Examples.AC3ph.Generation.TurboGeneratorLine.mos \
62+
PowerSystems.Examples.AC3ph.Generation.TurboGroupGenerator.mos \
63+
PowerSystems.Examples.AC3ph.Generation.Vsource.mos \
64+
PowerSystems.Examples.AC3ph.Generation.WindGeneratorLine.mos \
65+
PowerSystems.Examples.AC3ph.Inverters.InverterAvToGrid.mos \
66+
PowerSystems.Examples.AC3ph.Inverters.InverterToGrid.mos \
67+
PowerSystems.Examples.AC3ph.Inverters.InverterToLoad.mos \
68+
PowerSystems.Examples.AC3ph.Inverters.Rectifier.mos \
69+
PowerSystems.Examples.AC3ph.Precalculation.EqCircFromTransDat.mos \
70+
PowerSystems.Examples.AC3ph.Precalculation.TransDatFromEqCirc.mos \
71+
PowerSystems.Examples.AC3ph.Precalculation.Z_matrixEqCirc0.mos \
72+
PowerSystems.Examples.AC3ph.Precalculation.Z_matrixEqCirc1.mos \
73+
PowerSystems.Examples.AC3ph.Precalculation.Z_matrixEqCirc2.mos \
74+
PowerSystems.Examples.AC3ph.Precalculation.Z_matrixEqCirc3.mos \
75+
PowerSystems.Examples.AC3ph.Precalculation.Z_matrixTrDat0.mos \
76+
PowerSystems.Examples.AC3ph.Precalculation.Z_matrixTrDat1.mos \
77+
PowerSystems.Examples.AC3ph.Precalculation.Z_matrixTrDat2.mos \
78+
PowerSystems.Examples.AC3ph.Precalculation.Z_matrixTrDat3.mos \
79+
PowerSystems.Examples.AC3ph.Transformation.PhaseShifts.mos \
80+
PowerSystems.Examples.AC3ph.Transformation.TapChanger.mos \
81+
PowerSystems.Examples.AC3ph.Transformation.ThreeWinding.mos \
82+
PowerSystems.Examples.AC3ph.Transmission.DoubleLineTG.mos \
83+
PowerSystems.Examples.AC3ph.Transmission.DoubleRXline.mos \
84+
PowerSystems.Examples.AC3ph.Transmission.DoubleRXlineTG.mos \
85+
PowerSystems.Examples.AC3ph.Transmission.FaultRXline.mos \
86+
PowerSystems.Examples.AC3ph.Transmission.FaultTline.mos \
87+
PowerSystems.Examples.AC3ph.Transmission.PowerTransfer.mos \
88+
PowerSystems.Examples.AC3ph.Transmission.RXline.mos \
89+
PowerSystems.Examples.AC3ph.Transmission.Tline.mos \
90+
PowerSystems.Examples.AC3ph.Transmission.VoltageStability.mos \
91+
PowerSystems.Examples.Generic.Network.NetworkControlled.mos \
92+
PowerSystems.Examples.Generic.Network.NetworkLoop.mos \
93+
PowerSystems.Examples.Generic.Network.NetworkLoop_d.mos \
94+
PowerSystems.Examples.Generic.Network.NetworkLoop_dq.mos \
95+
PowerSystems.Examples.Generic.Network.NetworkLoop_dq0.mos \
96+
PowerSystems.Examples.Generic.Network.NetworkOpened.mos \
97+
PowerSystems.Examples.Generic.Test.AdmittanceTest.mos \
98+
PowerSystems.Examples.Generic.Test.FixedCurrentTest.mos \
99+
PowerSystems.Examples.Generic.Test.FixedLoadTest.mos \
100+
PowerSystems.Examples.Generic.Test.GeneratorTest.mos \
101+
PowerSystems.Examples.Generic.Test.GeneratorTest2.mos \
102+
PowerSystems.Examples.Generic.Test.ImpedanceTest.mos \
103+
PowerSystems.Examples.Generic.Test.InductiveLoadTest.mos \
104+
PowerSystems.Examples.Generic.Test.PMeterTest.mos \
105+
PowerSystems.Examples.Introductory.Display.mos \
106+
PowerSystems.Examples.Introductory.Frequency.mos \
107+
PowerSystems.Examples.Introductory.InitialSteadyState.mos \
108+
PowerSystems.Examples.Introductory.ReferenceInertial.mos \
109+
PowerSystems.Examples.Introductory.ReferenceSynchron.mos \
110+
PowerSystems.Examples.Introductory.SimulationFixedInitial.mos \
111+
PowerSystems.Examples.Introductory.SimulationSteadyInitial.mos \
112+
PowerSystems.Examples.Introductory.SimulationSteadyState.mos \
113+
PowerSystems.Examples.Introductory.Tables.mos \
114+
PowerSystems.Examples.Introductory.Units.mos \
115+
PowerSystems.Examples.PowerWorld.PowerWorld.mos \
116+
PowerSystems.Examples.PowerWorld.Test.CityTest.mos \
117+
PowerSystems.Examples.PowerWorld.Test.HydroPlantTest1.mos \
118+
PowerSystems.Examples.PowerWorld.Test.HydroPlantTest2.mos \
119+
PowerSystems.Examples.PowerWorld.Test.PowerPlantTest1.mos \
120+
PowerSystems.Examples.PowerWorld.Test.PowerPlantTest2.mos \
121+
PowerSystems.Examples.PowerWorld.Test.PowerPlantTest3.mos \
122+
PowerSystems.Examples.PowerWorld.Test.WindFarmGridTest.mos \
123+
PowerSystems.Examples.PowerWorld.Test.WindFarmHVDCTest.mos \
124+
PowerSystems.Examples.Wind.Test.RotorTest.mos \
125+
PowerSystems.Examples.Wind.WindFarm.mos \
126+
PowerSystems.Examples.Wind.WindTurbine_DFIG.mos \
127+
PowerSystems.Examples.Wind.WindTurbine_IG.mos \
128+
PowerSystems.Examples.Wind.WindTurbine_PSGI.mos \
129+
PowerSystems.Examples.Wind.WindTurbine_PSGR.mos \
130+
131+
132+
# Run make failingtest
133+
FAILINGTESTFILES= \
134+
135+
136+
DISABLED_TOO_SLOW = \
137+
PowerSystems.Examples.AC3ph.Transmission.DoubleLine.mos \
138+
139+
140+
# Dependency files that are not .mo .mos or Makefile
141+
# Add them here or they will be cleaned.
142+
DEPENDENCIES = \
143+
*.mos \
144+
Makefile \
145+
146+
147+
CLEAN = `ls | grep -w -v -f deps.tmp`
148+
149+
.PHONY : test clean getdeps failingtest
150+
151+
152+
test:
153+
@echo
154+
@echo Running tests...
155+
@echo
156+
@echo OPENMODELICAHOME=" $(OPENMODELICAHOME) "
157+
@$(TEST) $(TESTFILES)
158+
159+
# Cleans all files that are not listed as dependencies
160+
clean :
161+
@echo $(DEPENDENCIES) | sed 's/ /\\|/g' > deps.tmp
162+
@rm -f *.mos.txt
163+
@rm -rf $(CLEAN)
164+
165+
# Run this if you want to list out the files (dependencies).
166+
# do it after cleaning and updating the folder
167+
# then you can get a list of file names (which must be dependencies
168+
# since you got them from repository + your own new files)
169+
# then add them to the DEPENDENCIES. You can find the
170+
# list in deps.txt
171+
getdeps:
172+
@echo $(DEPENDENCIES) | sed 's/ /\\|/g' > deps.tmp
173+
@echo $(CLEAN) | sed -r 's/deps.txt|deps.tmp//g' | sed 's/ / \\\n/g' > deps.txt
174+
@echo Dependency list saved in deps.txt.
175+
@echo Copy the list from deps.txt and add it to the Makefile @DEPENDENCIES
176+
177+
failingtest :
178+
@echo
179+
@echo Running failing tests...
180+
@echo
181+
@$(TEST) $(FAILINGTESTFILES)
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// name: PowerSystems.Examples.AC1ph_DC.Drives.BLDC
2+
// keywords: simulation PowerSystems Examples
3+
// status: correct
4+
//
5+
// Simulation Results
6+
// PowerSystems Library
7+
//
8+
9+
runScript("../../common/ModelTestingDefaults.mos"); getErrorString();
10+
11+
modelTestingType := OpenModelicaModelTesting.Kind.SimpleSimulation;
12+
modelName := $TypeName(PowerSystems.Examples.AC1ph_DC.Drives.BLDC);
13+
compareVars :=
14+
{
15+
"power.p",
16+
"loadInertia.w",
17+
"loadInertia.flange_a.tau",
18+
"efficiency.eta"
19+
};
20+
21+
runScript("common.mos"); getErrorString();
22+
23+
runScript(modelTesting); getErrorString();
24+
25+
// Result:
26+
// "true
27+
// "
28+
// ""
29+
// OpenModelicaModelTesting.Kind.SimpleSimulation
30+
// PowerSystems.Examples.AC1ph_DC.Drives.BLDC
31+
// {"power.p","loadInertia.w","loadInertia.flange_a.tau","efficiency.eta"}
32+
// "PowerSystems
33+
// \"\"
34+
// OpenModelicaModelTesting.SimulationRuntime.Cpp
35+
// \"PowerSystems\"
36+
// "
37+
// ""
38+
// Simulation options: startTime = 0.0, stopTime = 3.0, numberOfIntervals = 500, tolerance = 1e-05, method = 'dassl', fileNamePrefix = 'PowerSystems.Examples.AC1ph_DC.Drives.BLDC', options = '', outputFormat = 'mat', variableFilter = 'time|power.p|loadInertia.w|loadInertia.flange_a.tau|efficiency.eta', cflags = '', simflags = ' -emit_protected'
39+
// Result file: PowerSystems.Examples.AC1ph_DC.Drives.BLDC_res.mat
40+
// Warning: It was not possible to determine if the initialization problem is consistent, because of not evaluable parameters/start values during compile time: bldcm.rotor.w = bldcm.rotor.w_start (loadInertia.w_start = bldcm.rotor.w_start)
41+
// Warning: The initial conditions are over specified. For more information set -d=initialization. In OMEdit Tools->Options->Simulation->Show additional information from the initialization process, in OMNotebook call setCommandLineOptions("-d=initialization").
42+
//
43+
// "true
44+
// "
45+
// ""
46+
// endResult
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// name: PowerSystems.Examples.AC1ph_DC.Drives.BLDCcharSpeed
2+
// keywords: simulation PowerSystems Examples
3+
// status: correct
4+
//
5+
// Simulation Results
6+
// PowerSystems Library
7+
//
8+
9+
runScript("../../common/ModelTestingDefaults.mos"); getErrorString();
10+
11+
modelTestingType := OpenModelicaModelTesting.Kind.VerifiedSimulation;
12+
modelName := $TypeName(PowerSystems.Examples.AC1ph_DC.Drives.BLDCcharSpeed);
13+
compareVars :=
14+
{
15+
"efficiency.eta",
16+
"machine.motor.w_el",
17+
"machine.motor.tau_el"
18+
};
19+
20+
runScript("common.mos"); getErrorString();
21+
22+
runScript(modelTesting);getErrorString();
23+
24+
// Result:
25+
// "true
26+
// "
27+
// ""
28+
// OpenModelicaModelTesting.Kind.VerifiedSimulation
29+
// PowerSystems.Examples.AC1ph_DC.Drives.BLDCcharSpeed
30+
// {"efficiency.eta","machine.motor.w_el","machine.motor.tau_el"}
31+
// "PowerSystems
32+
// \"\"
33+
// OpenModelicaModelTesting.SimulationRuntime.Cpp
34+
// \"PowerSystems\"
35+
// "
36+
// ""
37+
// Simulation options: startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-05, method = 'dassl', fileNamePrefix = 'PowerSystems.Examples.AC1ph_DC.Drives.BLDCcharSpeed', options = '', outputFormat = 'mat', variableFilter = 'time|efficiency.eta|machine.motor.w_el|machine.motor.tau_el', cflags = '', simflags = ' -emit_protected'
38+
// Result file: PowerSystems.Examples.AC1ph_DC.Drives.BLDCcharSpeed_res.mat
39+
// Files Equal!
40+
// Warning: The model contains alias variables with redundant start and/or conflicting nominal values. It is recommended to resolve the conflicts, because otherwise the system could be hard to solve. To print the conflicting alias sets and the chosen candidates please use -d=aliasConflicts.
41+
//
42+
// "true
43+
// "
44+
// ""
45+
// endResult
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// name: PowerSystems.Examples.AC1ph_DC.Drives.DCcharSpeed
2+
// keywords: simulation PowerSystems Examples
3+
// status: correct
4+
//
5+
// Simulation Results
6+
// PowerSystems Library
7+
//
8+
9+
runScript("../../common/ModelTestingDefaults.mos"); getErrorString();
10+
11+
modelTestingType := OpenModelicaModelTesting.Kind.VerifiedSimulation;
12+
modelName := $TypeName(PowerSystems.Examples.AC1ph_DC.Drives.DCcharSpeed);
13+
compareVars :=
14+
{
15+
"efficiency.eta",
16+
"machine.motor.w_el",
17+
"machine.motor.tau_el"
18+
};
19+
20+
runScript("common.mos"); getErrorString();
21+
22+
runScript(modelTesting);getErrorString();
23+
24+
// Result:
25+
// "true
26+
// "
27+
// ""
28+
// OpenModelicaModelTesting.Kind.VerifiedSimulation
29+
// PowerSystems.Examples.AC1ph_DC.Drives.DCcharSpeed
30+
// {"efficiency.eta","machine.motor.w_el","machine.motor.tau_el"}
31+
// "PowerSystems
32+
// \"\"
33+
// OpenModelicaModelTesting.SimulationRuntime.Cpp
34+
// \"PowerSystems\"
35+
// "
36+
// ""
37+
// Simulation options: startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-05, method = 'dassl', fileNamePrefix = 'PowerSystems.Examples.AC1ph_DC.Drives.DCcharSpeed', options = '', outputFormat = 'mat', variableFilter = 'time|efficiency.eta|machine.motor.w_el|machine.motor.tau_el', cflags = '', simflags = ' -emit_protected'
38+
// Result file: PowerSystems.Examples.AC1ph_DC.Drives.DCcharSpeed_res.mat
39+
// Files Equal!
40+
// "true
41+
// "
42+
// ""
43+
// endResult
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// name: PowerSystems.Examples.AC1ph_DC.Drives.DCmotor_par
2+
// keywords: simulation PowerSystems Examples
3+
// status: correct
4+
//
5+
// Simulation Results
6+
// PowerSystems Library
7+
//
8+
9+
runScript("../../common/ModelTestingDefaults.mos"); getErrorString();
10+
11+
modelTestingType := OpenModelicaModelTesting.Kind.VerifiedSimulation;
12+
modelName := $TypeName(PowerSystems.Examples.AC1ph_DC.Drives.DCmotor_par);
13+
compareVars :=
14+
{
15+
"power.p",
16+
"tabLoad.vVehicle"
17+
};
18+
19+
runScript("common.mos"); getErrorString();
20+
21+
runScript(modelTesting);getErrorString();
22+
23+
// Result:
24+
// "true
25+
// "
26+
// ""
27+
// OpenModelicaModelTesting.Kind.VerifiedSimulation
28+
// PowerSystems.Examples.AC1ph_DC.Drives.DCmotor_par
29+
// {"power.p","tabLoad.vVehicle"}
30+
// "PowerSystems
31+
// \"\"
32+
// OpenModelicaModelTesting.SimulationRuntime.Cpp
33+
// \"PowerSystems\"
34+
// "
35+
// ""
36+
// Simulation options: startTime = 0.0, stopTime = 60.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'PowerSystems.Examples.AC1ph_DC.Drives.DCmotor_par', options = '', outputFormat = 'mat', variableFilter = 'time|power.p|tabLoad.vVehicle', cflags = '', simflags = ' -emit_protected'
37+
// Result file: PowerSystems.Examples.AC1ph_DC.Drives.DCmotor_par_res.mat
38+
// Messages: ... loading "height" from "/home/rfranke/Modelica/PowerSystems/PowerSystems/Resources/Tables/hNormProfile.tab"
39+
// Model terminate() at 54.1181
40+
// Message: BOUNDARY POSITION REACHED!
41+
//
42+
// Files Equal!
43+
// "true
44+
// "
45+
// ""
46+
// endResult

0 commit comments

Comments
 (0)