The model catalogue
The library holds 169,551 models. Every one was run before it was listed, and a model that cannot run in any engine isn’t in the app.
43.1Where the models come from
| Source | What it’s | Models |
|---|---|---|
Vendor downloads (library/raw) | Model files from manufacturers' websites (TI, Analog Devices, Infineon, Vishay, Murata, Würth, Rohm, Nexperia, onsemi and many more) and curated community collections, each folder with a SOURCE.md naming where and when it came from. | 246,841 |
Vendor fixes (library/raw-fix) | Newer or corrected files fetched from vendor sites to replace models that didn’t run, with the URL, date, licence and checksum of every file. | 2,397 |
| KiCad Spice Library | The KiCad community collection of vendor models. | 36,471 |
| LTspice library | The models of your LTspice installation, read from %LOCALAPPDATA%\LTspice\lib. | 8,159 |
| BetterSPICE part files | Parts made with the Part Wizard, in parts/library and My parts. |
Identical definitions found in several places are listed once, keeping the vendor's own copy first. The vendor model files themselves aren’t part of the installer: the library lists them, and Simulate needs the files, so run from a folder that has the model library or point BSPICE_MODELS at it (Environment variables and files). A file a model includes is looked for next to it, in its folder and collection, in LTspice's standard libraries and in BetterSPICE's own generic library.
43.2How every model is checked
- Parse. The file is read in any of the usual encodings, and each
.modelor.subcktbecomes an entry with its part number, maker, format (PSpice, LTspice, HSPICE or generic SPICE), pins and kind. - Classify. The kind (diode, Zener, Schottky, LED, NPN, PNP, N or P MOSFET, JFET, op-amp, comparator, regulator, reference, timer, logic, other) comes from the card type, the part number, the pin names and the vendor's comments. Pins win over names: a "MOSFET" with VDD and VOUT pins is an IC.
- Extract. The definition is cut out with everything it uses, so it runs on its own.
- Run in a test circuit for its kind in ngspice, first exactly as the vendor wrote it, then converted to ngspice syntax if that fails.
- Check the behaviour. Running isn’t enough: a MOSFET must switch, an op-amp must follow as a buffer, a regulator must regulate. If the named pin order doesn’t work, BetterSPICE searches for the pins electrically.
- Fit the live model. The measurements give the parameters the live engine uses for that part.
43.3The test circuits
| Kind | Test | What is measured |
|---|---|---|
| Diode | Forward sweep 0 to 5 V, reverse sweep past the breakdown | Vf at 1 mA, 10 mA, 100 mA and 1 A, reverse current at 5 V, breakdown at 1 mA |
| BJT | Gummel plot at Vce = 2 V, output curve at Ib = 100 µA | Vbe at 1 mA, hFE at 1 mA and 10 mA, Early voltage |
| MOSFET | Transfer and output curves at 5 or 10 V, both polarities, with 10, 15 and 20 V gate drive for power parts | Threshold, maximum current, Rds(on) |
| JFET | Transfer at Vds = 10 V | Idss, Vgs(off) |
| Op-amp | Unity buffer at ±5, ±15, ±2.5 V and single 5 V, open loop, step | Offset, supply current, swing, gain, gain-bandwidth, phase margin, output impedance, slew rate |
| Comparator | Threshold sweep and step with a pull-up | Threshold, output levels, delay |
| Regulator | Line and load sweeps, with enables tied active | Output voltage, dropout, line regulation, supply current, output resistance |
| Reference | Shunt or series sweep | Voltage, dynamic resistance or line regulation |
| Logic | Inputs driven with a binary count, outputs pulled up | Levels, toggling, delay, truth table for named gates |
| Timer | 555 astable at a known frequency | Frequency within a factor of two |
| Other | Every pin to ground through 1 MΩ, operating point | That it runs |
Runs that do not converge are retried with gentler solver settings. Discrete models (.model cards) are also run in BetterSPICE's own engine and compared point by point with ngspice.
43.4How models are filed
The catalogue files each model under the kind of part it is. Zener and TVS diodes are filed as Zeners even when their subcircuit holds only plain diodes. In the library, the TVS families (SMAJ, SMBJ, P6KE, 1.5KE, SMF, TPSMx, Würth WE-TVS and others) are listed under Protection › TVS, ESD diodes (ESDxx, PESD) under Protection › ESD, and the rest under Diodes › Zener. Tantalum, polymer and niobium oxide capacitor models (AVX TAJ, TPS, TCJ, NOJ) are listed under Passives › Capacitors and not as diodes. Power MOSFETs whose vendor model calls an inner subcircuit (Infineon OptiMOS, CoolMOS and CoolSiC) are listed under Transistors › MOSFET.

43.5Status
| Status | Dot in the library | Meaning | Models |
|---|---|---|---|
| Works | green | Runs in ngspice exactly as the vendor wrote it. | 150,546 |
| Converted | amber | Runs after conversion to ngspice syntax. Simulate runs the converted text. | 15,832 |
| Verified in PSpice | green | Cadence-encrypted, runs in PSpice for TI. Simulate runs it in PSpice. | 3,084 |
| Replaced | red, with "replaced by" | Doesn’t run, but a working model of the same part stands in for it. | 33 |
A model whose file has a problem the catalogue check found, such as a missing include, shows a red dot with the reason. Fit classes in the model dialog: exact (the live engine uses the vendor card with ngspice's equations), approx (a behavioural fit from the measurements, with its error), accurate-only (Simulate only).
43.6Dialects and conversion
Vendor models are written for PSpice, LTspice, HSPICE, TINA and Micro-Cap. Each is tried as written first. If ngspice rejects it, BetterSPICE converts it to native ngspice syntax, one definition at a time, and records which rules it used. Some of the rules:
| Construct | Becomes |
|---|---|
HSPICE 'expr', nested braces | ngspice {expr} |
PSpice IF, LIMIT, PWR, PWRS, STP, &, | | Ternaries, min/max, pow with the sign kept, logical operators |
LTspice uplim, dnlim, buf, inv, uramp, table() | Equivalent expressions, a clamped pwl() for tables |
E and G sources with VALUE, TABLE, LAPLACE | B-sources, clamped tables, an exact state-space network for rational Laplace functions |
| PSpice voltage and current switches | A B-source with PSpice's switch law |
| LTspice Rser, Lser, Rpar, Cpar | Explicit elements |
| PSpice U digital devices, LTspice A devices | XSPICE digital primitives with interface bridges |
| Vendor values ngspice rejects (BV = 0, NSUB = 0, division by a zero parameter) | Repaired, each repair named |
When Simulate has to use the converted text, it says so in a warning. Constructs with no ngspice equivalent (for example a PSpice Chebyshev filter or a delay in a Laplace function) make the model fail with that reason.
43.7PSpice for encrypted models
Many Texas Instruments models are encrypted by Cadence, readable only by PSpice. BetterSPICE never decrypts them. On the desktop, with PSpice for TI installed, the catalogue check ran each one in PSpice, hidden, through the same test circuits, and fitted the live simulation from the results. Simulate runs a circuit with such a model in PSpice (PSpice for encrypted models). Models encrypted for other simulators (LTspice encrypted files, HSPICE .protect) cannot run in either engine.
43.8Replacements
A model that doesn’t run, but whose part exists elsewhere in a form that does, is replaced: the library row says "replaced by X from Y" and placing it places the working one. Same part means the same part number (ignoring case, spaces, dashes and a package suffix), the same device class and compatible pins. Vendor downloads rank above other libraries, and models that work as written rank above converted ones.
43.9Retired models
A model that doesn’t run in ngspice, doesn’t pass in PSpice and has no working replacement is retired after every fix has been tried: it’s removed from the app and recorded in library/broken. The last run retired 3,094 models.
| File | What it holds |
|---|---|
library/broken/README.md | Counts per kind, the main causes and examples. |
library/broken/index.csv | One row per retired model: id, part number, kind, maker, source, file, line, status, reason, and what was tried. |
library/broken/catalog/ | The full records, so a rebuild can restore them. |
library/broken/files/ | Copies of the model files. The originals are never moved or deleted. |
What was tried is listed per model: the dependency search, the conversion, running the tests again with every current fix, PSpice for encrypted models, the replacement search and the vendor download. Every rebuild of the catalogue first puts the retired models back and judges them again, so a model that a later fix makes runnable returns to the library by itself.
43.10Commands for the catalogue
| Command | What it does |
|---|---|
bspice models show <part or id> | The catalogue entry, its status with the reason, and its live-view parameters. |
bspice models stats --md | Counts per kind and status. |
bspice models convert <file> <name> | The ngspice-native text of one model, with the rules used. |
bspice models validate --mpn <part> --force | Runs one model's tests again. |
bspice models check | Checks the whole catalogue for missing files, definitions and includes. |
python tools/model-index/rebuild.py --retire | Rebuilds the catalogue from the sources, tests everything that changed, and retires what still fails. |
- Search the library for the part. The row says "replaced by …".
- Run
bspice models show <part number>in a terminal.
You should seeThe JSON shows the status, the reason with the ngspice message and the vendor file and line, and the replacement it points to.