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

_______________________________________________
Gnucap-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/gnucap-devel

Reply via email to