Ngspice confused by 2 capacitors in series?

I try to simulate the OPA856, but when I connect the op amp output via 2 series 1pF capacitors to ground, things go very wrong (This is the DC operating point, but also the AC small signal analysis goes wrong):


Somehow it is as though the two capacitors pull the output to ground.

Replacing the 2 series 1pF capacitors with just one 0.5 pF (or 10 pF, …) fixes it.
(The two capacitors were part of a network with resistors in between that I simplified to send to the forum).

Is this a spice bug? Anyone know how to work around it? (while still having my C-R-C output filter)?

sim-opa856.zip (13.9 KB)

Thanks!

Version Info:

Application: KiCad x86_64 on x86_64
Version: 8.0.6-8.0.6-0~ubuntu24.04.1, release build
Libraries:
wxWidgets 3.2.5
FreeType 2.13.3
HarfBuzz 8.3.0
FontConfig 2.15.0
libcurl/8.9.1 OpenSSL/3.3.1 zlib/1.3.1 brotli/1.1.0 zstd/1.5.6 libidn2/2.3.7 libpsl/0.21.2 libssh2/1.11.0 nghttp2/1.62.1 librtmp/2.3 OpenLDAP/2.6.8
Platform: Ubuntu 24.10, 64 bit, Little endian, wxGTK, X11, gnome, wayland
OpenGL: AMD, AMD Radeon Graphics (radeonsi, renoir, LLVM 19.1.0, DRM 3.58, 6.11.0-9-generic), 4.6 (Compatibility Profile) Mesa 24.2.3-1ubuntu1
Build Info:
Date: Oct 14 2024 23:16:15
wxWidgets: 3.2.4 (wchar_t,wx containers) GTK+ 3.24
Boost: 1.83.0
OCC: 7.6.3
Curl: 8.5.0
ngspice: 43
Compiler: GCC 13.2.0 with C++ ABI 1018
Build settings:

Perhaps someone else will chime in here but I believe the issue is that those are ideal capacitors and therefore there is no DC path to the node in the middle, so ngspice cannot calculate a DC operating point for the circuit.

You can fix it by adding a very large resistor (1G would work and wouldn’t affect the rest of the circuit) from that middle node to ground or honestly any other node (parallel to one of the caps is fine).

There are probably also some options/parameters you could add globally or to one of the capacitors that would add some parallel resistance / conductance / leakage to accomplish the same thing but offhand I don’t know what they are.

5 Likes

Thanks!
Yes, that indeed does fix it, and the circuit I wanted to simulate now also works.

Thanks for the quick response!