Compatibility

Subcircuit with parameters

Some simulators (LTspice, Pspice) accept a syntax for subcircuits that is incompatible with gnucap.

Subcircuit instantiation syntax

LTspice syntax:

Xv   v1r v1i      vri_slack params: ( vr=10  vi=1  on=1 vfactor=1.732 )
Ximp v1r v1i 0 0  impedance params: ( r=1 xl=10 xc=2 length=1 zfactor=1 )

The key params: should be omitted.
Gnucap syntax:

Xv   v1r v1i      vri_slack ( vr=10  vi=1  on=1 vfactor=1.732 )
Ximp v1r v1i 0 0  impedance ( r=1 xl=10 xc=2 length=1 zfactor=1 )

Subcircuit declaration syntax

LTspice syntax:

.subckt impedance v1r v1i v2r v2i
+ params:
+ on = 1
+ r = 100
+ xl = 0
.subckt impedance v1r v1i v2r v2i params: on = 1 r = 100 xl = 0

The list of parameters is not accepted on the header line. Instead, list the parameters with .param statements on following lines.
Gnucap syntax:

.subckt impedance v1r v1i v2r v2i
.param
+ on = 1
+ r = 100
+ xl = 0
.subckt impedance v1r v1i v2r v2i
.param on = 1 r = 100 xl = 0
compatibility/subcircuit_with_parameters.txt · Last modified: 2015/12/11 15:39 (external edit)
 
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Run by Debian Driven by DokuWiki