Ngspice ignoring initial condition

I have the following:


As seen, the initial voltage is not taken into account. What am I missing?

I attach here the files:

test.zip (5.2 KB)

I am using

Application: KiCad x86_64 on x86_64

Version: 9.0.3, release build

Libraries:
	wxWidgets 3.2.8
	FreeType 2.13.3
	HarfBuzz 9.0.0
	FontConfig 2.15.0
	libcurl/8.14.1 OpenSSL/3.3.3 zlib/1.3.1 libidn2/2.3.7 libpsl/0.21.5 nghttp2/1.65.0

Platform: Freedesktop SDK 24.08 (Flatpak runtime), 64 bit, Little endian, wxGTK, X11, gnome, wayland

Build Info:
	Date: Nov 11 2011 11:11:11
	wxWidgets: 3.2.8 (wchar_t,wx containers) GTK+ 3.24
	Boost: 1.88.0
	OCC: 7.9.1
	Curl: 8.14.1
	ngspice: 44.2
	Compiler: GCC 14.3.0 with C++ ABI 1019
	KICAD_IPC_API=ON

Locale: 
	Lang: en_US
	Enc: UTF-8
	Num: 1,234.5
	Encoded кΩ丈: D0BACEA9E4B888 (sys), D0BACEA9E4B888 (utf8)

Uncheck
Inspect → Simulator → Edit Analysis Tab → Use initial conditions

You might have a look at 11.2.2 .IC: Set Initial Conditions of the ngspiuce manual.
Setting UIC will allow calculating the initial conditions of R and C. As both are constant, there is not visible result.

Unchecking UIC will yield a true bias calculation before transient is started.

2 Likes

@developers: This is a bit non intuitive. It would be nice to have some better description or some tool tip about the “Use initial conditions” checkbox from my second screenshot.

2 Likes

I agree. This is currently not very intuitive. The “Use initial conditions” check box is equivalent to using the “UIC” parameter in ngspice. Which will skip the calculation of the initial operating point, but will use the initial conditions that are defined for devices. However, defining these initial conditions for devices through KiCad is tricky. @holger I hope my description of the UIC parameter is right?

Actually forcing voltages on nodes can be done the way you did it. This is probably what most users would think of as initial conditions. I think it would be fair to open an issue on Gitlab to make the distinction clearer for users.

3 Likes