# Simulation you can check

A simulator is only useful if you can trust its numbers. Voltecx is built so that you can see why a number is right, or find out quickly that it is not.

## Two solvers that check each other

- **Fast solver** for everyday work. It is built for switching circuits: it lands exactly on switching events, reuses matrix factorisations while the switches stay in the same state, offers fixed or error-controlled variable steps, and switches to a sparse solver for large circuits.
- **Reference solver**, deliberately simple and always fixed-step. Its job is to be an independent check. Run the same circuit with `{"solver": "reference"}` and compare.

The automated tests check the fast solver against the reference solver, and both against closed-form answers and stored ngspice waveforms. `design.auto` reruns the nominal corner on the reference solver and flags any row where the two disagree.

After every run, both solvers look over what they recorded. A node voltage or part current that jumps a millionfold in one step, or a value that is not a number, is listed in Problems as a *Suspect result* on that node or part (*in the next release*), so a solver glitch is never plotted as if it were the circuit.

## The accuracy report

`docs/accuracy.md` is generated by running models through the engine and comparing them with a reference that is not the simulator. On 2026-10-17, **22 of 22 comparisons were within tolerance**:

| Group | Reference | Typical error | Tolerance |
|---|---|---|---|
| RC, RL and RLC step responses | closed form and ngspice-47 | below 1e-6 | 1e-4 to 1e-3 |
| Half-wave rectifier, with and without filter | ngspice-47 | 3.6e-4 to 5.0e-4 | 2e-3 to 3e-3 |
| Buck 48 V → 12 V start-up, 100 kHz | ngspice-47 | 1.3e-4 to 5.7e-4 | 1e-3 to 2e-3 |
| SiC MOSFET double pulse, Eon and Eoff | Wolfspeed and Infineon data sheets | 6.9 % to 14.3 % | 30 % |

The report also has a "not validated yet" list: switching energy from a measured double-pulse test, magnetics loss against a measured inductor, efficiency against a built board and junction temperature against a measured heatsink. Nothing on that list is claimed.

Whole circuits are checked against reference results in a second report, `docs/validation.md`; [How we validate](https://voltecx-web.nguyenvanqui291.workers.dev/how-we-validate) explains the method and what has been compared so far.

## Device data with a source

Vendor parts in the library (Wolfspeed, Infineon, ROHM, Texas Instruments, Nexperia) carry the manufacturer, the data-sheet URL, the revision and the figures their values were read from. A value a data sheet does not give is left out, never guessed. SiC and GaN switches have a dynamic gate model for switching edges. Bring your own part by importing its data-sheet tables as CSV.

## Ideal against Real, side by side

The toolbar's **Models: Ideal | Real** switch runs the same circuit with every parasitic and loss unset, or as entered. Real also puts MOSFETs that carry gate data on their dynamic switching model and diodes with `is` and `n` on their exponential model, without editing the circuit. Run once in each and the second run overlays the first and shows a table: the output voltage's average and ripple, the efficiency, the total loss and the three largest part losses, with the difference. A hint beside the switch counts the parts that still have no losses set, and Problems offers to fill a catalogue part's ESR or DCR from its data sheet; a part without one is listed with no data, never a guessed value. [Before and after pictures](https://voltecx-web.nguyenvanqui291.workers.dev/docs/manual/10-models/#seeing-what-real-changes).

## The periodic steady state in a few periods

**Steady State** skips the start-up: a shooting-Newton search solves for the state at the start of a period that comes back after one period, then checks it by running on until the waveform repeats. On the LLC half-bridge example it takes 10 periods where stepping period by period takes 156; on a boost PFC with 4.7 mF it takes 12 line periods where stepping takes about 100. A circuit with more than 64 states, or a search that does not converge, falls back to stepping. [Example and limits](https://voltecx-web.nguyenvanqui291.workers.dev/docs/manual/04-simulation-settings/#example-the-llc-half-bridge).

## Hours of a battery in under a second

A real pack charges over hours, and a switching run of one hour at a 1 µs step is billions of steps. `simulation.batteryRun` runs the converter on its averaged model in short bursts and jumps the batteries' charge between them, with the charge controller's constant-current and constant-voltage logic still in the loop. On the `batteryChargerLongRun` example, four 4.5 Ah cells charged from 20 % to full over 1.5 hours, the run takes 39 674 steps where a switching run would take about 2.7 billion. Checked against the battery's own equations on a 4s 5 Ah pack, the change from constant current to constant voltage, the termination time and the final charge are within 0.6 %. `simulation.batteryZoom` then runs a few milliseconds of the switching circuit from any point of the long run, to show the ripple half an hour into the charge. The long run has no ripple of its own, and it runs from the console or a script, not yet from a menu. [How to run it](https://voltecx-web.nguyenvanqui291.workers.dev/docs/manual/04-simulation-settings/#hours-of-a-battery-simulationbatteryrun).

## Built not to crash

A crash loses work, so Voltecx treats it as the worst bug. Malformed files, bad parameters and diverging circuits come back as errors that name the component or node. Every command is fuzzed with hostile parameters, and an import run over 699 public sample files produced no crash.

## What you can simulate

Switches, diodes, MOSFETs and IGBTs with loss tables, thyristors, transformers and coupled inductors with saturation, control blocks and digital control with sample delay, thermal networks, motors and mechanical loads, batteries, solar modules, supercapacitors, fuel cells, the three-phase grid, EMI parts such as LISNs and common-mode chokes, behavioural ICs, and your own blocks as sandboxed WebAssembly. Long runs park older results on disk, and a run that would exceed the available memory is stopped before it starts.

## Examples you can see before you open them

About 60 example circuits ship with Voltecx, from an RC step to motor drives, grid converters and an HVDC link. Help > Examples lists them by category with search, and shows the selected one's schematic, its main signals from a real run, its key specs and what it teaches. Open it, open and run it, or start Auto Design from a DC-DC example's operating point. [How to use it](https://voltecx-web.nguyenvanqui291.workers.dev/docs/manual/15-examples/).

If you know what you want, press Cmd+K and type: the command palette lists matching examples, then your recent files, then commands, and previews the highlighted one's schematic and waveform on the right. Enter opens it, Cmd+Enter opens it and runs it. [Keys](https://voltecx-web.nguyenvanqui291.workers.dev/docs/manual/03-wiring-and-shortcuts/#the-command-palette).

## Not done yet

- No comparison with the reference waveforms of other simulators. That needs reference waveforms from users of those tools.
- No side-by-side speed comparison with any commercial simulator.
- No lab measurements yet.

See [analyses](https://voltecx-web.nguyenvanqui291.workers.dev/features/analyses) for what you can measure once a run is done.
