Vector fitting of delayed pole-residue models for electromagnetic transient (EMT) simulation: rational fitting, universal line models with searched modal delays, and passivity assessment and enforcement, on plain NumPy arrays.
Documentation: examples, guide, benchmarks and API.
pip install pyvectorfitimport numpy as np
import pyvectorfit as vf
f = np.geomspace(1, 1e6, 121) # Hz
s = 2j * np.pi * f[:, None, None]
r = 3e-5 * np.sqrt(1 + s / (2 * np.pi * 1e3)) # ohm/m, with skin effect
z = r * np.eye(2) + s * 1e-6 * np.array([[1.6, 0.5], [0.5, 1.6]]) # ohm/m
y = 1e-11 + s * 1e-12 * np.array([[8, -2], [-2, 8]]) # S/m
line, report = vf.fit_line(f, z, y, length=80e3)
line, correction = vf.enforce_passivity(line, f)
print(line.h.delays) # sLine constants z and y come from any line constants program. For overhead lines,
OpenLine computes them from conductor and structure catalogs.
Luke Lowery, PhD student in the Birchfield Research Group at Texas A&M University · Google Scholar · ORCID
Also by the author: OpenLine, overhead transmission line modeling · latkit, GPU visualization of large networks · sgwt, sparse graph convolution for power systems · gridkit-studio, a VS Code extension for GridKit