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: Dow Drake
Subject: Re: [Qucs/gnucsator] Assertion failed (#9)
Date: Fri, 17 Sep 2021 22:54:07 +0000

Hi Felix,

Thanks for the speedy reply!

I tried the first hack you mentioned, changing the line in my netlist.txt to:
resistor:R3 gnd out r="100 Ohm",
then calling gnucsator from the command line like this:
$ gnucsator.sh -i netlist.txt -o ch2_prj/emitter_follower.dat
This generated messages:
default plugins: master 2017.10.03
;: already installed, replacing
stashing as ;:0
*: already installed, replacing
stashing as *:0
': already installed, replacing
stashing as ':0
": already installed, replacing
stashing as ":0
L: already installed, replacing
stashing as L:0
open circuit: internal node 5
open circuit: internal node 3
(+ many more warnings like this)

Gnucap   System status
iterations: op=0, dc=0, tran=12251, fourier=0, total=12291
transient timesteps: accepted=39, rejected=567, total=606
nodes: user=3, subckt=0, model=2, total=5
dctran density=92.0%, ac density=92.0%

A dataset was generated -- here is the plot:
[cid:29244bdf-a197-4d8e-a7cc-12dca8180c38]
The plot is correct except during the rise time (Tr) interval and after the 
fall time (Tf) interval.  In contrast, Qucsator and Ngspice produce output like 
this (expected):
[cid:cd042e99-62ca-4a7c-8b77-58273dcfaa34]
I'll try the other ideas you suggested.

Best,
Dow
________________________________
From: felix <notifications@github.com>
Sent: Friday, September 17, 2021 2:07 PM
To: Qucs/gnucsator <gnucsator@noreply.github.com>
Cc: Dow Drake <dowdrake@msn.com>; Author <author@noreply.github.com>
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="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.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on 
GitHub<https://github.com/Qucs/gnucsator/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.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
 or 
Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.

PNG image

PNG image


reply via email to

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