diff --git a/impedance/models/circuits/elements.py b/impedance/models/circuits/elements.py index fa067407..d72009ec 100644 --- a/impedance/models/circuits/elements.py +++ b/impedance/models/circuits/elements.py @@ -208,7 +208,7 @@ def CPE(p, f): return Z -@element(num_params=2, units=["H sec", ""]) +@element(num_params=2, units=["H sec^(a - 1)", ""]) def La(p, f): """defines a modified inductance element as represented in [1] @@ -225,7 +225,7 @@ def La(p, f): """ omega = 2 * np.pi * np.array(f) L, alpha = p[0], p[1] - Z = (L * 1j * omega) ** alpha + Z = L * (1j * omega) ** alpha return Z diff --git a/impedance/tests/test_circuit_elements.py b/impedance/tests/test_circuit_elements.py index 5276c44e..d0199372 100644 --- a/impedance/tests/test_circuit_elements.py +++ b/impedance/tests/test_circuit_elements.py @@ -40,9 +40,9 @@ def test_each_element(): (1.6541327179718126 - 0.537460300252313j), ], "La": [ - (0.21769191 + 0.07073239j), - (0.86664712 + 0.28159072j), - (3.45018434 + 1.12103285j), + (0.03450184 + 0.01121033j), + (0.13735431 + 0.04462912j), + (0.54681737 + 0.17767173j), ], "G": [ (0.09999994078244179 - 0.00006283179105931961j), @@ -98,6 +98,15 @@ def test_each_element(): circuit_elements["T"]([1, 2, 50, 100], [10000]) +def test_La_linear_in_L(): + # Z = L * (j omega)^alpha, so doubling L must double Z for any alpha + freqs = [0.001, 1.0, 1000] + La = circuit_elements["La"] + Z1 = La([0.1, 0.7], freqs) + Z2 = La([0.2, 0.7], freqs) + assert np.isclose(Z2, 2 * Z1).all() + + def test_s(): a = np.array([5 + 6 * 1j, 2 + 3 * 1j]) b = np.array([5 + 6 * 1j, 2 + 3 * 1j])