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

Go to the source code of this file.

Functions

int INDacLoad (GENmodel *inModel, CKTcircuit *ckt)
 

Function Documentation

int INDacLoad ( GENmodel inModel,
CKTcircuit ckt 
)

Definition at line 16 of file indacld.c.

20 {
21  INDmodel *model = (INDmodel*)inModel;
22  INDinstance *here;
23  double val;
24 
25 #ifdef MUTUAL
26  MUTmodel *mutmodel;
27  MUTinstance *muthere;
28 
29  mutmodel = (MUTmodel*)model->INDmutModels;
30  for ( ; mutmodel != NULL; mutmodel = mutmodel->MUTnextModel) {
31  for (muthere = mutmodel->MUTinstances; muthere != NULL;
32  muthere = muthere->MUTnextInstance) {
33 
34  val = ckt->CKTomega * muthere->MUTfactor;
35  *(muthere->MUTbr1br2 +1) -= val;
36  *(muthere->MUTbr2br1 +1) -= val;
37  }
38  }
39 #endif /* MUTUAL */
40 
41  for ( ; model != NULL; model = model->INDnextModel) {
42  for (here = model->INDinstances; here != NULL;
43  here = here->INDnextInstance) {
44 
45  val = ckt->CKTomega * here->INDinduct;
46  *(here->INDposIbrptr) += 1;
47  *(here->INDnegIbrptr) -= 1;
48  *(here->INDibrPosptr) += 1;
49  *(here->INDibrNegptr) -= 1;
50  *(here->INDibrIbrptr +1) -= val;
51  }
52  }
53  return (OK);
54 }
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
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
double CKTomega
Definition: cktdefs.h:198
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 * MUTbr2br1
Definition: inddefs.h:183
double INDinduct
Definition: inddefs.h:51