skrf.vectorFitting.VectorFitting.write_spice_subcircuit_s¶
- VectorFitting.write_spice_subcircuit_s(file, fitted_model_name='s_equivalent')[source]¶
Creates an equivalent N-port SPICE subcircuit based on its vector fitted S parameter responses.
- Parameters
file (str) – Path and filename including file extension (usually .sp) for the SPICE subcircuit file.
fitted_model_name (str) – Name of the resulting model, default “s_equivalent”
- Return type
None
Notes
In the SPICE subcircuit, all ports will share a common reference node (global SPICE ground on node 0). The equivalent circuit uses linear dependent current sources on all ports, which are controlled by the currents through equivalent admittances modelling the parameters from a vector fit. This approach is based on 1.
Examples
Load and fit the Network, then export the equivalent SPICE subcircuit:
>>> nw_3port = skrf.Network('my3port.s3p') >>> vf = skrf.VectorFitting(nw_3port) >>> vf.vector_fit(n_poles_real=1, n_poles_cmplx=4) >>> vf.write_spice_subcircuit_s('/my3port_model.sp')
References
- 1
G. Antonini, “SPICE Equivalent Circuits of Frequency-Domain Responses”, IEEE Transactions on Electromagnetic Compatibility, vol. 45, no. 3, pp. 502-512, August 2003, DOI: https://doi.org/10.1109/TEMC.2003.815528