Ngspice voltage source: Square wave +/-12V but 0V when not active?

There are many ways, e.g. using switches or multipliers etc.

One way might be the Analog multiplier example from Simulation examples for KiCad8/KiCad9/Eeschema/ngspice - #4 by holger.
One input is the pulse sequence (unlimited) of interest, the other is a gating pulse between 0 and 1, setting the output to 0 when not being 1.

1 Like