We have a thread here by keantoken at
http://www.diyaudio.com/forums/software-tools/150272-things-you-should-know-about-ltspice.html
and the Yahoo Group at
http://tech.groups.yahoo.com/group/LTspice/
I found another one at
LTspice Tutorial | The Complete Course
Trust all newcomers will find these useful.
http://www.diyaudio.com/forums/software-tools/150272-things-you-should-know-about-ltspice.html
and the Yahoo Group at
http://tech.groups.yahoo.com/group/LTspice/
I found another one at
LTspice Tutorial | The Complete Course
Trust all newcomers will find these useful.
I want output a list power power dissipation and voltage drop across every resistor in my simulation. I would rather do this than click on every element and create a ref voltage point at half the junctures. Also I want this for not just the .op command.
Anyone know how to do this? I assume you write to the log somehow?
Anyone know how to do this? I assume you write to the log somehow?
We have a thread here by keantoken at
http://www.diyaudio.com/forums/software-tools/150272-things-you-should-know-about-ltspice.html
and the Yahoo Group at
http://tech.groups.yahoo.com/group/LTspice/
I found another one at
LTspice Tutorial | The Complete Course
Trust all newcomers will find these useful.
Thank you
HI,
It is possible to run a simulation. ".four" to get the THD in the log file without the RAW file?
I have three ".step param" and LTspice is very slow from 1000 combination
It is possible do use more than three step ?
thanks
It is possible to run a simulation. ".four" to get the THD in the log file without the RAW file?
I have three ".step param" and LTspice is very slow from 1000 combination
It is possible do use more than three step ?
thanks
the fft is calculated from the raw data - have to have it
but you only need the waveforms that you are calculating the fft of: look up the .Save option
but you only need the waveforms that you are calculating the fft of: look up the .Save option
LTspice IV>Help> type in keyword .save
to put it on your schematic you have to use the <spice directive> button on the far right of the toolbar
to put it on your schematic you have to use the <spice directive> button on the far right of the toolbar
Attachments
Last edited:
you do turn off compression of the waveform data which LTspice does by default? - it will mess up higher resolution distortion measurement
for that I use the .option plotwinsize=0 directive on each schematic - if you do it in the control panel you will forget someday
for that I use the .option plotwinsize=0 directive on each schematic - if you do it in the control panel you will forget someday
on each schematic :
.OPTIONS plotwinsize=0
.OPTIONS numdgt=7
The HELP give any indication to Register only the thd
.save does not allow Registing THD without raw file
Do you know NGspice ? http://ngspice.sourceforge.net/
.OPTIONS plotwinsize=0
.OPTIONS numdgt=7
The HELP give any indication to Register only the thd
.save does not allow Registing THD without raw file
Do you know NGspice ? http://ngspice.sourceforge.net/
Last edited:
.four, .meas, the waveform and fft viewers are all post processors - they work by reading the data saved in the .raw file after Spice is done running the simulation
no other Spice will work any differently
if you don't need the information on every node, branch V,I then you can use .Save to list just those that you want to keep for the analysis in post processing
for instance I just did a sim with one of my circuits that created 95M .raw file
with the directive:
.Save Is(M1)
the .raw is only 3.5M
if your circuit needs some time to settle from the turn on transient you can also cut the size of the .raw output by specifying in the .tran a time to start saving data - just save the last cycle of the analysis frequency of your .four fundamental
but the post processors all require the .raw saved data, no way around that
in the LTspice Yahoo Group you can find some optimizer scripts that modify the netlist and call LTspice, then grab the data needed from the .log file with text filters, and repeat with new calculated netlist values for the parts being optimized
in that mode the .raw never needs to be bigger than the single run instead of having 100s or 1000 .steps
no other Spice will work any differently
if you don't need the information on every node, branch V,I then you can use .Save to list just those that you want to keep for the analysis in post processing
for instance I just did a sim with one of my circuits that created 95M .raw file
with the directive:
.Save Is(M1)
the .raw is only 3.5M
if your circuit needs some time to settle from the turn on transient you can also cut the size of the .raw output by specifying in the .tran a time to start saving data - just save the last cycle of the analysis frequency of your .four fundamental
but the post processors all require the .raw saved data, no way around that
in the LTspice Yahoo Group you can find some optimizer scripts that modify the netlist and call LTspice, then grab the data needed from the .log file with text filters, and repeat with new calculated netlist values for the parts being optimized
in that mode the .raw never needs to be bigger than the single run instead of having 100s or 1000 .steps
Last edited:
I have made a python script to run LTspice in batch mode
Currently there is only one variable ({RA}) but I'll update it to use N variable
The output file is a CSV
Currently there is only one variable ({RA}) but I'll update it to use N variable
The output file is a CSV
Code:
import os
import subprocess
SPICEEXE='C:\LTC\LTspiceIV\scad3.exe '
INFILE='C:\PERSO\SIMULATION\LTSPICE\ZERO\MODBATCH.cir'
TMPFILE='C:\PERSO\SIMULATION\LTSPICE\ZERO\MOD_OUT.cir'
OUTFILE = open('C:\PERSO\SIMULATION\LTSPICE\ZERO\MOD_OUT.csv','w+')
RA = 1
RA_MAX = 10
RA_INC =1
while RA <= RA_MAX:
fin = open(INFILE,'r+')
fout = open(TMPFILE, 'w+')
for line in fin:
line = line.replace("{RA}", str(RA))
fout.write(line)
fin.close()
fout.close()
subprocess.call(SPICEEXE + TMPFILE+ " -b")
LOGFILE = open('C:\PERSO\SIMULATION\LTSPICE\ZERO\MOD_OUT.log', 'r+')
for log in LOGFILE:
if log.find('Distortion:') > 0:
OUTFILE.write(str(RA) + ';')
OUTFILE.write((log.split('Distortion: ')[1][:-2] + '\n').replace(".",","))
RA = RA + RA_INC
OUTFILE.close()
Code:
RA;THD
1;0,013499
2;0,026174
3;0,039158
4;0,051854
5;0,064181
6;0,076044
7;0,087379
8;0,097919
9;0,107979
10;0,117220
Last edited:
Could you please provide an example why varying 20 variables at the same time would be useful or needed?halo mister
is there any way to increase .step
it usually maximum 3 variabel
i want 20
just 2 steps of 20 independent vars is a Million runs of the sim - not too practical
you may want the table functionality to set many vars with a single step index
you may want the table functionality to set many vars with a single step index
halo mister
lot variable step is required to optimize the circuit
to look for maximum amplitude with low distortion
i want to analyze 5th order distortion to 2nd distortion
so the max amplitude not will low thd but have low higher odd distortion also
if the step not limited to 3, i m sure a more lot people want to use it
lot variable step is required to optimize the circuit
to look for maximum amplitude with low distortion
i want to analyze 5th order distortion to 2nd distortion
so the max amplitude not will low thd but have low higher odd distortion also
if the step not limited to 3, i m sure a more lot people want to use it
Attachments
The part tolerances for tube amps are quite wide and drift with tube aging, so if you have to optimize 20 parameters just to get ultra-low distortion, then why not just stick with a pure SS design?
Also take a look at using the Monte Carlo function in LTSpice, I don't think there is a limit on the number of components that can be used, if there is, it is probably higher than 3.
Also take a look at using the Monte Carlo function in LTSpice, I don't think there is a limit on the number of components that can be used, if there is, it is probably higher than 3.
Last edited:
- Status
- Not open for further replies.
- Home
- Design & Build
- Software Tools
- LTSpice tutorials and threads