A simple Analog Circuit Simulator using C++.
Install C++ and CMake
sudo apt update
sudo apt install build-essential cmake
Install gdb
for debugging
sudo apt update
sudo apt install gdb
Verify installation
g++ --version
cmake --version
gdb --version
Install Eigen for solving matrices
sudo apt install libeigen3-dev
Build and Run the Project
cmake -S . -B build
cmake --build build
./build/simulator
This simulator is tested againest NGSpice. The results were minimal (on the order of 1e-5
or better). To test the simulator, run the simulator using the following command on the large_example.net
netlist file
sh run.sh
Then, install ngspice
library using the following command:
sudo apt install ngspice
Then run ngspice simulator on the same file, then compare the outputs.
Note that: For NGSpice, you need to add the following commands to the end of the file:
.control
op
print all
.endc
.end