engineeringkit.electrical_engineering#

DC and AC circuits, transients, RLC resonance and electrical power.

Electrical engineering fundamentals from Ohm/Kirchhoff through AC and transmission lines.

class engineeringkit.electrical_engineering.CircuitResult(t, response)[source]#

Bases: object

Parameters:
  • t (ndarray)

  • response (ndarray)

plot()[source]#
response: ndarray#
summary()[source]#
t: ndarray#
class engineeringkit.electrical_engineering.SeriesRLC(resistance, inductance, capacitance)[source]#

Bases: object

Parameters:
  • resistance (float)

  • inductance (float)

  • capacitance (float)

capacitance: float#
inductance: float#
resistance: float#
step_response(T=None)[source]#

Current [A] for a 1 V step, initially uncharged/unenergized.

transfer_function()[source]#

Current/voltage transfer I(s)/V(s); SI output A/V, zero initial energy.

engineeringkit.electrical_engineering.capacitor_impedance(C, omega)[source]#

Capacitor impedance.

Parameters:
  • C (F) – Input in the units stated above.

  • omega (rad/s) – Input in the units stated above.

Returns:

complex ohm.

Return type:

result

Notes

Assumptions, governing equations and validity limits are discussed in Electrical engineering: passive components and circuit responses. SI inputs are required; raw numbers carry no dimensional metadata.

engineeringkit.electrical_engineering.capacitors_parallel(*c)[source]#

Capacitors parallel.

Parameters:

c (F) – Input in the units stated above.

Returns:

Return type:

result

Notes

Assumptions, governing equations and validity limits are discussed in Electrical engineering: passive components and circuit responses. SI inputs are required; raw numbers carry no dimensional metadata.

engineeringkit.electrical_engineering.capacitors_series(*c)[source]#

Capacitors series.

Parameters:

c (F) – Input in the units stated above.

Returns:

Return type:

result

Notes

Assumptions, governing equations and validity limits are discussed in Electrical engineering: passive components and circuit responses. SI inputs are required; raw numbers carry no dimensional metadata.

engineeringkit.electrical_engineering.inductor_impedance(L, omega)[source]#

Inductor impedance.

Parameters:
  • L (H) – Input in the units stated above.

  • omega (rad/s) – Input in the units stated above.

Returns:

complex ohm.

Return type:

result

Notes

Assumptions, governing equations and validity limits are discussed in Electrical engineering: passive components and circuit responses. SI inputs are required; raw numbers carry no dimensional metadata.

engineeringkit.electrical_engineering.maximum_power_transfer(vth, rth)[source]#

Matched resistive load and maximum delivered power for a Thévenin source.

Parameters:
  • vth (V) – Input in the units stated above.

  • rth (ohm) – Input in the units stated above.

Returns:

(matched resistance [ohm], power [W]).

Return type:

result

Notes

Assumptions, governing equations and validity limits are discussed in Electrical engineering: passive components and circuit responses. SI inputs are required; raw numbers carry no dimensional metadata.

engineeringkit.electrical_engineering.norton_from_thevenin(vth, rth)[source]#

Norton from thevenin.

Parameters:
  • vth (V) – Input in the units stated above.

  • rth (ohm) – Input in the units stated above.

Returns:

(current [A], resistance [ohm]).

Return type:

result

Notes

Assumptions, governing equations and validity limits are discussed in Electrical engineering: passive components and circuit responses. SI inputs are required; raw numbers carry no dimensional metadata.

engineeringkit.electrical_engineering.ohms_law(voltage=None, current=None, resistance=None)[source]#

Ohms law.

Parameters:
  • voltage (V) – Input in the units stated above.

  • current (A) – Input in the units stated above.

  • resistance (ohm) – Input in the units stated above.

Returns:

missing voltage [V], current [A], or resistance [ohm].

Return type:

result

Notes

Assumptions, governing equations and validity limits are discussed in Electrical engineering: passive components and circuit responses. SI inputs are required; raw numbers carry no dimensional metadata.

engineeringkit.electrical_engineering.parallel_resistance(*r)[source]#

Parallel resistance.

Parameters:

r (ohm) – Input in the units stated above.

Returns:

ohm.

Return type:

result

Notes

Assumptions, governing equations and validity limits are discussed in Electrical engineering: passive components and circuit responses. SI inputs are required; raw numbers carry no dimensional metadata.

engineeringkit.electrical_engineering.power_factor(real_power_value, apparent_power)[source]#

Power factor.

Parameters:
  • real_power_value (W) – Input in the units stated above.

  • apparent_power (VA) – Input in the units stated above.

Returns:

Return type:

result

Notes

Assumptions, governing equations and validity limits are discussed in Electrical engineering: passive components and circuit responses. SI inputs are required; raw numbers carry no dimensional metadata.

engineeringkit.electrical_engineering.rc_charging_voltage(v_source, R, C, t, v0=0.0)[source]#

Rc charging voltage.

Parameters:
  • v_source (V) – Input in the units stated above.

  • R (ohm) – Input in the units stated above.

  • C (F) – Input in the units stated above.

  • t (s) – Input in the units stated above.

  • v0 (V) – Input in the units stated above.

Returns:

Return type:

result

Notes

Assumptions, governing equations and validity limits are discussed in Electrical engineering: passive components and circuit responses. SI inputs are required; raw numbers carry no dimensional metadata.

engineeringkit.electrical_engineering.rc_time_constant(R, C)[source]#

Rc time constant.

Parameters:
  • R (ohm) – Input in the units stated above.

  • C (F) – Input in the units stated above.

Returns:

Return type:

result

Notes

Assumptions, governing equations and validity limits are discussed in Electrical engineering: passive components and circuit responses. SI inputs are required; raw numbers carry no dimensional metadata.

engineeringkit.electrical_engineering.reactive_power(v_rms, i_rms, phase_rad)[source]#

Reactive power.

Parameters:
  • v_rms (V) – Input in the units stated above.

  • i_rms (A) – Input in the units stated above.

  • phase_rad (rad) – Input in the units stated above.

Returns:

var.

Return type:

result

Notes

Assumptions, governing equations and validity limits are discussed in Electrical engineering: passive components and circuit responses. SI inputs are required; raw numbers carry no dimensional metadata.

engineeringkit.electrical_engineering.real_power(v_rms, i_rms, pf=1)[source]#

Real power.

Parameters:
  • v_rms (V) – Input in the units stated above.

  • i_rms (A) – Input in the units stated above.

  • pf (1) – Input in the units stated above.

Returns:

Return type:

result

Notes

Assumptions, governing equations and validity limits are discussed in Electrical engineering: passive components and circuit responses. SI inputs are required; raw numbers carry no dimensional metadata.

engineeringkit.electrical_engineering.resonance_frequency(L, C)[source]#

Resonance frequency.

Parameters:
  • L (H) – Input in the units stated above.

  • C (F) – Input in the units stated above.

Returns:

Hz.

Return type:

result

Notes

Assumptions, governing equations and validity limits are discussed in Electrical engineering: passive components and circuit responses. SI inputs are required; raw numbers carry no dimensional metadata.

engineeringkit.electrical_engineering.rl_time_constant(L, R)[source]#

Rl time constant.

Parameters:
  • L (H) – Input in the units stated above.

  • R (ohm) – Input in the units stated above.

Returns:

Return type:

result

Notes

Assumptions, governing equations and validity limits are discussed in Electrical engineering: passive components and circuit responses. SI inputs are required; raw numbers carry no dimensional metadata.

engineeringkit.electrical_engineering.rms_sine(amplitude)[source]#

Rms sine.

Parameters:

amplitude (V) – Input in the units stated above.

Returns:

same amplitude units as input.

Return type:

result

Notes

Assumptions, governing equations and validity limits are discussed in Electrical engineering: passive components and circuit responses. SI inputs are required; raw numbers carry no dimensional metadata.

engineeringkit.electrical_engineering.series_resistance(*r)[source]#

Series resistance.

Parameters:

r (ohm) – Input in the units stated above.

Returns:

ohm.

Return type:

result

Notes

Assumptions, governing equations and validity limits are discussed in Electrical engineering: passive components and circuit responses. SI inputs are required; raw numbers carry no dimensional metadata.

engineeringkit.electrical_engineering.series_rlc_impedance(R, L, C, omega)[source]#

Series rlc impedance.

Parameters:
  • R (ohm) – Input in the units stated above.

  • L (H) – Input in the units stated above.

  • C (F) – Input in the units stated above.

  • omega (rad/s) – Input in the units stated above.

Returns:

complex ohm.

Return type:

result

Notes

Assumptions, governing equations and validity limits are discussed in Electrical engineering: passive components and circuit responses. SI inputs are required; raw numbers carry no dimensional metadata.

engineeringkit.electrical_engineering.thevenin_from_source(vs, rs)[source]#

Thevenin from source.

Parameters:
  • vs (V) – Input in the units stated above.

  • rs (ohm) – Input in the units stated above.

Returns:

(voltage [V], resistance [ohm]).

Return type:

result

Notes

Assumptions, governing equations and validity limits are discussed in Electrical engineering: passive components and circuit responses. SI inputs are required; raw numbers carry no dimensional metadata.

engineeringkit.electrical_engineering.three_phase_power(v_line, i_line, pf=1)[source]#

Three phase power.

Parameters:
  • v_line (V) – Input in the units stated above.

  • i_line (A) – Input in the units stated above.

  • pf (1) – Input in the units stated above.

Returns:

Return type:

result

Notes

Assumptions, governing equations and validity limits are discussed in Electrical engineering: passive components and circuit responses. SI inputs are required; raw numbers carry no dimensional metadata.

engineeringkit.electrical_engineering.transformer_secondary(v_primary, n_primary, n_secondary)[source]#

Transformer secondary.

Parameters:
  • v_primary (V) – Input in the units stated above.

  • n_primary (1) – Input in the units stated above.

  • n_secondary (1) – Input in the units stated above.

Returns:

Return type:

result

Notes

Assumptions, governing equations and validity limits are discussed in Electrical engineering: passive components and circuit responses. SI inputs are required; raw numbers carry no dimensional metadata.

engineeringkit.electrical_engineering.transmission_line_velocity(L_per_m, C_per_m)[source]#

Transmission line velocity.

Parameters:
  • L_per_m (H/m) – Input in the units stated above.

  • C_per_m (F/m) – Input in the units stated above.

Returns:

m/s.

Return type:

result

Notes

Assumptions, governing equations and validity limits are discussed in Electrical engineering: passive components and circuit responses. SI inputs are required; raw numbers carry no dimensional metadata.

engineeringkit.electrical_engineering.transmission_line_z0(L_per_m, C_per_m)[source]#

Transmission line z0.

Parameters:
  • L_per_m (H/m) – Input in the units stated above.

  • C_per_m (F/m) – Input in the units stated above.

Returns:

ohm.

Return type:

result

Notes

Assumptions, governing equations and validity limits are discussed in Electrical engineering: passive components and circuit responses. SI inputs are required; raw numbers carry no dimensional metadata.

engineeringkit.electrical_engineering.wheatstone_balanced(r1, r2, r3, r4, rtol=1e-09)[source]#

Wheatstone balanced.

Parameters:
  • r1 (ohm) – Input in the units stated above.

  • r2 (ohm) – Input in the units stated above.

  • r3 (ohm) – Input in the units stated above.

  • r4 (ohm) – Input in the units stated above.

  • rtol (1) – Input in the units stated above.

Returns:

bool.

Return type:

result

Notes

Assumptions, governing equations and validity limits are discussed in Electrical engineering: passive components and circuit responses. SI inputs are required; raw numbers carry no dimensional metadata.