Hi guys,
I am doing some simulation on audi-amps using ngspice producing quite a few datafiles.
For post-processing I prefer Matlab for more flexibility.
When doing it with ngspice stand-alone with gspiceui, it produces nice results-files in a csv-format with numbers represented in scientific format with a decimal point.
And what is highly important: all data are organized in columns, which eases post-processing with other tools.
Unfortunately the integrated ngspice simulator exports csv-data differently:
all data are organized in lines/rows.
This inhibits post-processing of bigger files (very long lines!) using exel and Matlab
All values have the comma as decimal-point and semi-colon as separator, which requires manual post-processing additionally.
Today I tried importing big simulation files into Matlab: failed
Import into exel: failed due to too many colums.
Manual post-processing with kate(texteditor) failed: lines too long.
The gEDA-workflow (gschem, gnetlist, gspiceui, gaw) produces convenient, applicable data.
This should work out with KiCad either, which is my preferred PCB-tool,
whereas the spice capabilities can still be improved.
Would it be possible to spend some more emphasis to spice integration and fix these small issues?
By adding a .control section to the Eeschema circuit diagram, replacing the previous single line in a text box
.ac dec 10 1 1Meg
you may use the output commands offered by stand-alone ngspice. This is an example:
.ac dec 10 1 1Meg
.control
* wait until simulation has finished
set controlswait
* cd into a directory with writing access
cd D:\Software\Spice\kicad\sallen_key
* set ouput format for cvs
set wr_vecnames
set wr_singlescale
option numdgt=7
* data to csv file
wrdata skey.csv "/lowpass"
* data to ps file
set hcopydevtype = postscript
hardcopy skey.ps db("/lowpass")
* gnuplot output (if gnuplot has been installed)
gnuplot skey.gn db("/lowpass")
.endc
Thanks, Holger for your very rapid response.
I have tried your proposal, it seems to be a good work-around for my issue.
Do you have a solution for exporting ALL nodes into the csv-file?
LG, sepp2gl
P.S.: I noticed, that the path for “cd …” is only interpreted in lower-case letter
independent from, what I wrote in the control-section.
So “cd ~/Projekte” was transformed into “cd ~/projekte” and consequently not found.
Do you know, how I can apply upper-case letters, too?
thx, sepp2gl