Jspice3
jfetic.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  1993 Stephen R. Whiteley
6 ****************************************************************************/
7 /********** new in 3f2
8 Sydney University mods Copyright(c) 1989 Anthony E. Parker, David J. Skellern
9  Laboratory for Communication Science Engineering
10  Sydney University Department of Electrical Engineering, Australia
11 **********/
12 
13 #include "spice.h"
14 #include <stdio.h>
15 #include "jfetdefs.h"
16 #include "sperror.h"
17 
18 
19 int
20 JFETgetic(inModel,ckt)
21  GENmodel *inModel;
22  CKTcircuit *ckt;
23 {
24  JFETmodel *model = (JFETmodel*)inModel;
25  JFETinstance *here;
26  /*
27  * grab initial conditions out of rhs array. User specified, so use
28  * external nodes to get values
29  */
30 
31  for( ; model ; model = model->JFETnextModel) {
32  for(here = model->JFETinstances; here ; here = here->JFETnextInstance) {
33  if(!here->JFETicVDSGiven) {
34  here->JFETicVDS =
35  *(ckt->CKTrhs + here->JFETdrainNode) -
36  *(ckt->CKTrhs + here->JFETsourceNode);
37  }
38  if(!here->JFETicVGSGiven) {
39  here->JFETicVGS =
40  *(ckt->CKTrhs + here->JFETgateNode) -
41  *(ckt->CKTrhs + here->JFETsourceNode);
42  }
43  }
44  }
45  return(OK);
46 }
unsigned JFETicVDSGiven
Definition: jfetdefs.h:129
int JFETgateNode
Definition: jfetdefs.h:30
JFETinstance * JFETinstances
Definition: jfetdefs.h:169
unsigned JFETicVGSGiven
Definition: jfetdefs.h:130
#define OK
Definition: iferrmsg.h:17
double JFETicVGS
Definition: jfetdefs.h:136
struct sJFETmodel * JFETnextModel
Definition: jfetdefs.h:167
double JFETicVDS
Definition: jfetdefs.h:135
static char model[32]
Definition: subckt.c:76
int JFETdrainNode
Definition: jfetdefs.h:29
struct sJFETinstance * JFETnextInstance
Definition: jfetdefs.h:25
int JFETsourceNode
Definition: jfetdefs.h:31
double * CKTrhs
Definition: cktdefs.h:97
int JFETgetic(GENmodel *inModel, CKTcircuit *ckt)
Definition: jfetic.c:20