Compound Elements¶
Several compound elements defined based on other basic elements.
Optocoupler¶
schemdraw.elements.compound.Optocoupler can be drawn with or without a base contact.
Optocoupler
Optocoupler(base=True)
Relay¶
schemdraw.elements.compound.Relay can be drawn with different options for switches and inductor solenoids.
Relay
Relay(switch=’spdt’)
Relay(swithc=’dpst’)
Relay(switch=’dpdt’)
Wheatstone¶
schemdraw.elements.compound.Wheatstone can be drawn with or without the output voltage taps.
The labels argument specifies a list of labels for each resistor.
Wheatstone
Wheatstone(vout=True)
Rectifier¶
schemdraw.elements.compound.Rectifier draws four diodes at 45 degree angles.
The labels argument specifies a list of labels for each diode.
Rectifier
Two-ports¶
Twoport elements share the interface defined by schemdraw.elements.twoports.ElementTwoport, providing a set of anchors and various styling options. The terminals and box can be enabled or disabled using the terminals and box arguments. In addition, the boxfill, boxlw, and boxls provide the option to style the outline separately from other elements.
TwoPort
TwoPort(terminals=False, boxlw=3)
Generic¶
TwoPort
TwoPort(reverse_output=True)
TwoPort(arrow=False)
TwoPort(sign=False)
Transactors (ideal amplifiers)¶
Like the generic twoport, the transactors provide the option to reverse the direction of the output or current using the reverse_output argument.
VoltageTransactor
TransimpedanceTransactor
TransadmittanceTransactor
CurrentTransactor
Pathological¶
Nullor
VMCMPair
Custom¶
The schemdraw.elements.twoports.ElementTwoport class can be used to define custom twoports by specifying an input_element and output_element. The bpadx, bpady, minw, unit, width can be used to tune the horizontal and vertical padding, minimum width of the elements, length of components, and width of the twoport respectively.
elm.ElementTwoport(
input_element=elm.Inductor2,
output_element=elm.SwitchReed,
unit=2.5, width=2.5)
elm.ElementTwoport(
input_element=elm.Lamp,
output_element=partial(elm.Photodiode, reverse=True, flip=True),
width=3)