gnucap-devel
[Top][All Lists]
Advanced

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

[Gnucap-devel] adms model and inc_mode


From: Felix Salfelder
Subject: [Gnucap-devel] adms model and inc_mode
Date: Wed, 14 Mar 2012 17:19:13 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

Hello List, Hello Al.

We -- i.e. Andreas Froese and me -- are playing around with an admsXml
based model generator.

We are a bit stuck at the following:
consider the hicum0 device in a simple inverter circuit. as simple as it
can be:
            ^
            |
           [ ] R
            |   
            o
     i    |/
  ,--O--o-|
  |       |\,
  V         o
            |
            V
  
say, a small current induces 1V to the base node. this is perfectly
converging without inc_mode in about 50 iterations.

What happens in inc mode is this: the device adds 1e15 to the matrix and
then decides to remove it more or less completely within the next
iterations. leaving behind a wrong matrix.
for us that means that the base node voltage converges to about 0.5V.

now, one could blame the hicum model, but then it has not been written
for gnucap, and i don't see why a model should need to be changed to
work with gnucap.

with a something like

template <class T>
void BSMATRIX<T>::load_point_cautiously(int i, int j, T& value)
{
  if (i > 0 && j > 0) {
    set_changed(j);
    set_changed(i);
    double G(1e4);
    if (value < -G* fabs(m(i,j)) - OPT::gmin ){ untested();
        value = -G* fabs(m(i,j)) - OPT::gmin ;
    } else if ( value > G* fabs(m(i,j)) + OPT::gmin){ untested();
        value = G* fabs(m(i,j)) + OPT::gmin ;
    }

    m(i,j) += value;
  }else{
  }
}

which tr_load uses whenever _sim->inc_mode() (and feeds back the changed value),
makes the voltage converge correctly (in about 200 iteractions) with incmode
on.

as this is obviouasly just a hack, i'd like to ask for ideas to handle this
situation correctly.

regards & thanks
felix

()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments



reply via email to

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