diff --git a/dataprocessing/dpsim.py b/dataprocessing/dpsim.py new file mode 100644 index 0000000000000000000000000000000000000000..c877d25af9f17c552dc95d6d4cb4616de724551c --- /dev/null +++ b/dataprocessing/dpsim.py @@ -0,0 +1,16 @@ +from dataprocessing.readtools import * +from dataprocessing.timeseries import * + +def get_node_voltage_phasors(dpsim_timeseries_list): + """Calculate voltage phasors of all nodes + :param dpsim_timeseries_list: timeseries list retrieved from dpsim results + :return: + """ + voltage_phasor_list = {} + for ts in dpsim_timeseries_list: + ts_abs = ts.abs(ts.name + '_abs') + ts_phase = ts.phase(ts.name + '_phase') + ts_phasor = [ts_abs, ts_phase] + voltage_phasor_list[ts.name] = ts_phasor + + return voltage_phasor_list diff --git a/dataprocessing/timeseries.py b/dataprocessing/timeseries.py index 83b979ac8c1001a5acef7ddee943ba98a443c7f6..267832f26f6cb564fea4fe0e7e64586d9aafea8e 100644 --- a/dataprocessing/timeseries.py +++ b/dataprocessing/timeseries.py @@ -32,14 +32,6 @@ class TimeSeries: ts_scaled = TimeSeries(name, self.time, self.values * factor) return ts_scaled - @staticmethod - def complex_abs_dep(name, ts_real, ts_imag): - """ Calculate absolute value of complex variable. - Assumes the same time steps for both timeseries. - """ - ts_abs = TimeSeries(name, ts_real.time, np.sqrt(ts_real.values ** 2 + ts_imag.values ** 2)) - return ts_abs - @staticmethod def complex_abs(name, ts_real, ts_imag): """ Calculate absolute value of complex variable.