Documente Academic
Documente Profesional
Documente Cultură
Test Report
SPICE to Qucs conversion: Test File 5
Mike Brinson
Copyright
c 2007 Mike Brinson <mbrin72043@yahoo.co.uk>
Permission is granted to copy, distribute and/or modify this document under the
terms of the GNU Free Documentation License, Version 1.1 or any later version
published by the Free Software Foundation. A copy of the license is included in
the section entitled GNU Free Documentation License.
Introduction
Title
SPICE 2g6 and 3f5 inductors.
SPICE specification
Format: SPICE 2g61 :
Notes:
1. Characters [ and ] enclose optional items
9. Equations:
and L1, L2, L3 .......... are the coefficients of a polynomial describing the
element value. Also n <= 20.
1
See sections 6.2 and 6.3, SPICE 2g6 users guide.
1
Format: SPICE 3f52 :
Notes: 1 to 8 above.
Test code
SPICE code: File S2Q_test5-_a.cir
SPICE t o Qucs s y n t a x f i l e
SPICE 2 g6 and 3 f 5 i n d u c t a n c e
DC and AC t e s t s
. s u b c k t S2Q t e s t 5 a po1 , po2 , po3
v1 1 0 dc 1v
l 1 1 po1 1mH
r 1 po1 0 1k
v2 2 0 ac 1v
l 2 2 po2 1mH
r 2 po2 0 1k
v3 3 0 dc 1v ac 1v
l 3 3 po3 1mH
r 3 po3 0 1k
. ends
. end
SPICE t o Qucs s y n t a x f i l e
SPICE 2 g6 and 3 f 5 i n d u c t a n c e
DC and t r a n s i e n t tests
. s u b c k t S2Q t e s t 5 a po1 , po2 , po3 , po4 , po5 , po6 , po7
v1 1 0 dc 1v
l 1 1 po1 1mH i c=0mA
r 1 po1 0 1k
v2 2 0 dc 0v
l 2 2 po2 1mH i c=10mA
r 2 po2 0 1k
2
See sections 3.1.7 and 3.1.8, SPICE 3f6 users guide.
2
v3 3 0 dc 1v
l 3 3 po3 1mH IC=0mA
r 3 po3 0 1k
v4 4 0 dc 0v p u l s e ( 0 1 0 . 1u 0 . 1u 0 . 1u 10u 20u )
l 4 4 po4 1mH i c=0mA
r 4 po4 0 1k
v5 5 0 dc 1v p u l s e ( 0 1 0 . 1u 0 . 1u 0 . 1u 10u 20u )
l 5 5 po5 1mH i c=0mA
r 5 po5 0 1k
v6 6 0 dc 1v p u l s e ( 0 1 0 . 1u 0 . 1u 0 . 1u 10u 20u )
l 6 6 po6 1mH i c= 1mA
r 6 po6 0 1k
v7 7 0 dc 0v p u l s e ( 0 1 0 . 1u 0 . 1u 0 . 1u 10u 20u )
l 7 7 po7 1mH i c=1mA
r 7 po7 0 1k
. ends
. end
SPICE t o Qucs s y n t a x f i l e
SPICE 2 g6 and 3 f 5 mutual i n d u c t a n c e
AC t e s t s
. s u b c k t s2q t e s t 5 c po1 po2
v1 1 0 ac 240
r 1 1 2 1Ohm
l 1 2 0 100mH
l 2 3 0 100mH
k23 l 1 l 2 0 . 999
r 2 3 po1 1Ohm
r l po1 0 150
r 1 1 1 21 1Ohm
l 1 1 21 0 100mH
l 2 1 0 31 100mH
k231 l 1 1 l 2 1 0 . 999
r 2 1 31 po2 1Ohm
r l 1 po2 0 150
. ends
. end
3
SPICE t o Qucs s y n t a x f i l e
SPICE 2 g6 and 3 f 5 mutual i n d u c t a n c e
Transient t e s t
. s u b c k t s2q t e s t 5 c po1
v1 1 0 s i n ( 0 240 5 0 )
r 1 1 2 1Ohm
l 1 2 0 100mH
l 2 3 0 100mH
k23 l 1 l 2 0 . 999
r 2 3 po1 1Ohm
r l po1 0 150
. ends
. end
4
X1
File=s2q_test5_a.cir
P01 P02
PO1 PO2
spice
P03 dc simulation
PO3
DC1
Ref
ac simulation
AC1
Type=log
Start=1 Hz
Stop=100 kHz
Points=100
Figure 1: April 17: Inductor DC and AC test schematic for file s2q 5 a.cir
Inductive coupled networks with more than three coupling coefficients have
not been tested.
5
1
1
P02.v
P01.v
0
0.9
-1
1 10 100 1e3 1e4 1e5 0 2e4 4e4 6e4 8e4 1e5
acfrequency acfrequency
1
P03.v
Figure 2: April 17: Inductor DC and AC tests results for file s2q 5 a.cir
6
X1
File=s2q_test5_b.cir
dc simulation po1
PO1 PO2
po2
DC1
P1 P2
po3 p04
PO3 PO4
P3 P4
spice
transient po5 po6
simulation PO5 PO6
TR1 P5 P6
Type=lin po7
Start=0 PO7
Stop=21u
IntegrationMethod=Gear P7 Ref
Order=6
reltol=0.01
abstol=100 pA
vntol=100 uV
Figure 4: April 17: Inductor DC and transient test schematic for file s2q 5 b.cir
7
number po1.V po2.V po3.V p04.V po5.V po6.V po7.V
1 1 0 1 0.513 1.51 1.51 0.513
1 0 1
po1.Vt
po2.Vt
po3.Vt
0.5 -5 0.5
0 -10 0
0 5e-6 1e-5 1.5e-5 2e-5 0 5e-6 1e-5 1.5e-5 2e-5 0 5e-6 1e-5 1.5e-5 2e-5
time time time
1 2 2
p04.Vt
po5.Vt
po6.Vt
0.5 1
0
0 0
0 5e-6 1e-5 1.5e-5 2e-5 0 5e-6 1e-5 1.5e-5 2e-5 0 5e-6 1e-5 1.5e-5 2e-5
time time time
1
po7.Vt
0.5
0
0 5e-6 1e-5 1.5e-5 2e-5
time
Figure 5: April 17: Inductor DC and transient tests results for file s2q 5 b.cir
8
# Qucs 0 . 0 . 12 / media / hda2 /S2Q t e s t 5 p r j / t e s t s2q 5 b . s c h
Ref
ac simulation
Equation
AC1
Type=log Eqn1
Start=1 Hz vpo1=abs(po1.v)
Stop=10 MHz phase_vpo1=phase(po1.v)
Points=100 phase_vpo2=rad2deg(unwrap(angle(po2.v)))
vpo2=abs(po2.v)
real_vpo1=real(po1.v)
real_vpo2=real(po2.v)
imag_vpo1=imag(po1.v)
imag_vpo2=imag(po2.v)
Figure 7: April 17: Mutual inductance AC test schematic for file s2q 5 c.cir
number po1.V
1 0
100
200 200
imag_vpo1
real_vpo1
vpo1
0
100
100
-100
0
0
1 10 100 1e3 1e4 1e5 1e6 1e7 1 10 100 1e3 1e4 1e5 1e6 1e7
1 10 100 1e3 1e4 1e5 1e6 1e7 acfrequency acfrequency
acfrequency
0
100
200
imag_vpo2
real_vpo2
-100
vpo2
0
100
-200
-100
0
1 10 100 1e3 1e4 1e5 1e6 1e7 1 10 100 1e3 1e4 1e5 1e6 1e7 1 10 100 1e3 1e4 1e5 1e6 1e7
acfrequency acfrequency acfrequency
100 -100
acfrequency po1.v vpo1 vpo2
26 236 / 3.47 236 236
30.5 236 / 2.95 236 236
phase_vpo1
phase_vpo2
Figure 8: April 17: Mutual inductance tests results for file s2q 5 c.cir
10
# Qucs 0 . 0 . 12 / media / hda2 /S2Q t e s t 5 p r j / t e s t s2q 5 c . s c h
11
dc simulation X1
File=s2q_test5_d.cir
vpo1
DC1 PO1
spice
Ref
transient
simulation
TR1
Type=lin
Start=0
Stop=100 ms
IntegrationMethod=Trapezoidal
Figure 10: April 17: Mutual inductance transient test schematic for file s2q 5 d.cir
number vpo1.V
1 0
200
time vpo1.Vt
0.0341 -235
vpo1.Vt
0.0342 -237
0.0343 -238 0
0.0344 -239
0.0345 -240
0.0346 -241
0.0347 -241 -200
0.0348 -242
0.0349 -242 0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1
0.035 -242 time
0.0351 -241
0.0352 -240
Figure 11: April 17: Mutual inductance transient tests results for file s2q 5 d.cir
12
# Qucs 0 . 0 . 12 / media / hda2 /S2Q t e s t 5 p r j / t e s t s2q d . s c h
X1
dc simulation po1
File=s2q_test5_e.cir
po2
PO1 PO2
DC1 spice
Ref
transient
simulation
TR1
Type=lin
Start=0
Stop=100 ms
Figure 13: April 17: Mutual inductance transient test schematic for file s2q 5 e.cir
13
number po1.V po2.V
1 0 0
200 200
po1.Vt
po2.Vt
0 0
-200 -200
0 0.02 0.04 0.06 0.08 0.1 0 0.02 0.04 0.06 0.08 0.1
time time
Figure 14: April 17: Mutual inductance transient tests results for file s2q 5 e.cir
14