Charged species drifting and diffusing through one-dimensional devices, solved as continuous fields, live in your browser.
driftlet is a small JavaScript library with no dependencies: a drift–diffusion solver for semiconductors and a Poisson–Nernst–Planck solver for ions, in steady state, in time and as impedance. A pn junction, a battery and a nerve look like different subjects, but to driftlet they're one problem with a different cast: electrons and holes, or ions, each a continuous concentration drifting and diffusing down its own electrochemical potential, reacting, and crossing interfaces.
Each page builds its device with driftlet/kit, solves it as you move the controls, and draws
what you'd measure (an I–V curve, a voltammogram, a discharge), mostly against closed-form theory as a check.
Beneath it are the level diagrams and profiles across the device, on one x axis. Every page shows its whole
script at the bottom, as a worked example to copy, and the starters are the smallest whole pages, each in
one file: a pn junction and a bias slider,
an electrode's double layer and its potential,
that double layer charging after a voltage step, and
a solar cell's I–V curve in the light. The stamp on a card names what its page is drawn against
(✓), or what the test suite checks it against.
Semiconductorse⁻h⁺excitonvacancy⁺






Electrodese⁻Fe³⁺S₂O₈²⁻O₂Li⁺Fc⁺H(ads)h⁺











Cells and batteriese⁻Zn²⁺Ag⁺NO₃⁻Li⁺




Ions at interfacesK⁺H⁺Cl⁻fixed charge




Cells and nervesNa⁺K⁺Cl⁻gates



