Skip to main content
Built-in Elements

<analogsimulation />

Overview

<analogsimulation /> enables SPICE simulation for a <board /> and sets the simulation parameters, such as duration and time step. Place this element inside your board alongside sources and probes to generate simulation results.

If you're new to simulation workflows, check out the SPICE simulation guide for step-by-step examples.

Schematic Circuit Preview
export default () => (
<board routingDisabled>
<voltagesource name="V1" voltage="5V" />
<resistor name="R1" resistance="1k" />

<trace from=".V1 > .pin1" to=".R1 > .pin1" />
<trace from=".V1 > .pin2" to=".R1 > .pin2" />

<voltageprobe name="VP_IN" connectsTo=".V1 > .pin1" />
<voltageprobe name="VP_OUT" connectsTo=".R1 > .pin1" />

<analogsimulation duration="10ms" timePerStep="0.1ms" spiceEngine="ngspice" />
</board>
)

Properties

PropertyDescriptionExample
durationTotal simulation time. Accepts numbers or time strings."10ms"
timePerStepTime interval between simulation steps."0.1ms"
spiceEngineSPICE engine to use. Typically "ngspice" or "spicey"."ngspice"

Use <analogsimulation /> once per <board /> to define how the simulation runs. Combine it with <voltagesource /> and <voltageprobe /> elements to create and observe waveforms.

For more end-to-end examples and best practices, we recommend reviewing the SPICE simulation guide.