committed by
rlar
12 changed files with 86 additions and 1 deletions
-
1src/spicelib/devices/cap/Makefile.am
-
2src/spicelib/devices/cap/cap.c
-
3src/spicelib/devices/cap/capask.c
-
6src/spicelib/devices/cap/capdefs.h
-
1src/spicelib/devices/cap/capext.h
-
2src/spicelib/devices/cap/capinit.c
-
3src/spicelib/devices/cap/capmask.c
-
4src/spicelib/devices/cap/capmpar.c
-
4src/spicelib/devices/cap/capparam.c
-
6src/spicelib/devices/cap/capsetup.c
-
51src/spicelib/devices/cap/capsoachk.c
-
4visualc/vngspice.vcproj
@ -0,0 +1,51 @@ |
|||||
|
/********** |
||||
|
Copyright 2013 Dietmar Warning. All rights reserved. |
||||
|
Author: 2013 Dietmar Warning |
||||
|
**********/ |
||||
|
|
||||
|
#include "ngspice/ngspice.h" |
||||
|
#include "ngspice/cktdefs.h" |
||||
|
#include "capdefs.h" |
||||
|
#include "ngspice/trandefs.h" |
||||
|
#include "ngspice/sperror.h" |
||||
|
#include "ngspice/suffix.h" |
||||
|
#include "ngspice/cpdefs.h" |
||||
|
|
||||
|
|
||||
|
int |
||||
|
CAPsoaCheck(CKTcircuit *ckt, GENmodel *inModel) |
||||
|
{ |
||||
|
CAPmodel *model = (CAPmodel *) inModel; |
||||
|
CAPinstance *here; |
||||
|
double vc; /* current capacitor voltage */ |
||||
|
int maxwarns; |
||||
|
static int warns_bv = 0; |
||||
|
|
||||
|
if (!ckt) { |
||||
|
warns_bv = 0; |
||||
|
return OK; |
||||
|
} |
||||
|
|
||||
|
maxwarns = ckt->CKTsoaMaxWarns; |
||||
|
|
||||
|
for (; model; model = model->CAPnextModel) { |
||||
|
|
||||
|
for (here = model->CAPinstances; here; here = here->CAPnextInstance) { |
||||
|
|
||||
|
vc = fabs(ckt->CKTrhsOld [here->CAPposNode] - |
||||
|
ckt->CKTrhsOld [here->CAPnegNode]); |
||||
|
|
||||
|
if (vc > here->CAPbv_max) |
||||
|
if (warns_bv < maxwarns) { |
||||
|
soa_printf(ckt, (GENinstance*) here, |
||||
|
"|Vc|=%g has exceeded Bv_max=%g\n", |
||||
|
vc, here->CAPbv_max); |
||||
|
warns_bv++; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
return OK; |
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue