Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions impedance/models/circuits/elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand All @@ -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


Expand Down
15 changes: 12 additions & 3 deletions impedance/tests/test_circuit_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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])
Expand Down