Jspice3
cappzld.c File Reference
#include "spice.h"
#include <stdio.h>
#include "capdefs.h"
#include "sperror.h"
Include dependency graph for cappzld.c:

Go to the source code of this file.

Functions

int CAPpzLoad (GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
 

Function Documentation

int CAPpzLoad ( GENmodel inModel,
CKTcircuit ckt,
SPcomplex s 
)

Definition at line 16 of file cappzld.c.

21 {
22  CAPmodel *model = (CAPmodel*)inModel;
23  double val;
24  CAPinstance *here;
25 
26  for ( ; model != NULL; model = model->CAPnextModel) {
27  for (here = model->CAPinstances; here != NULL;
28  here = here->CAPnextInstance) {
29 
30  val = here->CAPcapac;
31  *(here->CAPposPosptr ) += val * s->real;
32  *(here->CAPposPosptr +1) += val * s->imag;
33  *(here->CAPnegNegptr ) += val * s->real;
34  *(here->CAPnegNegptr +1) += val * s->imag;
35  *(here->CAPposNegptr ) -= val * s->real;
36  *(here->CAPposNegptr +1) -= val * s->imag;
37  *(here->CAPnegPosptr ) -= val * s->real;
38  *(here->CAPnegPosptr +1) -= val * s->imag;
39  }
40  }
41  return (OK);
42 }
double * CAPnegPosptr
Definition: capdefs.h:40
struct sCAPinstance * CAPnextInstance
Definition: capdefs.h:21
double real
Definition: complex.h:13
double * CAPposNegptr
Definition: capdefs.h:38
CAPinstance * CAPinstances
Definition: capdefs.h:57
#define OK
Definition: iferrmsg.h:17
double * CAPposPosptr
Definition: capdefs.h:34
#define NULL
Definition: spdefs.h:121
static char model[32]
Definition: subckt.c:76
double * CAPnegNegptr
Definition: capdefs.h:36
double imag
Definition: complex.h:14
double CAPcapac
Definition: capdefs.h:27
struct sCAPmodel * CAPnextModel
Definition: capdefs.h:55