power_quantities¶
- typhoon.test.IEC61000.power_quantities(voltage_samples: Series, current_samples: Series, nominal_grid_freq: float, reference_split=None)¶
This method measures power quantities in single-phase systems under non-sinusoidal conditions (general case) according to IEC 61000-1-7. This method is applied only in grids with a nominal frequency of 50.0 Hz or 60.0 Hz.
- Parameters:
voltage_samples (pandas.DataFrame) – Samples of voltage data captured from simulation.
current_samples (pandas.DataFrame) – Samples of current data captured from simulation.
nominal_grid_freq (float) – Nominal frequency of the grid (in Hz).
reference_split (list, optional) – List of indices to split the sample in windows. If None, the samples will be split according to the zero-crossings of the voltage signal.
- Returns:
df_measurements – With the follow columns:
Active power: Active power calculated over the entire signal.
Apparent power: Apparent power calculated over the entire signal.
Non-active power: Non-active power (reactive power + distortion power) calculated over the entire signal.
Power factor: Power factor calculated over the entire signal.
Fundamental active power: Active power calculated over the fundamental frequency component.
Fundamental apparent power: Apparent power calculated over the fundamental frequency component.
Reactive power: Reactive power calculated over the fundamental frequency component.
Fundamental power factor: Power factor calculated over the fundamental frequency component.
Distortion active power: Active power due to harmonic distortion.
Non-fundamental power factor: Power factor calculated over the non-fundamental frequency components.
Non-fundamental apparent power: Apparent power calculated over the non-fundamental frequency components.
Distortion reactive power: Reactive power due to harmonic distortion.
- Return type:
pandas.DataFrame
- Raises:
ValueError – When the
nominal_grid_freq
is different from 50 Hz or 60 Hz:
Examples
>>> from typhoon.test.signals import pandas_sine >>> from typhoon.test.IEC61000 import power_quantities >>> >>> frequency = 50 >>> voltage_samples = pandas_sine(phase=0, frequency=frequency) >>> current_samples = pandas_sine(phase=90, frequency=frequency) >>> >>> df_measurements = power_quantities(voltage_samples, current_samples, frequency)
You can type
df_measurements.columns
to check the name of each one. Or you can usedf_measurements.iloc[:, i]
wherei
is the column number desired. To select each one of the columns in a pandas.Series:>>> active_power = df_measurements['Active power'] >>> apparent_power = df_measurements['Apparent power'] >>> non_active_power = df_measurements['Non-active power'] >>> power_factor = df_measurements['Power factor'] >>> fundamental_active_power = df_measurements['Fundamental active power'] >>> fundamental_apparent_power = df_measurements['Fundamental apparent power'] >>> reactive_power = df_measurements['Reactive power'] >>> fundamental_power_factor = df_measurements['Fundamental power factor'] >>> distortion_active_power = df_measurements['Distortion active power'] >>> non_fundamental_power_factor = df_measurements['Non-fundamental power factor'] >>> non_fundamental_apparent_power = df_measurements['Non-fundamental apparent power'] >>> distortion_reactive_power = df_measurements['Distortion reactive power']