Skip to content
Snippets Groups Projects
Commit f7c1019a authored by Junjie Zhang's avatar Junjie Zhang
Browse files

add converting dpsim ts to modelica ts

parent 20fee08f
No related branches found
No related tags found
No related merge requests found
{
"python.pythonPath": "D:\\Anaconda3\\python.exe"
}
\ No newline at end of file
......@@ -3,7 +3,7 @@
import os
from readtools import *
from .readtools import *
"""
The validationtools are used to validate the simulate results from the model.
......@@ -83,6 +83,20 @@ def convert_simulink_to_modelica_timeseries(simseri):
res.append(simseri[check])
return res
def convert_dpsim_to_modelica_timeseries(dpsim_timeseries):
"""
Convert the steady-state results timeseries from dpsim to modelica timeseries
:param dpsim_timeseries: dict of dpsim timeseries, generated by the csv result file from dpsim
:return: a list of dpsim timeseries
"""
ts_dpsimList=[]
for ts,values in dpsim_timeseries.items():
ts_abs = values.abs(ts + '.Vpp')
ts_phase = values.phase(ts + '.Vangle')
ts_phase.values*=np.pi/180
ts_dpsimList.append(ts_abs)
ts_dpsimList.append(ts_phase)
return ts_dpsimList
def compare_timeseries(ts1, ts2):
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment