Skip to content

Hossam-Sayed/analog-circuit-sim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Analog Circuit Simulator

A simple Analog Circuit Simulator using C++.

Setup

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

Simulator Test

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

About

A simple Analog Circuit Simulator using C++

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published