Introduction

Brandon's semiconductor simulator (SemiSim) is an educational tool made with the original purpose of helping its creator understand semiconductor devices. It is fully interactive, letting users draw circuits and create their own devices in a manner similar to painting software. There is a wide variety of different materials to choose from and many ways to visualize the electromagnetic phenomena associated with semiconductors. Users can either load one of the many premade simulations or create their own.

Physics

The simulation is set on a two-dimensional grid over which it solves the 2D Maxwell equations. The electric field lies in the same plane as the surface of the screen whereas the magnetic field is perpendicular to it. On top of this, there are two types of charge carriers, electrons and holes, which feel electric and chemical forces that determine their dynamics. The simulation uses a FDTD (finite-difference time domain) scheme obtained by discretizing the Maxwell equations and the drift-diffusion equations and coupling the two together. This results in a simulation that demonstrates many of the important properties of semiconductors and semiconductor devices, such as:

Limitations

Because the simulation uses a very simplified model of how semiconductors work, it is not able capture some phenomena that show up in real systems. Things that the simulation cannot handle include: Finally, certain properties of materials differ from their real life counterparts (for example, the charge carrier mobility of the semiconductor material is about 1500x greater than that of Silicon). This was done for educational purposes.

Simulation features

The interface consists of the simulation area which the user can interact with and the settings panel containing all the simulation controls.
Application
Simulation area (purple, left) and settings (blue, right).
The main way to interact with circuits is to change the strength of voltage sources and turn switches on and off. The quickest way to get started is to load one of the examples and start changing the voltages.

Simulation variables

Listed below are the most important variables that capture the state of the simulation at a given time:
\(\vec{E} = (E_x, E_y, 0)\)Electric field [V/m]
\(\vec{B} = (0, 0, B_z)\)Magnetic field [T]
\(\rho_n\)Charge density of electrons [C/m^3]
\(\rho_p\)Charge density of holes [C/m^3]
\(\rho = \rho_n + \rho_p\)Net charge density [C/m^3]
\(\vec{J}_n = (J_{nx}, J_{ny}, 0)\)Electron current density [A/m^2]
\(\vec{J}_p = (J_{px}, J_{py}, 0)\)Hole current density [A/m^2]
\(\vec{J} = \vec{J}_n + \vec{J}_p\)Total current density [A/m^2]
\(\vec{D} = \epsilon \vec{E}\)Electric displacement field [C/m^2]
\(\vec{H} = \frac{1}{\mu} \vec{B}\)Magnetic field [A/m]
\(\vec{S} = \vec{E}\times \vec{H}\)Poynting vector [W/m^2]
\(u = \frac{1}{2}(\vec{E}\cdot \vec{D} + \vec{B} \cdot \vec{H})\)Electromagnetic energy density [J/m^3]
\(\phi\)Electric scalar potential [V]
\(G\)Charge carrier generation rate [1/(m^3 s)]
\(R\)Charge carrier recombination rate [1/(m^3 s)]
\(F_n\)Electron quasi-Fermi level (free energy) [V]*
\(F_p\)Hole quasi-Fermi level (free energy) [V]*
\(F\)Average free energy [V]
\(Q\)Heat dissipation [J/(s m^3)]
\(S\)Entropy generation [J/ (K s m^3)]
* Here free energy is measured per unit of charge instead of per particle, hence the units used are [V] and not [eV].

Vector view modes

Arrows: The direction and brightness of arrows corresponds to the direction and magnitude of the vector field.

Arrows

Lines: The brightness and density of lines indicates the magnitude of the field.

Field lines

Dots [desktop]: The velocity of the dots is proportional to the value of the vector field.

Dots

Contour [desktop]: Contour lines indicate a region on which the scalar field has a constant value.

Contour lines

Charge carriers [desktop]: Electrons and holes are represented as blue and red dots, respectively. Both dots move at the actual drift velocities of their corresponding charge carriers and their density accurately reflects the density of charge carriers. This is much more realistic but less flexible than the dots view.

Charge carriers

Options

PausePauses and unpauses the simulation.
Show detailed infoDisplays a tooltip that contains the values of all the simulation variables at the cursor's location.
Show text backgroundGives text boxes a black background, making the text easier to see.
Display interfaceShows probe info, graph locations, time, and tooltip.
Boundary conditionChoose between a boundary that absorbs outgoing radiation or a perfectly conductive boundary that reflects it.
Scalar viewChoose which field to display as a color scale over the simulation field.
Vector viewChoose which vector field to visualize (only works for 2D vectors, see "Vector view modes").
Show material colorsIf checked, gives each material a different color, making them easier to tell apart.
TimestepSets the simulation timestep. The maximum timestep is determined by the CFL condition for the wave equation and diffusion equations for each charge carrier.
Sim steps/frameSets the number of iterations performed during each frame. Most of the examples require at least 10 steps/frame to run responsively. The maximum number depends on how good the user's computer is.
Scalar brightnessSets the brightness of the scalar field.
Vector brightnessSets the brightness of the vector field.
Save scenarioSaves the current simulation to a file.
Load scenarioLoads a simulation from a file. SemiSim comes with a variety of pre-made simulations located in the "examples" folder.
Clear allRemoves all materials and resets all fields.
Set fields to zeroSets all fields to their default values, leaving the materials unchanged.
Advanced settings
[desktop]
Opens advanced simulation settings window, for advanced users only.
ToolSelects one of the tools.

Tools

InteractAllows user to control voltage sources and turn switches on and off by clicking.
DrawAdds material to the field.
VoltageAdds a voltage probe that measures electrochemical potential at a certain point (See "What do voltmeters actually measure").
Current
[click and drag]
Adds a current probe that measures current across a wire.
GroundSpecifies the point relative to which probes measure voltage (optional).
Delete probeClick to delete a probe.
Plot bands
[click and drag, desktop]
Specifies a 1D line along which the bands are plotted. The plot contains the conduction and valence energy band edges as well as the quasi-Fermi levels of electrons in both bands.
Band plot
Valence and conduction band energies shown as solid lines. Quasi-Fermi levels are dashed lines.
Plot scalar field
[click and drag, desktop]
Makes a plot of the currently selected scalar field.
Plot carriers
[click and drag, desktop]
Makes a logarithmic plot of the number density of electrons and holes.
Flashlight
[click and hold, desktop]
Shines a light on the region under the cursor. Light generates electron and hole pairs.
ReplaceSimilar to the draw tool, but overwrites occupied areas.
Line
[click and drag]
Draws a line of material.
FillFills a region with a certain material, similar to the bucket tool.
EraseErases material.
SelectMakes a rectangular selection which can be dragged around and moved.
Select regionSelects a contiguous region, similar to the bucket tool.
TextPlace a text cursor allowing text to be typed on the screen.

Keyboard/Mouse Controls

P or SpacePause & unpause
FAdvance frame
QChange brush shape
CToggle material color
VToggle vectors
SToggle scalar colors
TToggle tooltip
GToggle text background
HToggle user interface
Mouse wheelChange brush size
ShiftDraw straight lines
CtrlFill area
Alt or OptionPick material
Ctrl-XCut
Ctrl-CCopy
Ctrl-VPaste
Left mouseDraw material
Right mouseErase material
Middle mousePick material
R [desktop]Record probe data (saves to probedata.txt)

Materials

Voltage sourceGenerates a voltage that can be used to power circuits.
SwitchConductivity can be switched on and off by the user.
MetalMaterial that conducts electricity very well.
Conductive metalMore conductive than regular metal.
Resistive metalLess conductive than regular metal.
High workfunction metalMetal that forms an ohmic contact with p-type semiconductor.
Low workfunction metalMetal that forms an ohmic contact with n-type semiconductor.
Intrinsic semiconductorUndoped, with equal number of electrons and holes.
P-type semiconductorRepresents a semiconductor doped with holes.
N-type semiconductorRepresents a semiconductor doped with electrons.
Heavily doped P-type semiconductorHas a large concentration of holes.
Heavily doped N-type semiconductorHas a large concentration of electrons.
Lightly doped P-type semiconductorHas a small concentration of holes.
Lightly doped N-type semiconductorHas a small concentration of electrons.
DielectricMaterial with a large permittivity/dielectric constant.
FerromagnetMagnetic material with high relative permeability.
Positive static chargePositively charged insulating material.
Negative static chargeNegatively charged insulating material.
DecorationUsed for text or circuit symbols, has no effect otherwise.
VacuumEmpty space.
Palette
Colors of all the materials.

Miscellaneous questions and answers

Why does this simulation exist?

I created this simulator because I wanted to get a deeper understanding of how semiconductors work. It's been my experience that there's been a lack of good simulations that demonstrate advanced topics in physics. There certaintly exists many educational physics simulations, but they're all either aimed at lower educational levels, or they are very restricted in how the user can interact with the system. The only examples I've seen of simulations that combine advanced topics with a generous amount of interactivity are the physics applets written by Paul Falstad, to whom I'm also grateful for looking over my project and helping to convert it to Javascript. I've tried to give users many different ways of interacting with the simulation. Circuits can be drawn with just a few clicks of the mouse, allowing users to easily experiment with their own circuits. There are also many different ways of visualizing the underlying physics that I've incorporated into the settings. Each one gives a different perspective on the physics that is happening.

What do the colors mean?

In general, the color red is associated with either holes or a positive charge. Blue represents electrons or negative charge. White means both electrons and holes exist a location. In the rest of the cases, yellow represents a positve quantity (eg. chemical potential or magnetic field), while cyan is negative. Finally, green is used for quantites that are always positive (eg. energy density). Note: Each material also has its own color which is unrelated to the aforementioned color scheme.

What do voltmeters actually measure?

You might notice that the reading from a voltage probe doesn't match the electric potential Φ. In reality, voltmeters do not measure Φ but rather differences in electrochemical potential of charge carriers. Things get a bit trickier when we ask what the voltage is in a piece of semiconductor, becuase now there are multiple charge carriers! In this case we can try to define voltage as the reading we get when we stick a small metallic probe at a certain point. This can actually be performed in the simulation, and the result is that the electrochemical potential of the metal lies between that of electrons and holes, closer to whichever one has a larger density. I approximate this with a simple weighted average, the result of which is displayed on the voltage probe.

Why does the magnetic field vanish outside of circuits?

Because the simulation is in 2D, circuits actually extend infinitely in the z-direction (out of the page), so current flowing through a closed circuit has the same effect as current flowing through a 3D solenoid. If you recall from E&M class, the magnetic field within an infinitely long solenoid is entirely contained within it. This is certainly a point of departure from how we expect circuits to behave. It means that each current loop has its own inductance, and trying to create "inductors" that behave like their 3D counterparts is quite tricky.

Copyright (c) 2025 Brandon Li
[email protected]