# Colpitts Osc. in ngspice: type of analysis and "singular matrix"?

I'm new to simulating circuits in spice (in this case, in the ngspice implementation in KiCad's nightly builds) and trying to build a simple Colpitts oscillator:

I'd simply like to "power" the thing using V1 and get a plot over time of the voltage at Vout -- seems like this should be pretty simple, but I can't seem to get it to work.

First of all, what type of analysis should I use? I had assumed an AC analysis but maybe I'm wrong. I've been using 1,000,000 points between 750Hz and 1250Hz (the given cap and inductor values should produce a frequency of 1MHz.) Trying to probe Vout, the simulator tells me "Error: vector frequency not found!"

Second, no matter the analysis I run I get a message, "Warning: singular matrix: check nodes net-_c2-pad2_ and net-_c2-pad2_". As far as I can tell C2 is connected correctly and it certainly isn't connected to itself. I suspect this is some quirk of how spice reports errors but searching the web has got me nowhere.

Can someone provide a hint?

• Do a transient analysis and make sure you wait enough time to allow the oscillator to begin producing a waveform. Try putting a 1 Meg bleed resistor across C2. Jul 22, 2018 at 17:45
• Andy is putting his finger on it. You have a node where three capacitors "arrive." But there is NO galvanic path to that node. That's not good. Without even looking at your circuit for function (I don't care right now), I'd snap a $10\:\text{M}\Omega$ from that node to ground. Just to provide some galvanic path.
– jonk
Jul 22, 2018 at 18:25
• Well, this is why I like StackExchange :) Thanks for the hint. I'll do some research (these are new ideas to me -- I'm new to this) and will comment here when I figure it out. Jul 22, 2018 at 18:54
• By the way, to have this oscillator be accurate and low jitter when built, you need a quality VDD bypass capacitor from VDD to bottom of the 1UF on the base. Jul 22, 2018 at 22:24
• @Andyaka If you'd like to take your comments and add them as a solution I'd be happy to accept that as the answer. Jul 22, 2018 at 22:30

## 1 Answer

If you'd like to take your comments and add them as a solution I'd be happy to accept that as the answer.

Run a transient analysis but make sure you run it for long enough time to allow the oscillator to properly start. As for the error message try putting a 1 Mohm resistor across C2 so that the simulator doesn’t get into a muddle trying to resolve DC conditions.