Qu

circuit_impedance

Builtin index

What it is

No chapter describes this one yet. It exists -- the name comes from the interpreter's own table -- but the prose has not been written. That is a gap in the documentation, not in the engine.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
no inputnot documented yet—

Examples

From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.

f = logspace(-1, 5, 61)                              # 0.1 Hz .. 100 kHz

z = circuit_impedance("R-p(R-W,C)", f, [10, 100, 50, 1e-5])
m = circuit_fit(f, z, "R-p(R-W,C)")
print("Rs  = {m.R1}")                                # 10

print("Rct = {m.R2} +- {m.stderr[1]}")               # 100

print("{m.chi2_red}")
zi = m.predict(logspace(-2, 6, 200))                 # any axis, in Hz

output
Rs  = 10
Rct = 100 +- 1.100815e-15
1.883163e-33

from signal-processing

How it works

circuit_impedance(expr, f, theta) -- spec string straight to spectrum, in one call. This exists as its own builtin rather than as sugar for impedance(circuit(expr, theta), f) because of what it is FOR: papers/ecm-pf's cross-language check runs the same circuits through a Python implementation, a Qu library implementation and this one, and compares. Taking the STRING (not a circuit value built by a shared parser) is what keeps the columns independent -- if two of them shared a parser, a parser bug would cancel out of the comparison and the check would pass with both columns wrong. Argument order and Hz are that suite's, adopted rather than invented.

From the note above this builtin in the interpreter, where the reasoning was written down as it was built.