Creating a circuit¶
Define from string¶
The most convenient method is to define a circuit with a string
Here:
R1means a resistorRwith label1R2means a resistorRwith label2C2means a capacitorCwith label2- A hyphen
x-ymeans elementxandyare in series - Brackets
(x,y)mean elementxandyare in parallel
Labels can be any number, as long as elements do not have the same type and label.
Circuits can be arbitrarily nested and complex.
See Element in the API reference for the available elements.
E.g. for a suppressed two arc circuit with finite length Warburg diffusion:
Setting parameter values¶
Use with_values(...) and supply a list of values in order of elements and their attributes:
Or use with_named_values(...) and supply a dict of "{element}.{attribute}": value:
Define from Python objects¶
You can also create a circuit from element objects directly by giving Series
and Parallel lists of Element objects.
The Element objects accept positional or named arguments, e.g. R(10.0) and
R(r=10.0) are both valid.