
Home  Forums  Rules  Articles  The diyAudio Store  Gallery  Blogs  Register  Donations  FAQ  Calendar  Search  Today's Posts  Mark Forums Read  Search 
Software Tools SPICE, PCB CAD, speaker design and measurement software, calculators 

Please consider donating to help us continue to serve you.
Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving 

Thread Tools  Search this Thread 
24th March 2015, 07:54 PM  #1 
diyAudio Member
Join Date: Dec 2010

LTSpice variable values question
Hello.
I'm trying to simulate an output stage with LTSpice and want to check what is the lowest noise I can get out of it by varying certain components. So far so good. I need to vary one resistor but that resistor changes the bias of the output stage. It's not the bias setting resistor, but another resistor. Now, I have to use the .step param for those two resistors so I can keep the bias at roughly the same value when varying the resistor in question. In the classical way that I know how to use this option the software will basically run through each step of the simulation like this. Let's say res1 and res2 are the variables, and the values are from 10 to 100 in steps of 10 (ohms) for each. The software will make 100 iterations for this setup as first it will use 10 ohms for res1 and 10 ohms for res2. The second iterations will be with 20 ohms for the first resistor and 10 ohms for the second. and so on. I'd like to know how to step two values at the same time. So the software will make a sim for 10/10 ohms then the second sim to be for 20/20 ohms. 
24th March 2015, 08:41 PM  #2  
diyAudio Member
Join Date: Feb 2003
Location: ..

you can step a numeric parameter say X
then you can calculate the value of each R based on a equation in X {X*100} or {X + 1k} the curly braces in a component's value field makes it calculate the value more indirectly you can make the .step param be the index into tables of values for each component the syntax is obscure  example files in the Yahoo LTspice group Quote:


24th March 2015, 09:10 PM  #3 
diyAudio Member
Join Date: Dec 2010

Thank you very much
I must read on this on the yahoo group. 
25th March 2015, 04:17 PM  #4 
diyAudio Member
Join Date: Sep 2009
Location: Santa Fe, Argentina

.step param X list 10 20 30 40 .....100
then name res1 = {X} and res2 = {X} the same as per step varying the two halves of a PP output transformer at once cheers J. 
25th March 2015, 07:36 PM  #5 
diyAudio Member
Join Date: Dec 2010

This is how I solved it:
.step param N 1 12 1 .param RES1=table(N,1,40,2,50,3,60,4,70,5,80,6,90,7,100,8 ,110,9,120,10,130,11,140,12,150) .param RES2=table(N,1,317,2,322,3,327,4,332,5,337,6,342,7 ,347,8,351.5,9,356,10,360.5,11,364.5,12,368) Someone over at LTSpice Yahoo group gave me the solution. 
Thread Tools  Search this Thread 


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
LTSpice Error Log THD values  macplauder  Software Tools  3  12th February 2015 07:21 PM 
Variable Resistor values  Karl vd Berg  Parts  5  10th October 2013 06:14 PM 
Variable PS question  Ripcord  Power Supplies  2  25th September 2013 03:16 AM 
LTspice / newbie question  3n2323  Solid State  27  26th April 2012 11:27 AM 
Generic snubber values: fixed/variablevoltage regs  hollowman  Power Supplies  44  28th April 2008 10:09 PM 
New To Site?  Need Help? 