In my circuit, there is a current generator. This generator generates vaules dependent on a parameter, we called N. But I want to use parameter as a variable. If values change linear, I will use .step function. But my values are gaussian distributed and 10k different value. Thus .step function does not suitable for me.
My question is, could I change N parameter value from an out .txt file continuously as .step function ?
Now, I'm using LTSpice. Tell me if any useful SPICE application you know.
I know PWL() function changes current generator values with a file. But there is a mathmetical formula in I2() and N parameter using in that.
Best Answer
Re-reading this now I think I understand what OP wants: to use a custom sequence of numbers that can be used in a
.step
command. If this is the case, I'll try to answer.Normally, for a non-linear sequence of numbers that is not logarithmic, the keyword
list
is used. Unfortunately, it doesn't allow evaluations, i.e. the values must be numeric,{cos(1)}
or{2*5}
will fail. So about the only solution would be to generate the numbers externally, in a plain text file, as a single line, or as a concatenated line (with+
in front of each new line), and add:at the beginning. This file can then be added to the schematic with the
.inc
(or.include
) command. Don't forget that LTspice XVII sorts the numbers in ascending order prior to simulation start. You may, or may not like it, but that's how it is now. The only way to circumvent this is to use LTspice IV.To test this, the text file's contents looks like this:
and the schematic gives this after a
.op
:The numbers are some would-be Gaussian bell shape. The output looks like a straight line, but using the
View > Mark Data Points
shows that the distribution is nonlinear. Using.tran
will show different DC levels, as expected.