I'm having problems with the LTSpice Voltage controlled switch in a very simple circuit:

A pulsed voltage source is used to switch MYSW on and off: PULSE(0 5 15m 1n 1n 0.15m 16m 1) .

The voltage Controlled Switch is associated with .model MYSW SW(Ron=1m Roff=10Meg Vt=3 Vh=0.0 Lser=1p Vser=0.0), with the switch's Spice model attribute set to MYSW.

The intention is to switch a current from a DC voltage source through a 1k resistor.

When I run the sim I get the following error message:

Error on line 5 : s1 n001 0 n002 0 mysw sw
     Unknown parameter "sw"
Direct Newton iteration for .op point succeeded.

Date: Wed Mar 29 12:28:07 2023
Total elapsed time: 0.038 seconds.

tnom = 27
temp = 27
method = modified trap
totiter = 2473
traniter = 2470
tranpoints = 1236
accept = 1207
rejected = 29
matrix size = 5
fillins = 0
solver = Alternate
Matrix Compiler1: 108 bytes object code size  0.0/0.0/[0.0]
Matrix Compiler2: off  [0.0]/0.1/0.0

Can anyone please explain what this error is all about and how I get rid of it?


1 Answer 1


Instead of the SpiceModel attribute, set the Value attribute to MYSW.

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.