|
From: John D. <jp...@no...> - 2019-07-14 15:18:46
|
> On Jul 14, 2019, at 9:45 AM, Simon Harpham <sim...@ie...> wrote: > > Hello John, > > intuitively you will appreciate that a resistor can be modelled as a voltage controlled current source with its control input connected to its output. If the input sense is swapped over the construct becomes a negative resistance and if you take the output buffer it then delay it through a single pole low pass filter, it becomes an inductor. Similarly if the low pass filter is replaced by a high pass filter the construct becomes a capacitor. Therefore in ngspice you will have to replicate that last configuration. Yeah, you could do this with a gyrator if you like. > > Good luck with it. Again, it’s not my problem. But perhaps we haven’t yet completely lost the attention of Saurabh Bansode, the originator of the question. > > Cheers, SimonH. > > BTW, I have used Hspice, Tspice, Ispice, Spectre, SpectreS, S-Frame, Advice, Celerity, Spice2G6, LTspice, Cohesion, SIMetrix, WinSPICE3, Nexxim, Eldo and have written fixed time-step spice simulators in EXCEL (to model sampled DSPs and PLLs). Unfortunately I have never had the time to add ngspice to the list but have been meaning to and live in hope that when I retire I will buy myself a nice Linux PC and learn about ngspice. I would be interested in hearing how it compares to some of the above tools? I used PSpice decades ago. It was useful for small things, but tended to segfault on big simulations. I expect they’ve fixed this by now, but I haven’t tried it in a long time. I think it’s perhaps the most eccentric dialect. I also did a little with Spice3, but not enough to compare to others, really. For the development of the chip described at https://arxiv.org/abs/1102.2472 <https://arxiv.org/abs/1102.2472> and references therein, I was using ngspice for sims, while the Osaka group was using Tspice. The big advantage of Tspice was its compatibility with the dialect of the TSMC model parameter sets. To use those in ngspice, I had to preprocess my SPICE code through a modified version of John Sheahan’s spicepp.pl, and also patch the ngspice model source code to do the noise calculations using the Hspice formula rather than Berkeley’s. On the other hand, ngspice was better behaved numerically. Tspice had a tendency to do silly things like letting floating nodes drift to kilovolt potentials. And, of course, the other problem with Tspice for me was its price. Osaka U. got the educational deal, and had a bunch of people using it, but this was a part-time job for me, a private contractor, so a big annual license fee was far more expensive than I could justify. For higher level design calculations, I mostly use Mathematica. Although I played a role in the creation of the first spreadsheet, VisiCalc, I’ve never been fond of spreadsheets. > > > On 14/07/2019 13:13, John Doty wrote: >> >>> On Jul 13, 2019, at 8:21 PM, Simon Harpham <sim...@ie... <mailto:sim...@ie...>> wrote: >>> >>> Hello John, >>> >>> does your SPICE variant have an arbitrary source in it which will allow you to write a line like: >>> >>> B n1 n2 Q={C*v(n1,n2)} >>> >>> >> >> Well, since this is the ngspice list, you should probably assume I use ngspice. Section 5.1 of http://ngspice.sourceforge.net/docs/ngspice-manual.pdf <http://ngspice.sourceforge.net/docs/ngspice-manual.pdf> does not show Q= as an option for the B source. >> Trying it, I get "unknown parameter (q)”. >> >> I think ngspice could do this with a linear current controlled current source (F) charging a fixed capacitor. A nonlinear voltage source (B or E) in series with the input of the F source could divide the voltage on the cap by a variable quantity representing the capacitance. However, this isn’t really my problem: I was curious about whether ngspice’s cap model did this right, but I’ll leave a subcircuit implementation as an exercise for others. >> >> John Doty Noqsi Aerospace, Ltd. >> jp...@no... <mailto:jp...@no...> >> >> > John Doty Noqsi Aerospace, Ltd. jp...@no... |