3 ms·
Cool, thank you for sharing. I am interested in simulators, especially in simulators of analogue circuits. Do you have any recommendations on where to start re
by ubavic 4y ago
Cool, thank you for sharing.
I am interested in simulators, especially in simulators of analogue circuits. Do you have any recommendations on where to start reading about algorithms that lie at the core of simulators?
Also, how was the experience developing such product with JS?
- compumike 4y agoAuthor of the CircuitLab https://www.circuitlab.com/ https://www.circuitlab.com/ (YC W13) mixed-mode (analog and digital) simulation engine here. The "core algorithm" is probably LU decomposition on a sparse matrix: https://ultimateelectronicsbook.com/systems-of-equations/#lu-decomposition https://ultimateelectronicsbook.com/systems-of-equations/#lu... . I answered a similar question on Electronics StackExchange where someone asked about how to build a circuit simulator: https://electronics.stackexchange.com/a/394069 https://electronics.stackexchange.com/a/394069 From a software developer perspective: lots and lots and lots of automated tests, each of which builds a circuit, runs a simulation, and makes sure we don't see any behavior regression. More lines of code in tests than in the core simulation engine or device models!
- rhodin 4y agoContinuous System Simulation by Cellier/Kofman [0]. The focus is mainly on Modelica, but analog circuits are a "special case" of this. [0] https://www.amazon.com/Continuous-System-Simulation-François-Cellier-ebook/dp/B0014DBSJO https://www.amazon.com/Continuous-System-Simulation-François...
- etimberg 4y agoAs /u/compumike mentioned the core spice algorithm is an LU decomposition and solve of a large matrix. Not sure what a good resource these days would be; it's been many years since I worked on this. The JS experience wasn't great. We used emscripten and the tooling barely worked for the simulator core. The rest of the app wasn't bad, but we used polymer / webcomponents which was a big mistake IMO
- mox111 4y agoThe source code has the following comment: For information about the theory behind this, see Electronic Circuit & System Simulation Methods by Pillage
- atoav 4y agoI have been using the falstad sim for years in the developement of analog synthesizer stuff. There are some circuits that work in practise that do not work in practise (e.g. relaxation oscillators with a schmitt-trigger inverter). The model oscillates, but it is not really controlable. Outside of that most simpler stuff (e.g. analog math using opamps, discrete stuff) works perfectly fine. I love it for education and quick "sanity check" simulations.