Re: a bug? (was: Re: Unstable inverter isn't unstable)

al davis <[email protected]>
Newsgroups gmane.comp.gnu.gnucap.devel
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.