skrf.network.parallelconnect
- skrf.network.parallelconnect(ntwks, ports, name=None)[source]
Connects a series of multi-port networks in parallel, ensuring that the specified port indices share the concatenated intersection.
- Parameters:
ntwks (:Sequence[Network] | Network) – A sequence of multi-port networks or a single network to be connected in parallel.
ports (Sequence[int | Sequence[int]]) – A sequence of port indices, where each entry can be an int or a sequence of ints corresponding to the ports of the respective network. The length of ports should match the length of networks. Each specified port index is connect to the concatenated intersection, implying they are electrically common.
name (str, optional) – define the connected network’s name. Default is None.
- Returns:
connected_network – A new network created from the parallel connection of the input networks. The number of ports in the resulting network equals the sum of ports in ntwks, minus the number of ports specified in ports that were connected in parallel. The remaining ports follow the original port order of the input networks, after removing those involved in the parallel connection.
- Return type:
Note
This function calculates the resulting scattering parameters after parallel connecting a set of networks. This algorithm [1], adapted from the Circuit.s method, constructs the concatenated intersection matrix [X] and the global scattering matrix [C] to perform the calculations.
See also
connect_sactual S-parameter connection algorithm.
innerconnect_sactual S-parameter connection algorithm.
innerconnect_s_lstsqactual S-parameter connection algorithm using lstsq.
Examples
The following examples demonstrate how to use the
parallelconnect()in different ways, such as open a port, connect two networks, innerconnect one network, and parallel multiple networks.>>> # Prepare the example Networks >>> ntwkA = rf.Network('ntwkA.s2p') >>> ntwkB = rf.Network('ntwkB.s2p') >>> ntwkC = rf.connect('ntwkC.s4p') >>> >>> # 1) Open port 1 of ntwkA >>> # +-----+ >>> # [0] A [1]--Open >>> # +-----+ >>> # >>> rf.parallelconnect(ntwkA, [1]) >>> >>> >>> # 2) Connect ntwkA's port 1 to ntwkB's port 0 >>> # +-----+ +-----+ >>> # [0] A [1]---[0] B [1] >>> # +-----+ +-----+ >>> # >>> rf.parallelconnect([ntwkA, ntwkB], [1, 0]) >>> >>> >>> # 3) Innerconnect the ntwkC's port 1 and 3 >>> # +-----+ >>> # | [1]--+ >>> # [0] C [2] | >>> # | [3]--+ >>> # +-----+ >>> # >>> rf.parallelconnect(ntwkC, [[2, 3]]) >>> >>> >>> # 4) Parallel connect the ntwkA's port 1, ntwkB's port 1 and ntwkC's port 0 >>> # +-----+ >>> # [0] A [1]---+ +-----+ >>> # +-----+ | | [1] >>> # |---[0] C [2] >>> # +-----+ | | [3] >>> # [0] B [1]---+ +-----+ >>> # +-----+ >>> # >>> rf.parallelconnect([ntwkA, ntwkB, ntwkC], [1, 1, 0]) >>> >>> >>> # 5) The port order of connected ntwk follows the order of ntwks and ports >>> # as shown in example 4: >>> # +-----+ >>> # [0] A [1]---+ +-----+ +---------------+ >>> # +-----+ | | [1] [0]=A[0] C[3]=[3] >>> # |---[0] C [2] ===> [1]=B[0] | >>> # +-----+ | | [3] [2]=C[1] C[3]=[4] >>> # [0] B [1]---+ +-----+ +---------------+ >>> # +-----+
References