Commit c9fe0586 authored by Jan Dinkelbach's avatar Jan Dinkelbach

update neplan dpsim comparison and add sample neplan result

parent ab644338
from villas.dataprocessing.readtools import *
from villas.dataprocessing.timeseries import *
import villas.dataprocessing.validationtools as validationtools
import os
# Path to NEPLAN result file (power flow result in *.rlf format)
neplan_result_file=r"D:\git\data\reference-results\Neplan\ReferenceGrids\CIGRE_MV_NoTap.rlf"
neplan_result_file= os.path.abspath(r"..\sampledata\CIGRE_MV_NoTap.rlf")
# Path to DPsim result file (power flow result in *.csv format)
dpsim_result_file = "D:\\git\\code\\dpsim-powerflow-integration\\dpsim\\build\\Dependencies\\fpotencia\\src\\test\\Logs\\CIGRE-MV-NoTap-Neplan.csv"
dpsim_result_file = os.path.abspath(r"..\sampledata\CIGRE-MV-NoTap.csv")
# Read in NEPLAN results
print('************************ reading neplan power flow data start ****************')
......@@ -20,27 +21,29 @@ print('\n')
print('************************ reading dpsim power flow data start ****************')
ts_dpsim = read_timeseries_csv(dpsim_result_file)
for ts,values in ts_dpsim.items():
ts_abs = values.abs(ts + '.Vpp')
ts_phase = values.phase(ts + '.Vangle')
ts_abs = values.abs()
ts_phase = values.phase()
print(ts_abs.name + ': ' + str(ts_abs.values) + '\n' +ts_phase.name+' :'+ str(ts_phase.values))
print('************************ reading dpsim power flow data end ****************')
# Converting both timeseries objects to a common format (here the Modelica format) and afterwards compare and assert the results
# Converting both timeseries objects to a common format and afterwards compare and assert the results
net_name='CIGRE_MV_NoTap'
threshold=0.5
print('************************ convert neplan to modelica start ****************')
res_ref=validationtools.convert_neplan_to_modelica_timeseries(ts_NEPLAN)
print('************************ convert neplan to standard start ****************')
res_ref=validationtools.convert_neplan_to_standard_timeseries(ts_NEPLAN)
for i in range(len(res_ref)):
print(res_ref[i].name)
print(res_ref[i].values)
print('************************ convert neplan to modelica end ****************')
print('************************ convert neplan to standard end ****************')
print('************************ convert dpsim to modelica start ****************')
ts_dpsimList=validationtools.convert_dpsim_to_modelica_timeseries(ts_dpsim)
print('************************ convert dpsim to standard start ****************')
ts_dpsimList=validationtools.convert_dpsim_to_standard_timeseries(ts_dpsim)
for i in range(len(ts_dpsimList)):
print(ts_dpsimList[i].name)
print(ts_dpsimList[i].values)
print('************************ convert dpsim to modelica end ****************')
print('************************ convert dpsim to standard end ****************')
print('************************ comparison and assertion start ****************')
res_err=validationtools.compare_timeseries(res_ref,ts_dpsimList)
validationtools.assert_modelica_results(net_name,res_err,threshold)
print('************************ comparison and assertion end ****************')
\ No newline at end of file
TYPE NODENAME NODEID ELEMENTNAME ELEMENTID SWITCH U ANGLEU P Q I ANGLEI LOADING PV QV QCOMP PCOMP TAP RATIO TETA OVERLAP MARGIN BTOT XTOT USERIES ANGLEUSERIES ISHUNT ANGLEISHUNT PEXCH QEXCHSERIES QEXCHSHUNT SLIP TORQUE PFE
0 N0 19 110,000000 0,000000
0 N1 82 19,212000 -7,000000
0 N12 85 19,387000 -5,800000
0 N3 95 17,936000 -9,900000
0 N5 98 17,870000 -10,100000
0 N4 101 17,897000 -10,100000
0 N10 104 17,773000 -10,300000
0 N9 107 17,799000 -10,300000
0 N8 110 17,819000 -10,200000
0 N7 113 17,814000 -10,200000
0 N6 116 17,839000 -10,200000
0 N14 119 19,230000 -5,900000
0 N13 122 19,288000 -5,900000
0 N11 128 17,769000 -10,300000
0 N2 210 18,713000 -8,100000
1 N1 82 LOAD-I-1 1229744362 1 4,845000 1,592000 0,153000 -25,200000 0,000000 0,000000 0,000000 0,000000 0,000000
1 N3 95 LOAD-H-3 235 1 0,276000 0,069000 0,009000 -24,000000 0,000000 0,000000 0,000000 0,000000 0,000000
1 N0 19 SL 16 1 -45,042000 -16,753000 0,252000 159,600000 0,000000 0,000000 0,000000 0,000000 0,000000
1 N12 85 LOAD-H-12 285 1 14,994000 3,045000 0,456000 -17,300000 0,000000 0,000000 0,000000 0,000000 0,000000
1 N3 95 LOAD-I-3 1229744386 1 0,225000 0,140000 0,009000 -41,700000 0,000000 0,000000 0,000000 0,000000 0,000000
1 N10 104 LOAD-H-10 1229744394 1 0,475000 0,119000 0,016000 -24,400000 0,000000 0,000000 0,000000 0,000000 0,000000
1 N13 122 LOAD-I-13 290 1 0,034000 0,021000 0,001000 -37,700000 0,000000 0,000000 0,000000 0,000000 0,000000
1 N1 82 LOAD-H-1 92 1 14,994000 3,045000 0,460000 -18,500000 0,000000 0,000000 0,000000 0,000000 0,000000
1 N4 101 LOAD-H-4 245 1 0,432000 0,108000 0,014000 -24,100000 0,000000 0,000000 0,000000 0,000000 0,000000
1 N12 85 LOAD-I-12 1229744402 1 5,016000 1,649000 0,157000 -24,000000 0,000000 0,000000 0,000000 0,000000 0,000000
1 N14 119 LOAD-H-14 295 1 0,209000 0,052000 0,006000 -20,000000 0,000000 0,000000 0,000000 0,000000 0,000000
1 N5 98 LOAD-H-5 250 1 0,728000 0,182000 0,024000 -24,200000 0,000000 0,000000 0,000000 0,000000 0,000000
1 N11 128 LOAD-H-11 255 1 0,330000 0,083000 0,011000 -24,400000 0,000000 0,000000 0,000000 0,000000 0,000000
1 N10 104 LOAD-I-10 260 1 0,068000 0,042000 0,003000 -42,100000 0,000000 0,000000 0,000000 0,000000 0,000000
1 N9 107 LOAD-I-9 265 1 0,574000 0,356000 0,022000 -42,000000 0,000000 0,000000 0,000000 0,000000 0,000000
1 N6 116 LOAD-H-6 270 1 0,548000 0,137000 0,018000 -24,300000 0,000000 0,000000 0,000000 0,000000 0,000000
1 N14 119 LOAD-I-14 1229744410 1 0,332000 0,205000 0,012000 -37,700000 0,000000 0,000000 0,000000 0,000000 0,000000
1 N7 113 LOAD-I-7 275 1 0,077000 0,047000 0,003000 -42,000000 0,000000 0,000000 0,000000 0,000000 0,000000
1 N8 110 LOAD-H-8 280 1 0,587000 0,147000 0,020000 -24,300000 0,000000 0,000000 0,000000 0,000000 0,000000
1 N1 82 TR0 1229744449 1 -24,407000 -6,197000 0,757000 158,800000 0,000000 0,027500 3,298400 0,000000 0,000000 0 0,00000 0,000
1 N0 19 TR0 1229744449 1 24,434000 9,496000 0,138000 -21,200000 0,000000 0,027500 3,298400 0,000000 0,000000 0 0,00000 0,000
1 N0 19 TR1 1229744470 1 20,607000 7,257000 0,115000 -19,400000 0,000000 0,019100 2,291100 0,000000 0,000000 0 0,00000 0,000
1 N12 85 TR1 1229744470 1 -20,588000 -4,966000 0,631000 160,600000 0,000000 0,019100 2,291100 0,000000 0,000000 0 0,00000 0,000
1 N4 101 L4-5 131 1 1,278000 0,291000 0,042000 -22,900000 0,000000 0,001500 -0,006300 0,000000 0,000000 0,00000
1 N5 98 L4-5 131 1 -1,276000 -0,297000 0,042000 156,700000 0,000000 0,001500 -0,006300 0,000000 0,000000 0,00000
1 N3 95 L3-4 136 1 1,712000 0,394000 0,057000 -22,900000 0,000000 0,002900 -0,005100 0,000000 0,000000 0,00000
1 N4 101 L3-4 136 1 -1,709000 -0,399000 0,057000 156,800000 0,000000 0,002900 -0,005100 0,000000 0,000000 0,00000
1 N11 128 L11-10 146 1 -0,330000 -0,083000 0,011000 155,600000 0,000000 0,000100 -0,004900 0,000000 0,000000 0,00000
1 N10 104 L11-10 146 1 0,330000 0,078000 0,011000 -23,600000 0,000000 0,000100 -0,004900 0,000000 0,000000 0,00000
1 N10 104 L10-9 156 1 -0,873000 -0,239000 0,029000 154,400000 0,000000 0,001000 -0,010100 0,000000 0,000000 0,00000
1 N9 107 L10-9 156 1 0,874000 0,229000 0,029000 -24,900000 0,000000 0,001000 -0,010100 0,000000 0,000000 0,00000
1 N3 95 L3-8 161 1 2,123000 0,746000 0,072000 -29,300000 0,000000 0,010300 -0,005000 0,000000 0,000000 0,00000
1 N8 110 L3-8 161 1 -2,113000 -0,751000 0,073000 150,200000 0,000000 0,010300 -0,005000 0,000000 0,000000 0,00000
1 N8 110 L8-9 171 1 1,449000 0,581000 0,051000 -32,100000 0,000000 0,001200 -0,003000 0,000000 0,000000 0,00000
1 N9 107 L8-9 171 1 -1,448000 -0,584000 0,051000 147,800000 0,000000 0,001200 -0,003000 0,000000 0,000000 0,00000
1 N8 110 L7-8 176 1 0,077000 0,022000 0,003000 -26,400000 0,000000 0,000000 -0,025100 0,000000 0,000000 0,00000
1 N7 113 L7-8 176 1 -0,076000 -0,047000 0,003000 138,000000 0,000000 0,000000 -0,025100 0,000000 0,000000 0,00000
1 N5 98 L5-6 181 1 0,549000 0,115000 0,018000 -22,000000 0,000000 0,000800 -0,022200 0,000000 0,000000 0,00000
1 N6 116 L5-6 181 1 -0,548000 -0,137000 0,018000 155,700000 0,000000 0,000800 -0,022200 0,000000 0,000000 0,00000
1 N12 85 L12-13 186 1 0,578000 0,272000 0,019000 -31,100000 0,000000 0,002700 -0,003800 0,000000 0,000000 0,00000
1 N13 122 L12-13 186 1 -0,576000 -0,276000 0,019000 148,500000 0,000000 0,002700 -0,003800 0,000000 0,000000 0,00000
1 N13 122 L13-14 191 1 0,542000 0,255000 0,018000 -31,100000 0,000000 0,001500 -0,002500 0,000000 0,000000 0,00000
1 N14 119 L13-14 191 1 -0,540000 -0,258000 0,018000 148,600000 0,000000 0,001500 -0,002500 0,000000 0,000000 0,00000
1 N1 82 L1-2 213 1 4,568000 1,560000 0,145000 -25,800000 0,000000 0,089500 0,079700 0,000000 0,000000 0,00000
1 N2 210 L1-2 213 1 -4,478000 -1,480000 0,146000 153,600000 0,000000 0,089500 0,079700 0,000000 0,000000 0,00000
1 N2 210 L2-3 218 1 4,478000 1,480000 0,146000 -26,400000 0,000000 0,141400 0,131500 0,000000 0,000000 0,00000
1 N3 95 L2-3 218 1 -4,337000 -1,349000 0,146000 152,800000 0,000000 0,141400 0,131500 0,000000 0,000000 0,00000
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment