spice parameter sweep

Thread Starter

pretty_fly

Joined Feb 2, 2015
21
Hi

currently I am working on an amplifier circuit simulation for optimum RC constant by using LTspice. I want to vary 6 (R and C) parameters and save the resulting output of my amplifier but ltspice let me change only 3 of them. Then I need to change variable value manually for the other configurations.

directives ı used:
.step param R1 list 1k 10k 22k
.step param C1 list 1p 10p 22p
...
similiarly up to R6 and C6

Do you have any idea how to do that with LTspcie? Or any other spice simulator suggestion to do that?

Hope it is clear ...
Thank you :)
 

Alec_t

Joined Sep 17, 2013
10,920
If each parameter can take 3 values then LTS will need to run 3^6 = 729 sims. Won't that take up a lot of memory? How much memory have you allowed LTS to use for Fast Access Conversion (the default is 20% of RAM)?
 

Thread Starter

pretty_fly

Joined Feb 2, 2015
21
Alec_t thank you for your response :)

Actually I didnot allowed any memory specifically. Do you mean it is a memory problem?
The error message says "only three dimensions can be .STEP'ed "
 

eetech00

Joined Jun 8, 2013
1,838
Hi

currently I am working on an amplifier circuit simulation for optimum RC constant by using LTspice. I want to vary 6 (R and C) parameters and save the resulting output of my amplifier but ltspice let me change only 3 of them. Then I need to change variable value manually for the other configurations.

directives ı used:
.step param R1 list 1k 10k 22k
.step param C1 list 1p 10p 22p
...
similiarly up to R6 and C6

Do you have any idea how to do that with LTspcie? Or any other spice simulator suggestion to do that?

Hope it is clear ...
Thank you :)

For LTspice, use tables to define params. Like this:

.params R=tbl(n, 1,1k, 2,10k, 3, 22k)
.params C=tbl(n, 1,1p, 2,10p, 3,22p)

use {C} as cap value and {R} as resistor value

Then use step command
.step param n list 1,2,3
 

WBahn

Joined Mar 31, 2012
25,297
If each parameter can take 3 values then LTS will need to run 3^6 = 729 sims. Won't that take up a lot of memory? How much memory have you allowed LTS to use for Fast Access Conversion (the default is 20% of RAM)?
If I understand what he wants, he has 6 resistors and 6 capacitors, or 12 components, each of which he wants to take on 3 different values. So that would be 3^12 = 531,441 simulations. Even if each simulation only took one second, that would take over six days of continuous running time. Then he would have to sift through all of the data.
 

WBahn

Joined Mar 31, 2012
25,297
For LTspice, use tables to define params. Like this:

.params R=tbl(n, 1,1k, 2,10k, 3, 22k)
.params C=tbl(n, 1,1p, 2,10p, 3,22p)

use {C} as cap value and {R} as resistor value

Then use step command
.step param n list 1,2,3
But this wouldn't vary the parameters independently. For instance, in this case he would end up with three simulations covering just three of the nine possible combinations of R and C values. He would need to enumerate the tables for all nine possibilities. Doable for two parameters, but for twelve each table would need over half a million entries.
 

Veracohr

Joined Jan 3, 2011
695
You appear to have come up against a limitation.

Check out the mess that results from three stepped parameters with three steps each. Do you really want more?

Screen Shot 2016-01-18 at 10.48.07 AM.png
 

Thread Starter

pretty_fly

Joined Feb 2, 2015
21
WBahn you got what i mean :) little bit more detail...

I want to vary R1, C1, R2, C2, R3, C3 for same three values: 1k, 10k 22k & 5p, 10p, 22p

So out of very long simulation time is there any possiblity of doing this??

Veracohr, yes the graphical view is complicated. After finishing the simulation I am going to make selection depending on output signal width and amplitude. Thus the graphical view is not that much important for me.

At the end when I get the best configuration I want to concentrate on the PCB design etc ...
 
Last edited:

WBahn

Joined Mar 31, 2012
25,297
WBahn you got what i mean :)

little bit more detail...

I want to vary R1, C1, R2, C2, R3, C3 for same three values: 1k, 10k 22k & 5p, 10p, 22p

So out of very long simulation time is there any possiblity of doing this??
Will R1, R2, and R3 always be equal, or do you want all of the possible 27 ways of combining them?

How long does a single simulation take currently?
 

eetech00

Joined Jun 8, 2013
1,838
eetech00 thank you for your response but the result is the same. This is another version of what I've given above.
Hi

While it may not be what you wanted, it is not the same

the version I've shown will execute three runs.
the version you've shown will execute nine runs.
 

ifixit

Joined Nov 20, 2008
650
You could try copying the circuit you are testing multiple times and place within the same schematic. It will be placed with different component designations. Route the same test signal to each circuit. Each run will now test a set of component values at the same time.

How large is your circuit?
Are you doing AC analysis or transient?

Fixit
 

WBahn

Joined Mar 31, 2012
25,297
I don't think it's going to be practical unless he significantly reigns in the scope of the search space. He's talking about over half a million simulations
 

eetech00

Joined Jun 8, 2013
1,838
WBahn you got what i mean :) little bit more detail...

I want to vary R1, C1, R2, C2, R3, C3 for same three values: 1k, 10k 22k & 5p, 10p, 22p

So out of very long simulation time is there any possiblity of doing this??

Veracohr, yes the graphical view is complicated. After finishing the simulation I am going to make selection depending on output signal width and amplitude. Thus the graphical view is not that much important for me.

At the end when I get the best configuration I want to concentrate on the PCB design etc ...


I was under the impression you had 6 components you want to set to three different values for each run.
How about showing a schematic?
 

WBahn

Joined Mar 31, 2012
25,297
I was under the impression you had 6 components you want to set to three different values for each run.
How about showing a schematic?
I think this is the key thing he said in the OP that indicates it is a total of twelve components:

directives ı used:
.step param R1 list 1k 10k 22k
.step param C1 list 1p 10p 22p
...
similiarly up to R6 and C6
Other places it is a lot more ambiguous and depends on how you parse what was written.
 

Thread Starter

pretty_fly

Joined Feb 2, 2015
21
For three components (e.g R1,R2,R3) 27 simulations take almost 30 sec.

In that case I doubt you can increase ...
Well it seems predetermined. I thought maybe there is a "paid version" or someone can suggest another simulator capable to do this. I've checked for multisim on the web but can't see a word about such a limitation. Then I'll try it by installing and doing sim.

You could try ...
I'll try

... significantly reigns in the scope of the search space.
yes sure I have limited the num. of varying com. to 6 (R1,R2,R3 and C1,C2,C3) at first but still seeking for increasing the limit more than 3 components

How about showing a schematic?
It is just a very simple op-amp based amplifier circuit with R&C feedback and serial C&R connected to inv. input. Also
there is +V ref voltage connected to non-inv. input. thats all.
 

WBahn

Joined Mar 31, 2012
25,297
It is just a very simple op-amp based amplifier circuit with R&C feedback and serial C&R connected to inv. input. Also
there is +V ref voltage connected to non-inv. input. thats all.
Then how are you coming up with six resistors and six capacitors that you want to sweep?
 

WBahn

Joined Mar 31, 2012
25,297
There are three stages of same circuit.
Ah. I see. But that opens up some possibilities. Map out each stage separately (now you are dealing with just four components and running three simulation sets that each map out across three components is pretty straightforward).
 
Top