Running Simulations
Running a Single Cell
Section titled “Running a Single Cell”Every SPICE cell has a Run button in its toolbar. Clicking it sends the cell’s netlist to the backend, which:
- Writes the netlist to a temp file
- Invokes the selected engine (ngspice or LTspice)
- Parses the raw output into structured
WaveformData - Returns results to the browser and saves them in the cell’s
outputsarray
Results appear inline beneath the cell — either a data table (for .op) or a waveform plot (for .tran, .dc, .ac).
Run All
Section titled “Run All”The toolbar’s Run All button executes every SPICE cell in the notebook from top to bottom, sequentially. Each cell’s results are saved before the next cell runs.
This is useful for notebooks where later cells depend on understanding earlier results, or when you want to regenerate all outputs after changing the engine.
Analysis Types
Section titled “Analysis Types”The analysis directive in your netlist determines what kind of results you get:
DC Operating Point (.op)
Section titled “DC Operating Point (.op)”V1 1 0 DC 5R1 1 2 1kR2 2 0 2k.op.endReturns a single set of node voltages and branch currents. Displayed as a table.
Transient (.tran)
Section titled “Transient (.tran)”V1 1 0 PULSE(0 5 0 1n 1n 5u 10u)R1 1 2 1kC1 2 0 100n.tran 10n 50u.endReturns time-series data. Displayed as an XY waveform plot with time on the horizontal axis.
DC Sweep (.dc)
Section titled “DC Sweep (.dc)”V1 1 0 DC 5R1 1 2 1kR2 2 0 2k.dc V1 0 10 0.5.endSweeps a source value and returns node voltages at each step. Displayed as a waveform plot with the swept parameter on the horizontal axis.
AC Analysis (.ac)
Section titled “AC Analysis (.ac)”V1 in 0 AC 1R1 in out 1kC1 out 0 1u.ac dec 100 1 1meg.endReturns complex frequency-domain data. Displayed as a Bode plot — magnitude in dB and phase in degrees versus frequency on a log scale.
Output Format
Section titled “Output Format”Every simulation returns a SimulationResponse:
{ "success": true, "waveform": { "variables": [{"name": "v(out)", "type": "voltage"}], "points": 100, "x_data": [0.0, 0.001, ...], "y_data": {"v(out)": [0.0, 0.5, ...]}, "x_type": "time", "is_complex": false }, "log": "ngspice output...", "error": null, "elapsed_seconds": 0.42}If the simulation fails (syntax error, convergence failure), success is false and error contains the diagnostic message. The simulator log is always available in the log field for debugging.
Engineering Notation
Section titled “Engineering Notation”SPICE uses its own suffix convention for component values — be aware that M means milli (10⁻³), not mega. Use meg for 10⁶.
| Suffix | Multiplier | Example |
|---|---|---|
T | 10¹² | 1T |
G | 10⁹ | 2.2G |
meg | 10⁶ | 1meg |
k | 10³ | 4.7k |
m | 10⁻³ | 10m |
u | 10⁻⁶ | 100u |
n | 10⁻⁹ | 47n |
p | 10⁻¹² | 10p |
f | 10⁻¹⁵ | 1f |