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

Go to the source code of this file.

Functions

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

Function Documentation

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

Definition at line 16 of file indpzld.c.

21 {
22  INDmodel *model = (INDmodel*)inModel;
23  INDinstance *here;
24  double val;
25 
26 #ifdef MUTUAL
27  MUTmodel *mutmodel;
28  MUTinstance *muthere;
29 
30  mutmodel = (MUTmodel*)model->INDmutModels;
31  for ( ; mutmodel != NULL; mutmodel = mutmodel->MUTnextModel) {
32  for (muthere = mutmodel->MUTinstances; muthere != NULL;
33  muthere = muthere->MUTnextInstance) {
34 
35  val = muthere->MUTfactor;
36  *(muthere->MUTbr1br2) -= val * s->real;
37  *(muthere->MUTbr1br2+1) -= val * s->imag;
38  *(muthere->MUTbr2br1) -= val * s->real;
39  *(muthere->MUTbr2br1+1) -= val * s->imag;
40  }
41  }
42 #endif /*MUTUAL*/
43 
44  for ( ; model != NULL; model = model->INDnextModel) {
45  for (here = model->INDinstances; here != NULL;
46  here = here->INDnextInstance) {
47 
48  val = here->INDinduct;
49  *(here->INDposIbrptr) += 1;
50  *(here->INDnegIbrptr) -= 1;
51  *(here->INDibrPosptr) += 1;
52  *(here->INDibrNegptr) -= 1;
53  *(here->INDibrIbrptr) -= val * s->real;
54  *(here->INDibrIbrptr+1) -= val * s->imag;
55  }
56  }
57  return (OK);
58 }
struct sINDmodel * INDnextModel
Definition: inddefs.h:96
struct sINDinstance * INDnextInstance
Definition: inddefs.h:27
double * INDibrNegptr
Definition: inddefs.h:72
double * INDibrPosptr
Definition: inddefs.h:75
GENmodel * INDmutModels
Definition: inddefs.h:106
double * INDnegIbrptr
Definition: inddefs.h:69
double real
Definition: complex.h:13
struct sMUTmodel * MUTnextModel
Definition: inddefs.h:200
struct sMUTinstance * MUTnextInstance
Definition: inddefs.h:159
#define OK
Definition: iferrmsg.h:17
double * INDposIbrptr
Definition: inddefs.h:66
double * MUTbr1br2
Definition: inddefs.h:182
MUTinstance * MUTinstances
Definition: inddefs.h:203
#define NULL
Definition: spdefs.h:121
INDinstance * INDinstances
Definition: inddefs.h:99
double * INDibrIbrptr
Definition: inddefs.h:78
double MUTfactor
Definition: inddefs.h:168
static char model[32]
Definition: subckt.c:76
double imag
Definition: complex.h:14
double * MUTbr2br1
Definition: inddefs.h:183
double INDinduct
Definition: inddefs.h:51