Remix.run Logo
iaaan 4 days ago

The naive programmer in me wants to assume, "It can't possibly be that hard to simulate a circuit," and get to work on prototyping my own simulation engine but the fact that this apparently has not ben adequately solved yet gives me pause.

bartlettD 3 days ago | parent | next [-]

As a practicing EE and naive programmer, It is pretty hard to build a simulation engine for electronics and even harder to build a performant engine. SPICE does this with huge matrices of differential equations and math tricks.

Theres an interesting article by Mike Engelhardt (author of LTspice) which gives hints on the details of their implementation.

https://www.analog.com/media/en/technical-documentation/tech...

fc417fc802 3 days ago | parent | prev | next [-]

It depends on what level of detail you want the simulation to have. Boolean logic is easy. Analog circuits operating in certain (very limited) domains are straightforward. But - noting that what follows is well out of the realm of my experience - in other domains you have to account for things like RF characteristics and quantum effects in the semiconductors.

Imagine trying to simulate something that used water in tubes to implement logic, except it's analog logic and there's resonance and some of the joints start leaking when they exceed a certain pressure and etc.

tuatoru 3 days ago | parent | prev [-]

SPICE (simulation program with integrated circuit emphasis) is open-source. As is ngspice, next generation SPICE.

LT-spice is just a graphical front end to make SPICE easier to use.

Yeah, analog is hard.