What was your problem exactly? I got the same result each time , as if the alter statement was neglected and the time column from the analysis appeared in the first column. thanks for your solution, it works like a charm kind regards, Hugo
I'm trying to get the results of a measure statement using consecutive values for a component. As a trivial example I made a simple voltage divider and try to measure the output amplitude (at node 2) of it. My input file, which does not give me the expected result, looks like this: test param vin 1 0 dc sin(0 1 1k) r1 1 2 1k r2 2 0 1k .control set filetype ascii option unixcom set nobreak tran 10u 2ms 0 10u shell rm $HOME/resultsmultipleruns.dat set appendwrite set filetype=ascii foreach rvar 100...
I'm trying to get the results of a measure statement using consecutive values for a component. As a trivial example I made a simple voltage divider and try to measure the output amplitude (at node 2) of it. My input file looks like this: test param vin 1 0 dc sin(0 1 1k) r1 1 2 1k r2 2 0 1k .control set filetype ascii option unixcom set nobreak tran 10u 2ms 0 10u shell rm $HOME/resultsmultipleruns.dat set appendwrite set filetype=ascii foreach rvar 100 200 500 alter r2 $rvar run meas tran UOP MAX...
Maybe you could use a square wave (using a PULSE-source) with a 50% duty-cycle?
Dear Marcel, Thanks for the explanation. Do you think I'd better put my request concerning "the little window" on the Kicad-forum? kind regards, hugo
Marcel worte: I realize now that you are running from within KiCAD. I guess that environment does not show a window where you can see the feedback from ngspice stating that it is still running: during a .TRAN it prints the scale value (sim time) to the display every 0.5 - 1 (wall-clock) seconds. Do you mean by scale value (sim time) the "current" simulation time? and is this the same as that "reference value"? I looked up "reference value" in the ngspice-manual and only found this (which is not related...
Marcel worte: I realize now that you are running from within KiCAD. I guess that environment does not show a window where you can see the feedback from ngspice stating that it is still running: during a .TRAN it prints the scale value (sim time) to the display every 0.5 - 1 (wall-clock) seconds. Do you mean by scale value (sim time) the "current" simulation time? and is this the same as that "reference value"? I looked up "reference value" in the ngspice-manual and only found this (which is not related...
Marcel wrote: Weird in what way? Well, when I run the same simulation I expect to see the same output each time. Could you explain what that "reference value" is? kind regards, Hugo
When rerunning a simulation over and over again from within the kicad graphical postprocessor I get different outputs: first result: Reference value : 0.00000e+00 No. of Data Rows : 108 vrptp = 9.613680e-02 from= 0.000000e+00 to= 0.000000e+00 another result: No. of Data Rows : 108 vrptp = 9.613680e-02 from= 0.000000e+00 to= 0.000000e+00 (No reference value is printed in this case, comment by me) another result: Reference value : 8.85600e-04 No. of Data Rows : 108 vrptp = 9.613680e-02 from= 0.000000e+00...
When rerunning a simulation over and over again from within the kicad graphical postprocessor I get different outputs: 1. Reference value : 0.00000e+00 No. of Data Rows : 108 vrptp = 9.613680e-02 from= 0.000000e+00 to= 0.000000e+00 No. of Data Rows : 108 vrptp = 9.613680e-02 from= 0.000000e+00 to= 0.000000e+00 (No reference value is printed in this case, comment by me) Reference value : 8.85600e-04 No. of Data Rows : 108 vrptp = 9.613680e-02 from= 0.000000e+00 to= 0.000000e+00 Reference value : 3.25600e-04...
When rerunning a simulation over and over again from within the kicad graphical postprocessor I get different outputs: 1. Reference value : 0.00000e+00 No. of Data Rows : 108 vrptp = 9.613680e-02 from= 0.000000e+00 to= 0.000000e+00 No. of Data Rows : 108 vrptp = 9.613680e-02 from= 0.000000e+00 to= 0.000000e+00 Reference value : 8.85600e-04 No. of Data Rows : 108 vrptp = 9.613680e-02 from= 0.000000e+00 to= 0.000000e+00 Reference value : 3.25600e-04 No. of Data Rows : 108 vrptp = 9.613680e-02 from=...
I found out print v(1) does show the i-sweep values in the second column hugo
Thanks Marcel, destroy all works fine. The alias definition with ALL written in capitals does not work: alias cold DESTROY ALL; RUN But the following definitions do work: alias cold DESTROY all;RUN or alias cold destroy all; run thanks for the help offered and kind regards, Hugo
Each time a simulation is rerun, a new plot is generated e.g tran1, tran2, tran3, tran4... Is it possible to just have exactly one plot (coming from the last simulation) by executing/adding a certain command? kind regards, Hugo
Dear Marcel, Thanks for the explanation. Maybe ngspice could produce a more specific error message for statements such as: .dc i1 -0.05m -5m 0.025m (which work in 2G6 and PSpice). Now one just gets the message: No. of Data Rows : 0 Error: no such vector v(1) A little related extra question: When simulating the file, you presented, with ngspice and issuing the display command, I get this: Title: dc characteristic with ngspice Name: dc1 (DC transfer characteristic) Date: Mon Jan 27 10:03:51 2020 V(1)...
Dear Marcel, Thanks for the explanation. Maybe ngspice could produce a more specific error message for statements such as: .dc i1 -0.05m -5m 0.025m (which work in 2G6 and PSpice). Now one just gets the message: No. of Data Rows : 0 Error: no such vector v(1) A little related extra question: When simulating the file, you presented, with ngspice and issuing the display command, I get this: Title: dc characteristic with ngspice Name: dc1 (DC transfer characteristic) Date: Mon Jan 27 10:03:51 2020 V(1)...
Dear Marcel, Thanks for the explanation. Maybe ngspice could produce a more specific error message for statements such as: .dc i1 -0.05m -5m 0.025m (which work in 2G6 and PSpice). Now one just gets the message: No. of Data Rows : 0 Error: no such vector v(1) A little related extra question: When simulating the file, you presented, with ngspice and issuing the display command, I get this: Title: dc characteristic with ngspice Name: dc1 (DC transfer characteristic) Date: Mon Jan 27 10:03:51 2020 V(1)...
Dear Marcel, Thanks for the explanation. Maybe ngspice could produce a more specific error message for statements such as: .dc i1 -0.05m -5m 0.025m (which work in 2G6 and PSpice). Now one just gets the message: No. of Data Rows : 0 Error: no such vector v(1) A little related extra question: When simulating the file you presented with ngspice and issuing the display command, I get this: Title: dc characteristic with ngspice Name: dc1 (DC transfer characteristic) Date: Mon Jan 27 10:03:51 2020 V(1)...
I'm wondering why the following circuitfile dcngspice.cir does not give the expected result with ngspice while the 'equivalent file' dc2g6.cir works with spice 2g6 dc characteristic with ngspice d1 1 0 model1 i1 1 0 dc 1m .model model1 d is=3n rs=1 .control dc i1 -0.05m -5m 0.025m print v(1) .endc .end dc characteristic with spice2g6 d1 1 0 model1 i1 1 0 dc 1m .model model1 d is=3n rs=1 .dc i1 -0.05m -5m 0.025m .print dc v(1) .plot dc v(1) .end kind regards, Hugo
Just wondering: would it also be possible to plot the data produced (which is dumped in kleinsignaal.dat now) from within ngspice itself? kind regards, Hugo
Just wondering: would it also be possible to plot the data produced from within ngspice itself? kind regards, Hugo
Just wondering: would it also be possible to plot the data produced from with ngspice itself? kind regards, Hugo
Marcel wrote: You didn't use the setscale trick. I did use it Marcel, it works fine. I just changed "shell del smallsignal.dat" to "shell rm smallsignal.dat" in that version (which is indeed the most elegant one) hartelijk bedankt! Hugo
Thanks a lot Marcel, This works perfectly. I changed a few names in your code below (my fault, due to sloppy changing some Dutch to English) such that other people can use your code out of the box. I also changed "del" to "rm", in the shell command to make things happen under my linux installation. .TITLE small signal diode iin 0 1 dc 500u ac 1d1 1 0 d1mod .model d1mod d is=0.1p n=2 rs=0.1 .ac lin 1 1k 1k .control set unixcom shell rm smallsignal.dat set appendwrite set filetype=ascii foreach i_act...
Thanks a lot Marcel, This works perfectly. I changed a few names in your code below (my fault, due to sloppy changing some Dutch to English) such that other people can use your code out of the box. .TITLE small signal diode iin 0 1 dc 500u ac 1d1 1 0 d1mod .model d1mod d is=0.1p n=2 rs=0.1 .ac lin 1 1k 1k .control set unixcom shell del smallsignal.dat set appendwrite set filetype=ascii foreach i_act 500u 560u 630u 670u 710u 830u 1m alter iin dc=$i_act run set wr_singlescale wrdata smallsignal.dat...
Dick Freebird wrote: Would it work to: put the i_act values in floating point notation, to start with? Maybe that will set its type to print as such. put the print statement in the form {$i_act}? Maybe forcing it to evaluate will cause conversion to FLOAT? Dear Dick, I tried out both your suggestions but they don't work. Meanwhile Marcel Hendrix came with a beautiful solution. Anyway thanks for taking your time to try to help. kind regards, Hugo
Clyde wrote: It also appears you are mixing the output data in a fashion which may not be intended. An alternative approach to post processing the data is to use Gnu Octave. It has a very nice function for reading in tabular data (which needs not be CSV data). This function is m=dlmread ('your_file.txt'); and puts the tabular data in matrix m. Even though I'd prefer to do as much as possible within Ngspice itself, I tried out your suggestion, but I noticed it will need extra fiddling around too,...
Clyde wrote: It also appears you are mixing the output data in a fashion which may not be intended. An alternative approach to post processing the data is to use Gnu Octave. It has a very nice function for reading in tabular data (which needs not be CSV data). This function is m=dlmread ('your_file.txt'); and puts the tabular data in matrix m. Even though I'd prefer to do as much as possible within Ngspice, I tried out your suggestion, but it will need extra fiddling around too, as the data rows...
Justin Fisher wrote I usually take the output as a text file then manipulate to my own taste with a perl script. Dear Justin, Resorting to postprocessing (which I have done in the past for the equivalent of this problem with spice2g6) is indeed an option, but as ngspice is much more powerful than spice 2g6, I hope there might be a solution to do everything from within ngspice itself. kind regards, Hugo
I made the following input file: small signal diode iin 0 1 dc 500u ac 1 d1 1 0 d1mod .model d1mod d is=0.1p n=2 rs=0.1 .ac lin 1 1k 1k .control set unixcom rm -f smallsignal.dat set appendwrite foreach i_act 500u 560u 630u 670u 710u 830u 1m alter iin dc=$i_act run set wr_singlescale wrdata smallsignal.dat vm(1) print $i_act >>smallsignal.dat end unset appendwrite .endc .end The simulation results are as expected but the formatting is not optimal. I'm trying to make a simple space separated list...
Justin Fisher wrote I usually take the output as a text file then manipulate to my own taste with a perl script. Dear Justin, Resorting to postprocessing (which I have done in the past for the equivalent of this problem with spice2g6) is indeed an option, but as ngspice is much more powerful than spice 2g6, I hope there might be a solution to do everything from within ngspice itself. kind regards, Hugo
I made the following input file: small signal diode iin 0 1 dc 500u ac 1 d1 1 0 d1mod .model d1mod d is=0.1p n=2 rs=0.1 .ac lin 1 1k 1k .control set unixcom rm -f smallsignal.dat set appendwrite foreach i_act 500u 560u 630u 670u 710u 830u 1m alter iin dc=$i_act run set wr_singlescale wrdata kleinsignaal.dat vm(1) print $i_act >>kleinsignaal.dat end unset appendwrite .endc .end The simulation results are as expected but the formatting is not optimal. I'm trying to make a simple space separated list...
Add extra space to compile command on page 618 of the manual
Show bias point automatically when performing AC analysis
haven't done this exactly, but have messed around with something like it. I think for the basename / filename you may have to take it in "bites", string concatenation seems a bit "iffy" when you are working directly on literal test strings (how can it know whether '.out' is part of the preceding string, or "its own thing"? But you could make set basename="vb1ngspice" set outsuffix=".out" set outfile={$basename}{$outsuffix} echo $outfile echo $outfile >>$outfile wrdata $outfile v(1) i(vin) v(2) and...
As I am using a lot of statements like echo ''>>vb1ngspice.out wrdata vb1ngspice.out v(1) i(vin) v(2) write vb1ngspice.raw It would be nice to set a "basename" once and then refer to that in the following statements. If bash could be used here (but it can't) something like: export basename='vb1ngspice' echo ''>>$basename.out wrdata $basename.out v(1) i(vin) v(2 Does someone here know how to accomplish this? kind regards, Hugo
Thanks for the suggestion Marcel, I will add --enable-openmp kind regards, Hugo
Thanks for the tip Marcel, kind regards, Hugo
/configure --enable-xspice --enable-cider--disable-debug --with-readline=yes CFLAGS="-m64 -O2" LDFLAGS="-m64 -s" Got this warning: configure: WARNING: unrecognized options: --enable-cider--disable-de$ --enable-cider--disable-debug ^ A blank is missing here! You are right Holger, silly me, I should have looked better at the warning. The reason why I got it wrong was copy pasting the command straight from the current ngspice-manual on page 618. Maybe it would be better to add a space after --enable-cider...
Dear Marcel, Thanks for your reply. I had ngspice installed with the package manager (apt) on Mint 19.2 and as I said the call back functionality (command history of a previous session) did not work. Following your advice I havecompiled the source code myself. This is how I proceeded: git clone git://git.code.sf.net/p/ngspice/ngspice cd ngspice sudo apt install autoconf sudo apt install automake sudo apt install libtool sudo apt install libreadline-dev (without this I got: configure: error: Couldn't...
Dear Marcel, Thanks for your reply. I had ngspice installed with the package manager (apt) on Mint 19.2 and as I said the call back functionality (command history of a previous session) did not work. Following your advice I havecompiled the source code myself. This is how I proceeded: git clone git://git.code.sf.net/p/ngspice/ngspice cd ngspice sudo apt install autoconf sudo apt install automake sudo apt install libtool sudo apt install libreadline-dev (without this I got: configure: error: Couldn't...
Dear Marcel, Thanks for your reply. I had ngspice installed with the package manager (apt) on Mint 19.2 and as I said the call back functionality did not work. Following your advice I havecompiled the source code myself. This is how I proceeded: git clone git://git.code.sf.net/p/ngspice/ngspice cd ngspice sudo apt install autoconf sudo apt install automake sudo apt install libtool sudo apt install libreadline-dev (without this I got: configure: error: Couldn't find GNU readline headers) sudo apt...
Dear Marcel, Thanks for your reply. I had ngspice installed with the package manager (apt) on Mint 19.2 and as I said the call back functionality did not work. Following your advice I havecompiled the source code myself. This is how I proceeded: git clone git://git.code.sf.net/p/ngspice/ngspice cd ngspice sudo apt install autoconf sudo apt install automake sudo apt install libtool sudo apt install libreadline-dev (without this I got: configure: error: Couldn't find GNU readline headers) sudo apt...
Dear Holger, Thanks a lot for your reply, the print all statement was what I missed. I do find it a bit strange/inconsequent that for a transient analysis e.g. tran 0.5m 40m the Initial Transient Solution is automatically given like this: ngspice 1 -> tran 0.5m 40m Doing analysis at TEMP = 27.000000 and TNOM = 27.000000 Initial Transient Solution Node Voltage ---- ------- 1 0 2 1.22588e-22 vin#branch -1.22588e-25 But for an AC analysis the bias point isn't given automatically after e.g ac dec 20...
Dear Holger, Thanks a lot for your reply, the print all statement was what I missed. I do find it a bit strange/inconsequent that for a transient analysis e.g. tran 0.5m 40m the Initial Transient Solution is automatically given like this: ngspice 1 -> tran 0.5m 40m Doing analysis at TEMP = 27.000000 and TNOM = 27.000000 Initial Transient Solution Node Voltage ---- ------- 1 0 2 1.22588e-22 vin#branch -1.22588e-25 But for an AC analysis the bias point isn't given automatically after e.g ac dec 20...
Dear Holger, Thanks a lot for your reply, the print all statement was what I missed. I do find it a bit strange/inconsequent that for a transient analysis e.g. tran 0.5m 40m the Initial Transient Solution is automatically given like this: ngspice 1 -> tran 0.5m 40m Doing analysis at TEMP = 27.000000 and TNOM = 27.000000 Initial Transient Solution Node Voltage ---- ------- 1 0 2 1.22588e-22 vin#branch -1.22588e-25 But for an AC analysis the bias point isn't given automatically after e.g ac dec 20...
Dear Holger, Thanks a lot for your reply, the print all statement was what I missed. I do find it a bit strange/inconsequent that for a transient analysis e.g. tran 0.5m 40m the Initial Transient Solution is automatically given like this: ngspice 1 -> tran 0.5m 40m Doing analysis at TEMP = 27.000000 and TNOM = 27.000000 Initial Transient Solution Node Voltage ---- ------- 1 0 2 1.22588e-22 vin#branch -1.22588e-25 But for an AC analysis the bias point isn't given automatically after e.g ac dec 20...
Dear Holger, Thanks a lot for your reply, the print all statement was what I missed. I do find it a bit strange/inconsequent that for a transient analysis e.g. tran 0.5m 40m the Initial Transient Solution is automatically given like this: ngspice 1 -> tran 0.5m 40m Doing analysis at TEMP = 27.000000 and TNOM = 27.000000 Initial Transient Solution Node Voltage ---- ------- 1 0 2 1.22588e-22 vin#branch -1.22588e-25 But for an AC analysis the bias point isn't given automatically after e.g ac dec 20...
Dear Holger, Thanks a lot for your reply, the print all statement was what I missed. I do find it a bit strange/inconsequent that for a transient analysis e.g. tran 0.5m 40m the Initial Transient Solution is automatically given like this: ngspice 1 -> tran 0.5m 40m Doing analysis at TEMP = 27.000000 and TNOM = 27.000000 Initial Transient Solution Node Voltage ---- ------- 1 0 2 1.22588e-22 vin#branch -1.22588e-25 But for an AC analysis the bias point isn't given automatically after e.g ac dec 20...
Is it possible to make the bias point preceding an AC analysis visible? Or do I have to put in an explicit .op statement to achieve this? I tried out several approaches but none of them gives me the bias point. Here is my input file: ac test -- sac.cir v1 1 0 dc 0 ac 1 r1 1 0 10k .op .control op listing >sac.out ac dec 20 1m 100k print v(1) >> sac.out asciiplot v(1) >> sac.out write sac.raw .endc .end kind regards, Hugo
Is it possible to make the bias point preceding an AC analysis visible? Or do I have to put in an explicit .op statement to achieve this? I tried out several approaches but none of them gives me the bias point. Here is my input file: ac test -- sac.cir v1 1 0 dc 0 ac 1 r1 1 0 10k .op .control op option nopage width = 132 *option keepopinfo listing >sac.out ac dec 20 1m 100k print v(1) >> sac.out asciiplot v(1) >> sac.out write sac.raw .endc .end kind regards, Hugo
Is it possible to make the bias point preceding an AC analysis visible? Or do I have to put in an explicit .op statement to achieve this? I tried out several approaches but none gives me the bias point. Here is my input file: ac test -- sac.cir v1 1 0 dc 0 ac 1 r1 1 0 10k .op .control op option nopage width = 132 *option keepopinfo listing >sac.out ac dec 20 1m 100k print v(1) >> sac.out asciiplot v(1) >> sac.out write sac.raw .endc .end kind regards, Hugo
Is it possible to make the bias point preceding an AC analysis visible? Or do I have to put in an explicit .op statement to achieve this? kind regards, Hugo
Is it possible to make the bias point preceding an AC analysis visible? Or do I have put in an explicit .op statement to achieve this? kind regards, Hugo
Is it possible to make the bias point preceding an AC analysis visible? Do I have put in an explicit .op statement to achieve this? kind regards, Hugo
I'd like to modify the file below to print the initial transient solution to the file s.out sin test -- s.cir v1 1 0 dc 0 sin (0 1 1000) r1 1 0 10k .control option nopage width = 132 tran 0.03m 5m listing >s.out print v(1) >> s.out asciiplot v(1) >> s.out write s.raw .endc .end kind regards, Hugo
Is it possible to call back commands from a previous ngspice interactive session? I looked in the manual on page 328 and there is written: When the environment variable HOME exists (on Unix, Linux, or CYGWIN), history permanently stores previous command lines in the file$HOME/._ngspice_history. However even though the environment variable HOME exists on my system coolens@antec2:~$ printenv |grep HOME HOME=/home/coolens the file ~/._ngspice_history is not created and I can't reexecute commands from...
Is it possible to call back commands from a previous ngspice interactive session? I looked in the manual on page 328 and there is written: When the environment variable HOME exists (on Unix, Linux, or CYGWIN), history permanently stores previous command lines in the file$HOME/._ngspice_history. However even though the environment variable HOME exists on my system coolens@antec2:~$ printenv |grep HOME HOME=/home/coolens the file *._ngspice_history is not created and I can't reexecute commands from...
Is it possible to call back commands from a previous ngspice interactive session? I looked in the manual on page 328 and there is written: When the environment variable HOME exists (on Unix, Linux, or CYGWIN), history permanently stores previous command lines in the file$HOME/._ngspice_history. However even though the environment variable HOME exists on my system coolens@antec2:~$ printenv |grep HOME HOME=/home/coolens the file *._ngspice_history is not created and I can't reexecute commands from...
Adding quitbefore .endc does work when using ngspice input.cir
Did you look at the PP (peak-to-peak) measurement? Thanks for the suggestion Marcel, the following line does the trick: meas tran rptp pp v(2) from=10m to=40m kind regards, Hugo
Did you look at the PP (peak-to-peak) measurement? Thanks for the suggestion Marcel, the following line does the trick: meas tran rptp pp v(2) from=10m to=40m kind regards, Hugo
What about let vrpp = ymax - ymin ? Thanks. Putting the lines here below in the control section works great: let vrpp = ymax - ymin print vrpp Just wondering whether it could also possible to produce this vrpp result in 1 meas statement? thanks and kind regards, Hugo
I'm trying to measure the peak-to-peak ripple voltage of a simple rectifier circuit with buffer elco. I do get the correct peak voltage (ymax) and trough-voltage (ymin) but until now I couldn't figure out how to determine the difference ymax-ymin between the two. You can see in the file below some attempts in the commented spice-cards. Simulation of a rectifier with buffer elco vin 1 0 dc 0 sin(0 20 50) r1 2 0 1k c1 2 0 100u d1 1 2 d1n4001 .model d1n4001 d is=29.5E-9 rs=73.5E-3 n=1.96 cjo=34.6P vj=0.627...
Dear Clyde, As you may have noticed I corrected my original answer because your solution does in fact work despite a somewhat misleading Note. So thanks for your suggestion! kind regards, Hugo p.s.: To avoid the "Note about no simulations run": ngspice <vb1ngspice.inp >/dev/null 2>&1
Dear Clyde, As you may have noticed I corrected my original answer because your solution does in fact work despite a somewhat misleading Note. So thanks for your suggestion! kind regards, Hugo p.s.: To avoid the "Note about no simulations run": ngspice <vb1ngspice.inp>/dev/null 2>&1</vb1ngspice.inp>
Dear Clyde, As you may have noticed I corrected my original answer because your solution does in fact work despite a somewhat misleading Note. So thanks for your suggestion! kind regards, Hugo To avoid the "Note about no simulations run": p.s. ngspice <vb1ngspice.inp>/dev/null 2>&1</vb1ngspice.inp>
Dear Clyde, Thanks for taking a look at it. First I thought your solution did not work using the method which I tried to use in the original question: ngspice <s.cir as it resulted in: Note: No ".plot", ".print", or ".fourier" lines; no simulations run However the simulation is in fact run. In other words: the Note can be disregarded. It would be nice if I could suppress it. As Marcel Hendrix mentioned starting the simulation as ngspice s.cir also works but then you have to manually enter a quit...
Dear Clyde, Thanks for taking a look at it. First I thought your solution did not work using the method which I tried to use in the original question: ngspice <s.cir as it resulted in: Note: No ".plot", ".print", or ".fourier" lines; no simulations run However the simulation is in fact run. In other words: the Note can be disregarded. It would be nice if I could suppress it. As Marcel Hendrix mentioned starting the simulation as ngspice s.cir also works but then you have to manually enter a quit...
Dear Clyde, Thanks for taking a look at it. Unfortunately your solution does not work using the method which I tried to use in the original question: ngspice <s.cir>s.out as it results in:</s.cir> Note: No ".plot", ".print", or ".fourier" lines; no simulations run Neither does it work with ngspice -b s.cir It only works using ngspice interactively: ngspice <cr> source s.cir <cr></cr></cr> but that was not what I was looking for. Anyway, I have to accept Volger's answer: Unfortunately there is no...
Dear Clyde, Thanks for taking a look at it. Unfortunately your solution does not work using the method which I tried to use in the original question: ngspice <s.cir>s.out as it results in: Note: No ".plot", ".print", or ".fourier" lines; no simulations run</s.cir> Neither does it work with ngspice -b s.cir It only works using ngspice interactively: ngspice <cr> source s.cir <cr></cr></cr> but that was not what I was looking for. Anyway, I have to accept Volger's answer: Unfortunately there is no...
Dear Holger, I do indeed see the simulation is started twice and understand this behaviour is caused by the run command in the control section. The problem is when I leave out the run command in the control section, the wrdata statement is no longer executed. Could you possibly edit the original circuit file to show exactly your solution such that I get a file example.out with the result of the transient analysis printed once in it and a file example.dat from the wrdata statement using ngspice <example.inp...
Dear Holger, I do indeed see the simulation is started twice and understand this behaviour is caused by the run command in the control section. The problem is when I leave out the run commando in the control section, the wrdata statement is no longer executed. Could you possibly edit the original circuit file to show exactly your solution such that I get a file example.out with the result of the transient analysis printed once in it and a file example.dat from the wrdata statement using ngspice <example.inp...
Dear Holger, I do indeed see the simulation is started twice and understand this behaviour is caused by the run command in the control section. The problem is when I leave out the run commando in the control section, the wrdata statement is no longer executed. Could you possibly edit the original circuit file to show exactly your solution such that I get a file example.out with the result of the transient analysis printed once in it and a file example.dat from the wrdata statement using: ngspice...
I am also unable to see the content of example.out. Clicking on Marcel's link gives me Whoops, we can't find that page. .. Hugo
Dear Marcel, Thanks for considering my question. I'm a bit surprised not to see you answer in the ngspice-forum but only in my gmail-box. Unfortunately, I can't download the attachments in your e-mail. Could you attach them in a regular way or post them in the forum? kind regards, Hugo Op wo 4 dec. 2019 om 23:32 schreef marcel hendrix mhx_at_sf@users.sourceforge.net: Twice? An older version of ngspice gives the attached files. example.out also contains the listing that you asked for. Attachments:...
I'm trying to run ngspice like this ngspice <example.inp>example.out with the following content for example.inp:</example.inp> example 1 vin 1 0 dc 0 sin(0 5 50 0 0) r1 2 0 1k c1 2 0 100u d1 1 2 model1 .model model1 d is=3n rs=10 .tran 0.5m 40m .print tran v(1) i(vin) v(2) .plot tran v(1) i(vin) v(2) .control set nobreak listing *if I comment out run in the line below *I don't get the file example.dat *If I leave it in I get the output *of the print and plot statements twice in example.out run set...
Is there a control statement which makes it possible to get the phase always in degrees when using a wrdata statement. I know I can write "wrdata myfile.dat vp(2)*180/pi", but I presume there is a more elegant way to accomplish this than always adding that "*180/pi"? kind regards, Hugo
Is there a control statement which makes it possible to get the phase always in degrees when using a wrdata statement. I know I can write "wrdata myfile.dat vp(2)180/pi", but I presume there is a more elegant way to accomplish this than always adding that "180/pi"? kind regards, Hugo
Is there a control statement which makes it possible to get the phase always in degrees when using a wrdata statement. I know I can write "wrdata myfile.dat vp(2)180/pi", but I presume there is a more elegant way to accomplish this than always adding that "180/pi"? kind regards, Hugo
Please have a look at the manual, chapt. 17.5.93 Dear Holger, I noticed I was looking in the user manual from 1-1-2019 which didn't help me, but the solution is indeed given in the current version of the user manual: set wr_singlescale thanks Hugo
Please have a look at the manual, chapt. 17.5.93 Dear Holger, I noticed I was looking in the user manual form 1-1-2019 which didn't help me, but the solution is indeed given in the current version of the user manual: set wr_singlescale thanks Hugo
You might consider the 17.5.93 Wrdata: Write data to a file (simple table) command Thanks for the suggestion. This works indeed when you only have vdb(2), but when adding a second output I get un unwanted repetition of the frequency column. e.g.: wrdata vbout vdb(2) vp(2)*180/pi gives: 4 columns, the 3rd column is a replica from the first, can I suppress it? kind regards, Hugo
When running ngspice with the attached input file like this: ngspice <vb.cir>vb.out I'd like to suppress the index-column produced by the print statement i.e. instead of Index frequency vdb(2)</vb.cir> 0 1.000000e+02 -1.86672e-03 1 1.122018e+02 -2.34993e-03 2 1.258925e+02 -2.95818e-03 I'd like to have the following: frequency vdb(2) 1.000000e+02 -1.86672e-03 1.122018e+02 -2.34993e-03 1.258925e+02 -2.95818e-03 Is there an option in ngspice to accomplish this? kind regards, Hugo
When running ngspice with the attached input file like this: ngspice <vb.cir>vb.out I'd like to suppress the index-column produced by the print statement i.e. instead of Index frequency vdb(2)</vb.cir> 0 1.000000e+02 -1.86672e-03 1 1.122018e+02 -2.34993e-03 2 1.258925e+02 -2.95818e-03 I'd like to have the following: frequency vdb(2) 1.000000e+02 -1.86672e-03 1.122018e+02 -2.34993e-03 1.258925e+02 -2.95818e-03 Is there an option in ngspice to accomplish this? kind regards, Hugo
When running ngspice with the attached input file like this: ngspice <vb.cir>vb.out I'd like to suppress the index-column produced by the print statement i.e. instead of Index frequency vdb(2) </vb.cir> 0 1.000000e+02 -1.86672e-03 1 1.122018e+02 -2.34993e-03 2 1.258925e+02 -2.95818e-03 I'd like to have the following: frequency vdb(2) 1.000000e+02 -1.86672e-03 1.122018e+02 -2.34993e-03 1.258925e+02 -2.95818e-03 Is there an option in ngspice to accomplish this? kind regards, Hugo
My apologies for posting this with the wrong subject. When I saw my mistake, I looked for a means to change the subject or delete the message but didn't find a solution. Maybe the mail administrator can fix my mistake? When running ngspice with the attached input file like this: ngspice <vb.cir>vb.out I'd like to suppress the index-column produced by the print statement i.e. instead of Index frequency vdb(2) </vb.cir> 0 1.000000e+02 -1.86672e-03 1 1.122018e+02 -2.34993e-03 2 1.258925e+02 -2.95818e-03...
When running ngspice with the attached input file like this: ngspice <vb.cir>vb.out I'd like to suppress the index-column produced by the print statement i.e. instead of Index frequency vdb(2) </vb.cir> 0 1.000000e+02 -1.86672e-03 1 1.122018e+02 -2.34993e-03 2 1.258925e+02 -2.95818e-03 I'd like to have the following: frequency vdb(2) 1.000000e+02 -1.86672e-03 1.122018e+02 -2.34993e-03 1.258925e+02 -2.95818e-03 Is there an option in ngspice to accomplish this? kind regards, Hugo
I simulated the circuit file here below with ngspice3.0 trying to determine the maximum of the output vdb(2). When running ngspice it gives me the warning "Warning: can't parse 'vd': ignored" but I do get the correct result. How should I adapt the measure statement so the warning does not pop up? this is my file contents: title: pseudo-active filter vin 1 0 dc 0 ac 1 r1 1 3 1 r2 1 2 1 c1 3 0 1 c2 2 3 1 .ac dec 20 1m 100 .plot ac vdb(2) .print ac vdb(2) .measure ac ymax MAX vdb(2) from=1m to=100 .end...