Fw: [Qucs/gnucsator] Assertion failed (#9)
Dow Drake <[email protected]> Fri, 17 Sep 2021 22:12:28 +0000
| Newsgroups | gmane.comp.gnu.gnucap.devel |
|---|---|
| Message-ID | <MWHPR05MB28796505817D3A73A185B7EEC0DD9@MWHPR05MB2879.namprd05.prod.outlook.com> |
Forwarding this thread... Best, Dow ________________________________ From: felix <[email protected]> Sent: Friday, September 17, 2021 2:07 PM To: Qucs/gnucsator <[email protected]> Cc: Dow Drake <[email protected]>; Author <[email protected]> Subject: Re: [Qucs/gnucsator] Assertion failed (#9) On Fri, Sep 17, 2021 at 12:38:34PM -0700, Dow Drake wrote: > Hi, I've been running numerous transient simulations of diode and bjt > circuits using gnucsator, qucsator and sometimes ngspice. The > gnucsator option has been very helpful. In most cases, gnucsator > succeeds even if qucsator fails, and its results match those of > ngspice, but for this simple emitter follower, which simulates > correctly with qucsator and ngspice, a gnucsator assertion fails > resulting in a seg fault. > > Here's the netlist generated by Qucs: > ``` > # Qucs 0.0.20 /home/dow/.qucs/ch2_prj/emitter_follower.sch > > BJT:Q2N3904_1 in c out c Type=3D"npn" Is=3D"1.4e-14" Nf=3D"1" Nr=3D"1" Ik= f=3D"0.025" Ikr=3D"0" Vaf=3D"100" Var=3D"0" Ise=3D"3e-13" Ne=3D"1.5" Isc=3D= "0" Nc=3D"2" Bf=3D"300" Br=3D"7.5" Rbm=3D"0" Irb=3D"0" Rc=3D"2.4" Re=3D"0" = Rb=3D"0" Cje=3D"4.5e-12" Vje=3D"0.75" Mje=3D"0.33" Cjc=3D"3.5e-12" Vjc=3D"0= .75" Mjc=3D"0.33" Xcjc=3D"1" Cjs=3D"0" Vjs=3D"0.75" Mjs=3D"0" Fc=3D"0.5" Tf= =3D"4e-10" Xtf=3D"0" Vtf=3D"0" Itf=3D"0" Tr=3D"2.1e-08" Temp=3D"26.85" Kf= =3D"9e-16" Af=3D"1" Ffe=3D"1" Kb=3D"0" Ab=3D"1" Fb=3D"1" Ptf=3D"0" Xtb=3D"1= .5" Xti=3D"3" Eg=3D"1.11" Tnom=3D"26.85" Area=3D"1" > Vdc:V1 c gnd U=3D"5 V" > R:R3 gnd out R=3D"100 Ohm" Temp=3D"26.85" Tc1=3D"0.0" Tc2=3D"0.0" Tnom=3D= "26.85" > Vpulse:V2 in gnd U1=3D"0 V" U2=3D"3 V" T1=3D"0" T2=3D"1 ms" Tr=3D".1 ms" = Tf=3D".1 ms" > .TR:TR1 Type=3D"lin" Start=3D"0" Stop=3D"1.5 ms" Points=3D"1000" Integrat= ionMethod=3D"Trapezoidal" Order=3D"2" InitialStep=3D"1 ns" MinStep=3D"1e-16= " MaxIter=3D"150" reltol=3D"0.001" abstol=3D"1 pA" vntol=3D"1 uV" Temp=3D"2= 6.85" LTEreltol=3D"1e-3" LTEabstol=3D"1e-6" LTEfactor=3D"1" Solver=3D"Crout= LU" relaxTSR=3D"no" initialDC=3D"yes" MaxStep=3D"0" > ``` > The message is: > ``` > gnucsator: s_tr_swp.cc:292: bool TRANSIENT::next(): Assertion `new_dt >= =3D _sim->_dtmin' failed. > > /usr/bin/gnucsator.sh: line 47: 104922 Aborted (core dumped) $GNUCSATOR <= <EOF > qucs > include $infile > go ${out} > status notime > EOF > ``` > I've tried a number of different values for Tr and Tf ranging from 1ps > up to .1ms. I've also tried reducing MinStep to 1e-18, but so far, I > haven't found a way to get the simulation to complete. I'm using the > current master branch of gnucsator. Please let me know if there is > any other information that might be helpful, such as the Qucs .sch > file. Hi Dow. (CC gnucap-devel, because it has to do with gnucap. Hope you don't mind.) There are two hacks that interfere with your circuit. The first one is the "R" device wrapper, see bm_wrapper.cc. It was meant to wrap parameters (and probes?) to qucs in a sort of flexible way. But it has side effects (a non constant resistor uses step control...) The possible approaches are - hand edit your netlist, put in resistor:R3 gnd out r=3D"100 Ohm" - lumped.v has subcircuit macros for various devices, but no R yet (Maybe I have not tried.) - use a modified d_res.cc instead, hack it to your needs. The first is certainly useful for trying out things, the third option is a bit overkill -- if everything else fails. The middle option would have to get past the test suite... The second hack is the BJT device. Qucs has two devices in one, and there is no proper mechanism implemented in gnucap-qucs to disambiguate. See "Type" in nonlinear.v. Comment out the one you don't use to improve results. Certainly this is worth fixing with a more elaborate wrapper, or again a hacked copy of the upstream model(s). Note that the wrapper is meant to work with other BJT implementations, and a hacked copy is a bad idea long term. =97 You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub<https://github.com/Qucs/gnu= csator/issues/9#issuecomment-922082067>, or unsubscribe<https://github.com/= notifications/unsubscribe-auth/AAFH2MESSNPNMEM6Y4YGOTDUCOUZDANCNFSM5EIGYJOQ= >. Triage notifications on the go with GitHub Mobile for iOS<https://apps.appl= e.com/app/apple-store/id1477376905?ct=3Dnotification-email&mt=3D8&pt=3D5246= 75> or Android<https://play.google.com/store/apps/details?id=3Dcom.github.a= ndroid&referrer=3Dutm_campaign%3Dnotification-email%26utm_medium%3Demail%26= utm_source%3Dgithub>.