sharpie7 / circuitjs1

Electronic Circuit Simulator in the Browser
GNU General Public License v2.0
2.32k stars 639 forks source link

Calculating methods #447

Closed popkingcorn closed 4 years ago

popkingcorn commented 4 years ago

Hi, What method/algorithm do you use to calculate the circuits? Maybe you can recommend some literature to find out.

pfalstad commented 4 years ago

This is the book I used, it's very good: https://www.amazon.com/Electronic-Circuit-System-Simulation-Methods/dp/0070501696

colinhowell commented 4 years ago

There's also the original papers on SPICE:

https://www2.eecs.berkeley.edu/Pubs/TechRpts/1975/9602.html https://www2.eecs.berkeley.edu/Pubs/TechRpts/1973/22871.html

They're old, but they provide a useful explanation of how this stuff is done. The first-listed paper is later (1975) but is much longer and goes into far more detail; I also included the second-listed paper (from 1973) because it adds more background on SPICE's development.

SPICE is an ancient program, but the methods still work--and compared to the original low-end supercomputers they first ran on, modern hardware is fast enough to run them on the fly in interactive Javascript!

popkingcorn commented 4 years ago

So circuit calculated by solving set of nodal equations based on KCL (lu_solve function in code), did I understand correctly?

pfalstad commented 4 years ago

That’s right.

popkingcorn commented 4 years ago

Thanks for answers!