Xyce oscillator simulation issue

7 views
Skip to first unread message

Keith S

unread,
Dec 1, 2025, 7:11:15 AM (2 days ago) Dec 1
to xyce-users
I've a simple Hartley oscillator that simulates as expected in spice3f5 and LTspice, with a frequency of 500-550kHz and am amplitude of ~25v p/p. However the same circuit in Xyce a) has almost zero amplitude and b) has a frequency of a tenth of what it should be.

What could be the cause of the problem?

Here's the netlist:

* Hartley osc
*.SCALE METER
R0 n1 gnd r=1k
V0 vcc gnd dc 12
VV1 gnd 0 0
C2 n0 n1 c=10n
R2 vcc n2 r=10k
.include 2n3904_spice.lib
C0 n2 gnd c=10n
L1 vcc n0 l=20u
R1 n2 gnd r=2.2k
C1 vcc vout c=2n
Q0 vout n2 n1 2N3904
L0 n0 vout l=20u
.END

and here's the bjt model:

*  SPICE model for 2N3904 transistor
*
.MODEL 2N3904 NPN(IS=4.639E-15 NF=0.9995 ISE=2.091E-14 NE=1.6 BF=160.1 IKF=0.12
+                 VAF=98.69 NR=1.001 ISC=3.257E-12 NC=1.394 BR=5.944 IKR=0.06
+                 VAR=19.29 RB=1 IRB=1E-6 RBM=1 RE=0.3614 RC=1.755 XTB=0
+                 EG=1.11 XTI=3 CJE=5.631E-12 VJE=0.7002 MJE=0.3385
+                 TF=3.001E-10 XTF=27 VTF=1.461 ITF=0.2723 PTF=0 CJC=4.949E-12
+                 VJC=0.5969 MJC=0.1928 XCJC=0.864 TR=9.4E-8 CJS=0 VJS=0.75
+                 MJS=0.333 FC=0.5582) 

Thomas Russo

unread,
Dec 1, 2025, 11:48:28 AM (2 days ago) Dec 1
to xyce-users

You don't provide an analysis line so it's hard to guess exactly what's going on for you, but when *I* run your circuit with what I think should be a reasonable transient analysis line, I get oscillations at vout of about 25 volts and a period of about 2us.  It takes a little while for them to start up but they eventually do and seem to be right.

What analysis are you using?

* Hartley osc
*.SCALE METER
R0 n1 gnd r=1k
V0 vcc gnd dc 12
VV1 gnd 0 0
C2 n0 n1 c=10n
R2 vcc n2 r=10k
.include 2n3904_spice.lib
C0 n2 gnd c=10n
L1 vcc n0 l=20u
R1 n2 gnd r=2.2k
C1 vcc vout c=2n
Q0 vout n2 n1 2N3904
L0 n0 vout l=20u


.tran 0 1m NOOP
.print tran v(vout)
.END

full_plot.pngzoom_in.png

Thomas Russo

unread,
Dec 1, 2025, 11:54:00 AM (2 days ago) Dec 1
to xyce-users
Oh, and if I add this line:

.measure tran freqspec four v(vout) at=50k numfreq=40 gridsize=400

I get a fourier spectrum with a strong peak right around 500k-550k, as expected.

Thomas Russo

unread,
Dec 1, 2025, 12:11:52 PM (2 days ago) Dec 1
to xyce-users
FWIW, the OP and I have communicated privately, and the issue is that I used "NOOP" on the tran line and he hadn't.

NOOP prevents Xyce from performing a DCOP computation, which finds the steady-state solution to the problem.  Starting up a self-oscillating system from the steady-state solution doesn't actually start the oscillations, but starting without finding that solution first lets the system start up.
Reply all
Reply to author
Forward
0 new messages