gnucap-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qucs/gnucsator] Assertion failed (#9)


From: Felix Salfelder
Subject: Re: [Qucs/gnucsator] Assertion failed (#9)
Date: Fri, 17 Sep 2021 23:07:16 +0200

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="npn" Is="1.4e-14" Nf="1" Nr="1" Ikf="0.025" 
> Ikr="0" Vaf="100" Var="0" Ise="3e-13" Ne="1.5" Isc="0" Nc="2" Bf="300" 
> Br="7.5" Rbm="0" Irb="0" Rc="2.4" Re="0" Rb="0" Cje="4.5e-12" Vje="0.75" 
> Mje="0.33" Cjc="3.5e-12" Vjc="0.75" Mjc="0.33" Xcjc="1" Cjs="0" Vjs="0.75" 
> Mjs="0" Fc="0.5" Tf="4e-10" Xtf="0" Vtf="0" Itf="0" Tr="2.1e-08" Temp="26.85" 
> Kf="9e-16" Af="1" Ffe="1" Kb="0" Ab="1" Fb="1" Ptf="0" Xtb="1.5" Xti="3" 
> Eg="1.11" Tnom="26.85" Area="1"
> Vdc:V1 c gnd U="5 V"
> R:R3 gnd out R="100 Ohm" Temp="26.85" Tc1="0.0" Tc2="0.0" Tnom="26.85"
> Vpulse:V2 in gnd U1="0 V" U2="3 V" T1="0" T2="1 ms" Tr=".1 ms" Tf=".1 ms"
> .TR:TR1 Type="lin" Start="0" Stop="1.5 ms" Points="1000" 
> IntegrationMethod="Trapezoidal" Order="2" InitialStep="1 ns" MinStep="1e-16" 
> MaxIter="150" reltol="0.001" abstol="1 pA" vntol="1 uV" Temp="26.85" 
> LTEreltol="1e-3" LTEabstol="1e-6" LTEfactor="1" Solver="CroutLU" 
> relaxTSR="no" initialDC="yes" MaxStep="0"
> ```
> The message is: 
> ```
> gnucsator: s_tr_swp.cc:292: bool TRANSIENT::next(): Assertion `new_dt >= 
> _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="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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]