twpasolver.models.compose module#

Direct composition between models.

twpasolver.models.compose.compose(*args: LosslessTL | StubBaseCell | LCLfBaseCell | OnePortArray | TwoPortArray | TWPA | Resistance | Capacitance | Inductance | Stub, parallel=False, **kwargs) TwoPortArray | OnePortArray[source]#

Directly compose any number of OnePortModel or TwoPortModels into a ModelArray.

If all the provided instances are OnePortModels with the same parallel/series configuration in a two-port circuit, the resulting composition will be given by a OnePortArray. Otherwise a TwoPortArray will be returned.

Parameters:
  • *args (AnyModel) – Any number of OnePortModel or TwoPortModel instances to be composed.

  • parallel (bool, optional) – Indicates if the OnePortModels should be composed in parallel. Defaults to False. Applies only if a composition to OnePortModel is possible.

  • **kwargs – Additional keyword arguments to pass to the OnePortArray or TwoPortArray constructors.