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

Go to the source code of this file.

Functions

int JJgetic (GENmodel *inModel, CKTcircuit *ckt)
 

Variables

double JJdphi
 

Function Documentation

int JJgetic ( GENmodel inModel,
CKTcircuit ckt 
)

Definition at line 16 of file jjgetic.c.

25 {
26  JJmodel *model = (JJmodel *)inModel;
27  JJinstance *here;
28  JJmodel *tempmodel;
29  double temp, vmax;
30 
31  for (tempmodel = model; model; model = model->JJnextModel) {
32  for (here = model->JJinstances; here; here = here->JJnextInstance) {
33  if (!here->JJinitVoltGiven)
34  here->JJinitVoltage =
35  *(ckt->CKTrhs + here->JJposNode) -
36  *(ckt->CKTrhs + here->JJnegNode);
37  if (!here->JJinitPhaseGiven) {
38  if (here->JJphsNode)
39  here->JJinitPhase = *(ckt->CKTrhs + here->JJphsNode);
40  else
41  here->JJinitPhase = 0;
42  }
43  if (here->JJcontrol)
44  here->JJinitControl = *(ckt->CKTrhs + here->JJbranch);
45  }
46  }
47 
48  /* find initial time delta */
49 
50  /* jj's are "present" only if one has critical current */
51  if (ckt->CKTjjPresent) {
52  vmax = 0;
53 
54  for (model = tempmodel; model != NULL; model = model->JJnextModel) {
55 
56  if (model->JJictype != 0) {
57  if (vmax < model->JJvdpbak) {
58  vmax = model->JJvdpbak;
59  }
60  for (here = model->JJinstances; here != NULL;
61  here = here->JJnextInstance) {
62 
63  if (here->JJcriti > 0) {
64  temp = here->JJinitVoltage;
65  if (temp < 0)
66  temp = -temp;
67  if (vmax < temp) vmax = temp;
68  }
69  }
70  }
71  }
72 
73  if (vmax > 0) {
74  temp = .1*JJdphi/vmax;
75  if (ckt->CKTinitDelta < temp)
76  ckt->CKTinitDelta = temp;
77  }
78  }
79  return (OK);
80 }
IFuid JJcontrol
Definition: jjdefs.h:27
double JJinitControl
Definition: jjdefs.h:34
int JJphsNode
Definition: jjdefs.h:25
int JJposNode
Definition: jjdefs.h:23
JJinstance * JJinstances
Definition: jjdefs.h:84
int JJnegNode
Definition: jjdefs.h:24
#define OK
Definition: iferrmsg.h:17
double JJcriti
Definition: jjdefs.h:39
unsigned JJinitPhaseGiven
Definition: jjdefs.h:64
#define NULL
Definition: spdefs.h:121
unsigned JJinitVoltGiven
Definition: jjdefs.h:63
int CKTjjPresent
Definition: cktdefs.h:168
double JJvdpbak
Definition: jjdefs.h:99
static char model[32]
Definition: subckt.c:76
int JJictype
Definition: jjdefs.h:89
struct sJJmodel * JJnextModel
Definition: jjdefs.h:82
double CKTinitDelta
Definition: cktdefs.h:197
double JJdphi
Definition: options.c:21
struct sJJinstance * JJnextInstance
Definition: jjdefs.h:17
double * CKTrhs
Definition: cktdefs.h:97
int JJbranch
Definition: jjdefs.h:26

Variable Documentation

double JJdphi

Definition at line 21 of file options.c.