Skip to content

A generic drift-diffusion solver tool to model any voltage stimulus across a one-dimensional diode

Notifications You must be signed in to change notification settings

Jaideep-AJ/Diode-1D-Model

Repository files navigation

Diode-1D-Model

Course project for EE2503 Numerical Mehtods for Device Modelling by Dr. Oves Badami, IIT Hyderabad

Submisson by Group 3. Members:

  1. Jaideep Nirmal A J (EP23BTECH11013)
  2. Rishab Gautam (EE23BTECH11220)
  3. A Sai Ramya Sri (EE24BTECH11202)
  4. J Laxmi Bhavani Saraswathi (EE24BTECH11209)
  5. P Devi Amrutha (EE24BTECH11219)
  6. S Abhiram (EE24BTECH11223)

Overview

This repository provides two main simulation files for 1D p-n junction diodes:

  • SteadyState.py: Simulates steady-state properties of a diode.
  • Transient.py: Simulates transient (time-dependent) behavior of a diode.

Both files allow you to change key simulation parameters directly in the code. These parameters control material properties, doping, and simulation domain. To run different scenarios, edit the simulation parameters section in each file.


Simulation Parameters (Where to Change)

SteadyState.py

The section to change simulation parameters is clearly marked:

# ============================================================
# Fundamental and Material Constants
# ============================================================
q = 1.602e-19      
kb = 1.38e-23      
eps = 1.05e-12     
T = 300            
ni = 1.5e10        
Vt = kb * T / q    
RNc = 2.8e19       
TAUN0 = 0.1e-6     
TAUP0 = 0.1e-6     
mun0 = 1500        
mup0 = 1000  
bandgap = 1.12      

# ============================================================
# Doping Values
# ============================================================
Na = 1e16
Nd = 1e17

You can modify values such as temperature (T), intrinsic carrier concentration (ni), mobilities (mun0, mup0), and doping (Na, Nd).


Transient.py

The simulation parameters section is similarly marked:

# ============================================================
# Fundamental and Material Constants
# ============================================================
q = 1.602e-19      
kb = 1.38e-23      
eps = 1.05e-12     
T = 300            
ni = 1.5e10        
Vt = kb * T / q    
RNc = 2.8e19       
TAUN0 = 0.1e-6     
TAUP0 = 0.1e-6     
mun0 = 1500        
mup0 = 1000     

# ============================================================
# Doping Values
# ============================================================
Na = 1e16
Nd = 1e17

Change these values to set up different transient simulation scenarios.


How to Run

  1. Open either SteadyState.py or Transient.py in your editor.
  2. Edit the simulation parameters section as shown above.
  3. Run the file using Python:
    python SteadyState.py
    # or
    python Transient.py

Other Files

The repository also contains:

  • Solvers and helper scripts in Parts/ (e.g., gummel.py, jacobi_iter.py)
  • Equilibrium and test scripts
  • Output folders for simulation results

For most users, focus on SteadyState.py and Transient.py and change parameters in the marked section.


Example: Changing Doping

To simulate a diode with different doping, change these lines in both files:

Na = 5e16   # p-side doping
Nd = 2e17   # n-side doping

Requirements

  • Python 3.x
  • numpy
  • matplotlib

All required modules are listed in Requirements.txt. Install them with:

pip install -r Requirements.txt

For MP4 animation output, you must have the ffmpeg codec installed:

  • Windows: Download ffmpeg
  • macOS: Run brew install ffmpeg (requires Homebrew)
  • Linux: Run sudo apt-get install ffmpeg

Output Data and Files

  • Simulation results (such as energy bands, carrier concentrations, potentials) are saved as CSV files in the <filename>/ folder, organized by scenario.
  • An MP4 animation file is created for each simulation (requires ffmpeg).
  • Other output formats (e.g., GIF) may be available if Pillow is installed.

Note: If ffmpeg is not installed, MP4 export will fail. See above for installation instructions.


Troubleshooting

  • If you see unexpected results, check the simulation parameters for physical validity.
  • For advanced studies, explore the scripts in Parts/.

Summary

To run new simulations, always edit the simulation parameters section at the top of SteadyState.py or Transient.py.

  • Built-in thermal voltage calculation (kT/q)
  • Einstein relation for diffusion coefficients
  • Flexible doping profile specification

About

A generic drift-diffusion solver tool to model any voltage stimulus across a one-dimensional diode

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 6