[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnucap-devel] a bug? (was: Re: Unstable inverter isn't unstable)
From: |
al davis |
Subject: |
Re: [Gnucap-devel] a bug? (was: Re: Unstable inverter isn't unstable) |
Date: |
Wed, 5 Mar 2014 23:08:14 -0500 |
User-agent: |
KMail/1.13.7 (Linux/3.2.0-4-amd64; KDE/4.8.4; x86_64; ; ) |
On Wednesday 05 March 2014, Felix Salfelder wrote:
> a good opportuniuty to report something i consider a bug...
It is.
Thank you.
> if that is true, i suspect that tr_begin should only be
> called from DCOP::sweep in case !_cont. (sorry, i haven't
> checked for side effects a lot).
True. It should call tr_restore instead in that case.
Code in tran is correct.
Here is fixed code for s_dc.cc
/*--------------------------------------------------------------------------*/
void DCOP::sweep()
{
head(_start[0], _stop[0], " ");
_sim->_bypass_ok = false;
_sim->set_inc_mode_bad();
if (_cont) {
_sim->restore_voltages();
CARD_LIST::card_list.tr_restore();
}else{
_sim->clear_limit();
CARD_LIST::card_list.tr_begin();
}
sweep_recursive(_n_sweeps);
}
/*--------------------------------------------------------------------------*/
new test file: d_switch.v.cont.ckt
'
V1 1 0 dc 1. ac 1.
R1 1 2 1.K
S1 2 0 3 0 sss
V2 3 0 pwl( 0. 0. 5. 5. 15. -5. 25. 5. )
.model sss sw ( vt= 0. vh= 2. ron= 1.K roff= 1.E+12 )
.print dc v(nodes) ev(s1)
.print tran v(nodes) ev(s1)
.print ac v(nodes) ev(s1)
.dc v2 -5 0 1
.dc v2 0 5 1 cont
.dc v2 5 0 -1 cont
.dc v2 0 -5 -1 cont
.ac 1k
.tran 0 25 1
.ac 1k
.list
.end