electronics.ind_reactance

Functions

ind_reactance(→ dict[str, float])

Calculate inductive reactance, frequency or inductance from two given electrical

Module Contents

electronics.ind_reactance.ind_reactance(inductance: float, frequency: float, reactance: float) dict[str, float]

Calculate inductive reactance, frequency or inductance from two given electrical properties then return name/value pair of the zero value in a Python dict.

Parameters

inductance : float with units in Henries

frequency : float with units in Hertz

reactance : float with units in Ohms

>>> ind_reactance(-35e-6, 1e3, 0)
Traceback (most recent call last):
    ...
ValueError: Inductance cannot be negative
>>> ind_reactance(35e-6, -1e3, 0)
Traceback (most recent call last):
    ...
ValueError: Frequency cannot be negative
>>> ind_reactance(35e-6, 0, -1)
Traceback (most recent call last):
    ...
ValueError: Inductive reactance cannot be negative
>>> ind_reactance(0, 10e3, 50)
{'inductance': 0.0007957747154594767}
>>> ind_reactance(35e-3, 0, 50)
{'frequency': 227.36420441699332}
>>> ind_reactance(35e-6, 1e3, 0)
{'reactance': 0.2199114857512855}