gnucap-devel
[Top][All Lists]
Advanced

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

Re: [Gnucap-devel] [Help-gnucap] Possibly a bug?


From: Felix Salfelder
Subject: Re: [Gnucap-devel] [Help-gnucap] Possibly a bug?
Date: Wed, 22 May 2013 13:19:43 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

On Wed, May 22, 2013 at 11:59:23AM +0200, Orestes Mas wrote:
> I'm obtaining unexpected results (NaN) when simulating a simple circuit:
> 
> [..]
> Rpb 3 4 0K
> [..]
>
> Test circuit 
> #Freq       vdb(5)    
>  0.1        NaN       
>  0.10046    NaN       
>  0.10093    NaN       
>  0.10139    NaN       
>  0.10186    NaN       
>  0.10233    NaN       

Hi Orestes.

the problem is, that unlike D_RES::tr_begin, D_RES::ac_begin does not
handle zero resistance very well. NaN is caused by the zero division.
as a workaround you may want to write
> Rpb 3 4 10n,
10n is the default for OPT::short.

this should be fixed together with the following bug:

void ELEMENT::precalc_last()
{
  COMPONENT::precalc_last();

  //BUG// This is needed for AC analysis without doing op (or dc or tran ...) 
first.
  // Something like it should be moved to ac_begin.
  if (_sim->is_first_expand()) {
    _y[0].x  = 0.;
    _y[0].f0 = LINEAR;
    _y[0].f1 = value();
  }else{
  }
}

regards
felix



reply via email to

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