Jspice3
indacld.c
Go to the documentation of this file.
1 /***************************************************************************
2 JSPICE3 adaptation of Spice3f2 - Copyright (c) Stephen R. Whiteley 1992
3 Copyright 1990 Regents of the University of California. All rights reserved.
4 Authors: 1985 Thomas L. Quarles
5  1992 Stephen R. Whiteley
6 ****************************************************************************/
7 
8 #include "spice.h"
9 #include <stdio.h>
10 #include "inddefs.h"
11 #include "sperror.h"
12 #include "cktext.h"
13 
14 
15 int
16 INDacLoad(inModel,ckt)
17 
18 GENmodel *inModel;
19 CKTcircuit *ckt;
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
int INDacLoad(GENmodel *inModel, CKTcircuit *ckt)
Definition: indacld.c:16
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