skrf.vectorFitting.VectorFitting.write_spice_subcircuit_s
- VectorFitting.write_spice_subcircuit_s(file, fitted_model_name='s_equivalent', create_reference_pins=False)[source]
Creates an equivalent N-port subcircuit based on its vector fitted scattering (S) parameter responses in spice simulator netlist syntax (compatible with LTspice, ngspice, Xyce, …). The circuit synthesis is based on a direct implementation of the state-space representation of the vector fitted model [1].
- Parameters:
file (str) – Path and filename including file extension (usually .sp) for the subcircuit file.
fitted_model_name (str) – Name of the resulting subcircuit, default “s_equivalent”
create_reference_pins (bool) –
If set to True, the synthesized subcircuit will have N pin-pairs: p1 p1_ref p2 p2_ref … pN pN_ref
If set to False, the synthesized subcircuit will have N pins p1 p2 … pN In this case, the reference nodes will be internally connected to the global ground net 0.
The default is False
- Return type:
None
Examples
Load and fit the Network, then export the equivalent subcircuit:
>>> nw_3port = skrf.Network('my3port.s3p') >>> vf = skrf.VectorFitting(nw_3port) >>> vf.auto_fit() >>> vf.write_spice_subcircuit_s('/my3port_model.sp')
References