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

../_images/compound_1_0.svg

Optocoupler(base=True)

../_images/compound_2_0.svg

Relay

schemdraw.elements.compound.Relay can be drawn with different options for switches and inductor solenoids.

Relay

../_images/compound_3_0.svg

Relay(switch=’spdt’)

../_images/compound_4_0.svg

Relay(swithc=’dpst’)

../_images/compound_5_0.svg

Relay(switch=’dpdt’)

../_images/compound_6_0.svg

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

../_images/compound_7_0.svg

Wheatstone(vout=True)

../_images/compound_8_0.svg

Rectifier

schemdraw.elements.compound.Rectifier draws four diodes at 45 degree angles. The labels argument specifies a list of labels for each diode.

Rectifier

../_images/compound_9_0.svg

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

../_images/compound_10_0.svg

TwoPort(terminals=False, boxlw=3)

../_images/compound_11_0.svg

Generic

TwoPort

../_images/compound_12_0.svg

TwoPort(reverse_output=True)

../_images/compound_13_0.svg

TwoPort(arrow=False)

../_images/compound_14_0.svg

TwoPort(sign=False)

../_images/compound_15_0.svg

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

../_images/compound_16_0.svg

TransimpedanceTransactor

../_images/compound_17_0.svg

TransadmittanceTransactor

../_images/compound_18_0.svg

CurrentTransactor

../_images/compound_19_0.svg

Pathological

Nullor

../_images/compound_20_0.svg

VMCMPair

../_images/compound_21_0.svg

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)
../_images/compound_22_0.svg
elm.ElementTwoport(
    input_element=elm.Lamp,
    output_element=partial(elm.Photodiode, reverse=True, flip=True),
    width=3)
../_images/compound_23_0.svg