# LTSpice .Step (2nd dimension) Syntax Error

I am currently attempting to use the step function to simplify/increase portability of some of work circuits. Can't share the exact circuit, however I am simply attempting to define a variable/s, use those variables within some calculations, and finally pipe the equations output into the step function.

A simplified version of what I am attempting to do may be seen here:

When I try to simulate the circuit above I get the following error.

I guess my question has two parts:

1. Is there a way to force LT to perform the calculations first?
2. Is there possibly another command or action that might be better suited for what I am trying to accomplish?

Is there possibly another command or action that might be better suited for what I am trying to accomplish?

Use

.param a=0
.step param x list 1 2 3


and set the value of B1 to V={a+x}

• By the way, if need be, I've used a LIST with 1 2 3 ... etc., to select BJT models which were named 1 2 3 ... etc. You can name a model with a number. Works. – jonk Oct 28 '19 at 6:10

Is there a way to force LT to perform the calculations first?

Yes there is, you can make a netlist file and reorder the lines in the netlist file, the problem with doing so it it isn't the order of the compiler 'exectuing' the lines that is causing a problem. The problem seems to be that list's can't accept curly brackets, only constants

* C:\Program Files (x86)\LTC\LTspiceIV\blah.net
B1 V1 0 V={x}
.param a=0 x1=a+1
.step param x list 1 {a}
.tran 1
.backanno
.end


Is there possibly another command or action that might be better suited for what I am trying to accomplish?

Yes, using if then statements in a b-source block is probably the best way to handle multiple statements.

IF statement on LTspice

• The problem seems to be that list's can't accept curly brackets, only constants I think the help file confirms this (although not obviously clear): "Steps may be linear, logarithmic, or specified as a list of values" – Huisman Oct 28 '19 at 5:49
• @Huisman That is the problem here. You are right. – jonk Oct 28 '19 at 5:59
• That was my take-away from the documentation, and it is not clear. I suspect that if lt spice were to support this it would need to check the validity of the .param statements before the list, which turns into a logic nightmare so they left it at constants. I've learned that any special logic that is needed can be handled by b sources and is best used there – Voltage Spike Oct 28 '19 at 6:21