Reference Example circuits

Example circuits

Every example below lives under examples/ in the repository and runs as-is: hover <file>.hvr compiles it, runs it, and writes simulation_output.csv.

Full-bridge rectifier
Diode/rectifier.hvr
AC to DC conversion, diode commutation, capacitive filtering. Walked through line by line in Your first circuit.
NPN common-emitter amplifier
BJT/npn_amp.hvr
Small-signal amplification around an NPN bias network.
PNP amplifier
BJT/pnp_amp.hvr
The complementary counterpart.
Op-amp from discrete BJTs
BJT/opamp.hvr
A full operational amplifier built out of transistor-level primitives.
Op-amp circuit
OpAmp/op_amp.hvr
Op-amp behaviour at the circuit level.
H-bridge motor drive
DCMotor/h_bridge.hvr
Switching drive into an electromechanical load — the largest example in the set.
Single LED
Optoelectronics/leds/redled.hvr
Forward-bias behaviour and the light_out port.
Multiple LEDs
Optoelectronics/leds/multiple_leds.hvr
Several colors sharing a supply.
Optocoupler
Optoelectronics/phototransistor/optocoupler.hvr
LED driving a phototransistor across an isolation barrier.

Library-mode drivers

examples/hovercraft/ is different in kind — instead of a circuit, it holds two host programs (driver.py, driver.cpp) that drive a compiled simulation through the C ABI. See Calling C++ & embedding Hover.

Plotting the output

The repository root ships plot_results.py and plot_results.html, both of which read simulation_output.csv directly — the columns are whatever the source's .save directive named.