A comprehensive Python application that implements the Newton-Raphson and the Bisection to solve the non linear system of a BJT in exercise on page 96-101 of Numerical Methods for non-linear Engineering Models, John R. Hauser, Springer. The project includes a visualization of results and a terminal-based user interface (check the assets/exercise.pdf for the original exercise description).
- Features
- Requirements
- Installation
- Usage
- Reports
- LTspice Simulation
- Project Structure
- Contributors
- License
- Resources
-
Newton-Raphson Method Implementation Python code: src/bjt_sim.py
-
Bisection Method Python code: src/bjt_sim_bisection.py
-
Visualization of Results: Graphical representation of the BJT characteristics and convergence behavior.
.png)
- Python 3.7+
- numpy (for numerical computations)
- scipy (for optimization and root finding) --> Only if you want to use the fsolve function for comparison, not required for the Newton-Raphson implementation
- sympy (for symbolic mathematics, optional but useful for deriving equations) --> Only if you want to derive the equations symbolically, not required for the numerical implementation
- matplotlib (for visualization)
- Clone the repository:
git clone https://github.com/konst3/bjt_sim.git
cd bjt_sim- Install the required dependencies:
pip install -r requirements.txtRun the application from the project directory:
cd src- To run the Newton-Raphson method:
python bjt_sim.py- To run the Bisection method:
python bjt_sim_bisection.pyNOTE: We found the jacobean using the utils/find_j.py script, which uses sympy to derive the jacobean matrix symbolically. You can run it to see how we derived the jacobean, but it's not required for the main application. But to run:
cd ../utils
python find_j.pyWe also implemented the same circuit in LTspice to compare the results. The LTspice simulation files can be found in the ltspice/ directory: BJT Simulation.

The requested reports can be found in the reports/ directory:
- Project Report: Detailed documentation of the project, design decisions, and implementation details.
bjt_sim/
├── src/
│ ├── bjt_sim.py
│ ├── bjt_sim_bisection.py
├── utils/
│ ├── find_j.py
- Konstantinos Papalamprou (@konst3) <-- Project Lead (python implementations, reports, and LTspice simulation)
- Argo Papadopoulou <-- Bisection method implementation & reports
- Thomas Tsekas <-- Bisection method math & reports
- Adriana Vagena <-- Newton-Raphson method math & reports
- Alexandros Voukelatos <-- LTspice simulation & reports
- Konstantinos Papadimas <-- LTspice simulation & reports
This project is released into the public domain under The Unlicense. See the LICENSE file for more details.
The books in the exercise description were very helpful for understanding the numerical methods and their application to engineering problems.