ltspice
Use when writing or editing LTspice circuit netlists (.cir, .net, .sp), working with LTspice schematics (.asc), or interpreting simulation results (.raw, .log). Covers LTspice-specific SPICE syntax, behavioral sources, waveform sources, .MEAS, parameters, convergence, and common gotchas that cause silent errors. Use this skill whenever the user mentions LTspice, circuit simulation, filter design, frequency response, transient analysis, or any SPICE netlist work targeting LTspice. --- # LTspice Circuit Simulation Guide ## SPICE Fundamentals ### Netlist Structure ```spice * Title line (first line, always a comment) <components> <directives> .END ``` - `.END` must be last line. No statements after it. - `+` at start of line continues previous statement. - Comments: `*` (full line) or `;` (inline). ### Component Syntax ``` <ref> <node+> <node-> <value> R1 in out 10k C1 out 0 100n V1 in 0 AC 1 PULSE(0 5 0 1n 1n 0.5m 1m) ``` ### Value Notation — CRITICAL | Suffix | Meaning | Value | |-|-|-| | f | femto | 1e-15 | | p | pico | 1e-12 | | n | nano | 1e-9 | | u | micro | 1e-6 | | m | milli | 1e-3 | | k | kilo | 1e3 | | MEG | mega | 1e6 | | G | giga | 1e9 | | T | tera | 1e12 | **`M` means MILLI, not mega. Use `MEG` for 1e6.** This is the #1 SPICE mistake. `1M` = 0.001, not 1000000. Unrecognized suffix letters are silently ignored — no error, just wrong value. ### Waveform Sources ```spice PULSE(Vinitial Vpulse Tdelay Trise Tfall Ton Tperiod Ncycles) SINE(Voffset Vamp Freq Td Theta Phi Ncycles) EXP(V1 V2 Td1 Tau1 Td2 Tau2) SFFM(Voff Vamp Fcar MDI Fsig) PWL(t1 v1 t2 v2 ...) PWL file=<filename> ``` **PWL extras (LTspice-specific):** - Relative time: `PWL(0 1 +1 2 +1 3)` — times become 0, 1, 2 - Repetition: `REPEAT FOR n (...) ENDREPEAT` or `REPEAT FOREVER (...) ENDREPEAT` - Scaling: `VALUE_SCALE_FACTOR=x`, `TIME_SCALE_FACTOR=x` - Trigger: `TRIGGER <expression>` — output stuck at first value when expression is false ### Directives ```spice .tran 5m ; transi
Changelog: Source: GitHub https://github.com/Cognitohazard/ltspice-mcp
Loading comments...