LTSpice variable values question
 User Name Stay logged in? Password
 Home Forums Rules Articles diyAudio Store Blogs Gallery Wiki 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
 24th March 2015, 07:54 PM #1 Trileru   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.
jcx
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:
 Originally Posted by analogspiceman There is a very active Yahoo Group dedicated to LTspice. It's at http://groups.yahoo.com/group/LTspice. Your particular question has been discussed there several times. All posts are archived and are searchable. Also, the files section contains much useful reference material, models, and example circuits. You can make the values of the components you wish to vary a table function of a stepped parameter. Use the ".step" command to step the controlling parameter (e.g. .step param n list 1 2 3...) to get several runs to appear in one plot. Then edit the value field of the target components to depend on this parameter (e.g. {tbl(n,1,1k,2,1p,3,1T} ). Be sure to enclose the parametrized expression in curly braces. Use extremely large values to "disconnect" the component and extremely small values to short it out. To display only a particular step in the plot window suffix the trace expression with the step selection operator "@n", where n is the desired step number. Most of this information is contained in the help file and is accessible via the help search function.

 24th March 2015, 09:10 PM #3 Trileru   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 Mosquito   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 Trileru   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.

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Site     Site Announcements     Forum Problems Amplifiers     Solid State     Pass Labs     Tubes / Valves     Chip Amps     Class D     Power Supplies     Headphone Systems Source & Line     Analogue Source     Analog Line Level     Digital Source     Digital Line Level     PC Based Loudspeakers     Multi-Way     Full Range     Subwoofers     Planars & Exotics Live Sound     PA Systems     Instruments and Amps Design & Build     Parts     Equipment & Tools     Construction Tips     Software Tools General Interest     Car Audio     diyAudio.com Articles     Music     Everything Else Member Areas     Introductions     The Lounge     Clubs & Events     In Memoriam The Moving Image Commercial Sector     Swap Meet     Group Buys     The diyAudio Store     Vendor Forums         Vendor's Bazaar         Sonic Craft         Apex Jr         Audio Sector         Acoustic Fun         Chipamp         DIY HiFi Supply         Elekit         Elektor         Mains Cables R Us         Parts Connexion         Planet 10 hifi         Quanghao Audio Design         Siliconray Online Electronics Store         Tubelab     Manufacturers         AKSA         Audio Poutine         Musicaltech         Holton Precision Audio         CSS         Dx Classic Amplifiers         exaDevices         Feastrex         GedLee         Head 'n' HiFi - Walter         Heatsink USA         miniDSP         SITO Audio         Twin Audio         Twisted Pear         Wild Burro Audio

 Similar Threads Thread Thread Starter Forum Replies Last Post macplauder Software Tools 3 12th February 2015 07:21 PM Karl vd Berg Parts 5 10th October 2013 06:14 PM Ripcord Power Supplies 2 25th September 2013 03:16 AM 3n2323 Solid State 27 26th April 2012 11:27 AM hollowman Power Supplies 44 28th April 2008 10:09 PM

 New To Site? Need Help?

All times are GMT. The time now is 08:03 AM.

Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.