skrf.circuit.reduce_circuit

skrf.circuit.reduce_circuit(connections, check_duplication=True, split_ground=True, split_multi=False, max_nports=20, dynamic_networks=())[source]

Return a reduced equivalent circuit connections with fewer components.

The reduced equivalent circuit connections allows faster calculation of the circuit network.

Parameters:
  • connections (list[list[tuple[Network, int]]].) – The connection list to reduce.

  • check_duplication (bool, optional.) – If True, check if the connections have duplicate names. Default is True.

  • split_ground (bool, optional.) – If True, split the global ground connection to independent ground connections. Default is True.

  • split_multi (bool, optional.) – If True, use a splitter to handle connections involving more than two components. This approach increases the computational load for individual computations. However, it proves advantageous for batch processing by enabling a more comprehensive reduction of circuits, leading to more efficiency in batch computations. Default is False.

  • max_nports (int, optional.) – 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 (Sequence[Network], optional.) – A sequence of Networks to ignore in the reduction process. Default is an empty tuple.

Returns:

reduced_cnxs – The reduced connections.

Return type:

list.

Examples

>>> import skrf as rf
>>> import numpy as np
>>> circuit = rf.circuit.Circuit(connections)
>>> reduced_cnxs = rf.reduce_circuit(connections)
>>> reduced_circuit = rf.circuit.Circuit(reduced_cnxs)
>>> ntwkA = circuit.network
>>> ntwkB = reduced_circuit.network
>>> np.allclose(ntwkA.s, ntwkB.s)
True