skrf.circuit.Circuit.__init__
- Circuit.__init__(connections, name=None, *, auto_reduce=False, **kwargs)[source]
Circuit constructor. Creates a circuit made of a set of N-ports networks.
- Parameters:
connections (list of list of tuples) – Description of circuit connections. Each connection is a described by a list of tuple. Each tuple contains (network, network_port_nb). Port number indexing starts from zero. Network’s port not explicitly listed will be treated as matched. Network’s port listed individually will be treated as open.
name (string, optional) – Name assigned to the circuit (Network). Default is None.
auto_reduce (bool, optional) – If True, the circuit will be automatically reduced using
reduce_circuit()
. This will change the circuit connections description, affecting inner current and voltage distributions. Suitable for cases where only the S-parameters of the final circuit ports are of interest. Default is False. If check_duplication, split_ground or max_nports are provided as kwargs, auto_reduce will be automatically set to True, as this indicates an intent to use the reduce_circuit method.**kwargs –
keyword arguments passed to reduce_circuit method.
check_duplication kwarg controls whether to check the connections have duplicate names. Default is True.
split_ground kwarg controls whether to split the global ground connection to independant. Default is False.
max_nports kwarg controls the maximum number of ports of a Network that can be reduced in circuit. If a Network in the circuit has a number of ports (nports), using the Network.connect() method to reduce the circuit’s dimensions becomes less efficient compared to directly calculating it with Circuit.s_external. This value depends on the performance of the computer and the scale of the circuit. Default is 20.
dynamic_networks kwarg is a sequence of Networks to be skipped during the reduction process. Default is an empty tuple.
- Return type:
None
Examples
Example of connections between two 1-port networks:
connections = [ [(network1, 0), (network2, 0)], ]
Example of a connection between three 1-port networks connected to a single node:
connections = [ [(network1, 0), (network2, 0), (network3, 0)] ]
Example of a connection between two 1-port networks (port1 and port2) and two 2-ports networks (ntw1 and ntw2):
connections = [ [(port1, 0), (ntw1, 0)], [(ntw1, 1), (ntw2, 0)], [(ntw2, 1), (port2, 0)] ]
Example of a connection between three 1-port networks (port1, port2 and port3) and a 3-ports network (ntw):
connections = [ [(port1, 0), (ntw, 0)], [(port2, 0), (ntw, 1)], [(port3, 0), (ntw, 2)] ]
Example of a connection between three 1-port networks (port1, port2 and open) and a 3-ports network (ntw):
connections = [ [(port1, 0), (ntw, 0)], [(open, 0), (ntw, 1)], [(port2, 0), (ntw, 2)] ] # or equivalently connections = [ [(port1, 0), (ntw, 0)], [(ntw, 1)], [(port2, 0), (ntw, 2)] ]
Example of a connection between three 1-port networks (port1, port2 and match) and a 3-ports network (ntw):
connections = [ [(port1, 0), (ntw, 0)], [(match, 0), (ntw, 1)], [(port2, 0), (ntw, 2)] ] # or equivalently connections = [ [(port1, 0), (ntw, 0)], [(port2, 0), (ntw, 2)] ]
NB1: Creating 1-port network to be used as a port should be made with
Port()
NB2: The external ports indexing is defined by the order of appearance of the ports in the connections list. Thus, the first network identified as a port will be the 1st port of the resulting network (index 0), the second network identified as a port will be the second port (index 1), etc.
NB3: When a port of a network is listed individually in the connections, the circuit will treat this port with a reflection coefficient of 1, equivalent to an Open. Conversely, if a port is not explicitly included in the connections,the circuit will treat it as matched.