Jspice3
dioacld.c File Reference
#include "spice.h"
#include <stdio.h>
#include "diodefs.h"
#include "sperror.h"
#include "util.h"
Include dependency graph for dioacld.c:

Go to the source code of this file.

Functions

int DIOacLoad (GENmodel *inModel, CKTcircuit *ckt)
 

Function Documentation

int DIOacLoad ( GENmodel inModel,
CKTcircuit ckt 
)

Definition at line 16 of file dioacld.c.

20 {
21  DIOmodel *model = (DIOmodel*)inModel;
22  double gspr;
23  double geq;
24  double xceq;
25  DIOinstance *here;
26 
27  /* loop through all the diode models */
28  for ( ; model != NULL; model = model->DIOnextModel) {
29 
30  /* loop through all the instances of the model */
31  for (here = model->DIOinstances; here != NULL;
32  here = here->DIOnextInstance) {
33 
34  gspr = model->DIOconductance*here->DIOarea;
35  geq = here->DIOgd;
36  xceq = here->DIOcap*ckt->CKTomega;
37 
38  *(here->DIOposPosPtr ) += gspr;
39  *(here->DIOnegNegPtr ) += geq;
40  *(here->DIOnegNegPtr+1) += xceq;
41  *(here->DIOposPrimePosPrimePtr ) += geq + gspr;
42  *(here->DIOposPrimePosPrimePtr+1) += xceq;
43  *(here->DIOposPosPrimePtr ) -= gspr;
44  *(here->DIOnegPosPrimePtr ) -= geq;
45  *(here->DIOnegPosPrimePtr+1) -= xceq;
46  *(here->DIOposPrimePosPtr ) -= gspr;
47  *(here->DIOposPrimeNegPtr ) -= geq;
48  *(here->DIOposPrimeNegPtr+1) -= xceq;
49  }
50  }
51  return (OK);
52 
53 }
double DIOgd
Definition: diodefs.h:61
struct sDIOinstance * DIOnextInstance
Definition: diodefs.h:20
double * DIOposPosPtr
Definition: diodefs.h:35
double * DIOposPosPrimePtr
Definition: diodefs.h:27
double * DIOposPrimePosPrimePtr
Definition: diodefs.h:39
double * DIOposPrimePosPtr
Definition: diodefs.h:31
#define OK
Definition: iferrmsg.h:17
double DIOconductance
Definition: diodefs.h:143
double * DIOnegPosPrimePtr
Definition: diodefs.h:29
DIOinstance * DIOinstances
Definition: diodefs.h:121
#define NULL
Definition: spdefs.h:121
double * DIOposPrimeNegPtr
Definition: diodefs.h:33
double CKTomega
Definition: cktdefs.h:198
double * DIOnegNegPtr
Definition: diodefs.h:37
struct sDIOmodel * DIOnextModel
Definition: diodefs.h:119
static char model[32]
Definition: subckt.c:76
double DIOcap
Definition: diodefs.h:62
double DIOarea
Definition: diodefs.h:48