.step param n 0 5 1
Simulates the circuit for different values of n, starting at 0, stopping at 5, with steps 1. So, n is one of [0,1,2,3,4,5]
.param cc=0.01 ; delta
assign a value cc = 0.01, not sure what the delta is, probably just a comment, not a LTspice command.
.param a1=table(n,0,0,1,1,2,0,3,0,4,0,5,0,6,0,7,0,8,0,9,0,10,0)
a1 gets a value based on the value of n, the table has the following structure,
table(index, pairs of key,value ). in your case n is the index, and the bold ones are the keys, followed by non bold values.
table(n,0,0,1,1,2,0,3,0,4,0,5,0,6,0,7,0,8,0,9,0,10,0)
Notice that, n is in [0,1,2,3,4,5], so many of those keys will never be reached/used
.param R1=2k*(1+cc*a1)
Assign the value of R1 = 2k*(1+cc*a1), equal to, R1 = 2k*(1+0.01*a1), that for n=0 will be, R1 = 2k*(1+0.01*0). For n=2, R1 = 2k*(1+0.01*0), and so on.
.meas Vout0 FIND V(out) when n=0 ; this will not work, see below
As pointed by pfabri in the comments, this measure operation will not work. It is unclear to me why that happens, but it seems that the expression used as a condition for when can only be in terms of literals, currents and voltages, e.g., V(n001)=4+I(n002). Also, if the condition is never met you will also get that the measurement failed.
out. My measurement expression is:.meas TRAN Vout0 FIND V(out) WHEN n =1 RISE=lastand my stepped parameter is:.step param n list 1 2. Probing theoutnode comes up asV(out)in the graph as expected. If I just use.meas TRAN Vout0 FIND V(out) AT 1uI get the correct readings listed for both steps ofn. What am I missing? – pfabri Mar 17 '23 at 14:59WHENcondition can only be in terms of currents and voltages,I( )andV( ), and won't allow for parameters, such asn. If you do just.meas TRAN Vout0 FIND V(out) AT 1uyou will get the measurements for each step ofn, and then you can just read the one associated withn = 1, that might be easier than doing something to measure only atn = 1. I will add to the answer that, although reasonable, that last line won't work. But since this question is about the table function the rest should be ok. – jDAQ Mar 17 '23 at 18:26