R1 1 2 1k → Resistor R1 between nodes 1 and 2, 1 kΩ. Basic Components | Component | Prefix | Syntax Example | Meaning | |-----------|--------|----------------|---------| | Resistor | R | R1 1 2 1k | 1 kΩ | | Capacitor | C | C1 2 3 10u | 10 µF | | Inductor | L | L1 3 0 100m | 100 mH | | Voltage source | V | V1 1 0 DC 5 | 5V DC | | Current source | I | I1 2 0 DC 1m | 1 mA DC |
.TRAN 1u 1m .AC dec 100 10 100k
// End simulation .END | Tool | Best for | |------|-----------| | LTspice | General analog, power electronics, education | | ngspice + KiCad | PCB design integration | | Qucs-S | RF and microwave (with ngspice backend) | | Micro-Cap 12 | (now free) Educational, extensive models | Final rule: Simulate first, then build. But when simulation and reality disagree – trust your oscilloscope. SPICE models are only as good as their parameters. spice circuit
RC Filter Simulation V1 IN 0 PULSE(0 5 0 1n 1n 50u 100u) ; 5V square, 10 kHz R1 IN OUT 1k C1 OUT 0 0.1u
Seeing startup, switching, or pulse responses. 4. Complete SPICE Example (LTspice Syntax) Circuit: Simple RC low-pass filter with a 10 kHz square wave input. R1 1 2 1k → Resistor R1 between nodes 1 and 2, 1 kΩ
1. What is SPICE? SPICE is the industry standard for analog circuit simulation. It solves Kirchhoff’s laws numerically to predict DC, AC, and transient behavior before you build a physical prototype.
LTspice (free, best for beginners), ngspice (open-source), PSpice (commercial), HSPICE (high-precision). 2. The Core Components of a SPICE Netlist A netlist is the text description of your circuit. Every line follows this pattern: SPICE models are only as good as their parameters
Designing filters, amplifiers, or checking stability. 3. Transient Analysis (.TRAN) Plots voltage/current vs. time. Syntax: .TRAN 1u 10m → timestep 1 µs, stop at 10 ms.