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

Go to the source code of this file.

Functions

int JFETgetic (GENmodel *inModel, CKTcircuit *ckt)
 

Function Documentation

int JFETgetic ( GENmodel inModel,
CKTcircuit ckt 
)

Definition at line 20 of file jfetic.c.

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