Re: [ng-spice-devel] NEWS for the group


To ng-spice-devel@ieee.ing.uniroma1.it
From Paolo Nenzi <pnenzi@ieee.ing.uniroma1.it>
Date Sat, 8 Apr 2000 07:53:57 +0200 (CEST)
Delivered-To mailing list ng-spice-devel@ieee.ing.uniroma1.it
In-Reply-To <38EE53E9.6AE4F0F5@ece.cmu.edu >
Mailing-List contact ng-spice-devel-help@ieee.ing.uniroma1.it; run by ezmlm
Reply-To ng-spice-devel@ieee.ing.uniroma1.it



On Fri, 7 Apr 2000, Lidia Daldoss wrote:

> 1)about the LTE issue...
> 
> In cktterr.c, we have:
> 
> 
>  del = ckt->CKTtrtol * tol/MAX(ckt->CKTabstol,factor * FABS(diff[0]));
>     if(ckt->CKTorder == 2) {
>         del = sqrt(del);
> 
> ckt->CKTtrtol (=TRTOL,default value =7, as Nagel proposed) was
> introduced because the truncation error estimation algorithm tends to be
> too conservative.
Sangiovanni told us that the value should be different and this can be a
bug in the code. I think we should ask him something on this point before
trying to fix (to avoid fixing a ghost bug).

> 
> 2) someone can explain me why in Spice there is not charge conservation?
> What is wrong in the model of the capacitor?
> There are routines for  charge updating, associated with the energy
> storage devices...
OK, after some seraches I have found a lecture of Sangiovanni's E219A
course at Berkeley, where he shows how a capacitor can be modeled as:

1) d/dt(q(v(t)) = f(v(t))  or 

2) C(v(t))d/dt(v(t)) where C(v) = dq/dv 

(please note last derivative is partial)

Assume all capacitor to ground.

Charge conservation:

If we write nodal equations

sum( qi(v(t)) ) = K   i in 1, n+1
sum( fi(v(t)) ) = 0   i in 1, n+1

What happens if we apply numerical integration to 1 and 2:

let's concentrate in the first sum  ... = K:


Applying forward Euler to 1 and 2, (after some calculations) we arrive at
the result:

1) sum (...) = K + 0 + O(h^2) CHARGE IS NOT CONSERVED.

2) charge is conserved. 

Theorem: Any consistent multistep method conserve charge when applied to
1

This is an extract from lec10.ps of E219A course.

What we can do about this ? Ideas ?

Bye,
Paolo




Partial thread listing: