Small change in inductor code. Added "nt" instance parameter.

This commit is contained in:
pnenzi 2003-10-06 07:34:34 +00:00
parent ba0c212d6b
commit 94821b2aff
16 changed files with 72 additions and 35 deletions

View File

@ -18,7 +18,8 @@ IFparm INDpTable[] = { /* parameters */
IOPZ( "dtemp", IND_DTEMP, IF_REAL,
"Instance temperature difference with the rest of the circuit"),
IOPU( "m", IND_M, IF_REAL, "Multiplication Factor"),
IOPU( "scale", IND_SCALE, IF_REAL, "Scale factor"),
IOPU( "scale", IND_SCALE, IF_REAL, "Scale factor"),
IOP( "nt", IND_NT, IF_REAL, "Number of turns"),
OP( "flux", IND_FLUX, IF_REAL, "Flux through inductor"),
OP( "v", IND_VOLT, IF_REAL, "Terminal voltage of inductor"),
OPR( "volt", IND_VOLT, IF_REAL, ""),
@ -42,8 +43,9 @@ IFparm INDmPTable[] = { /* model parameters */
IOPXU( "tnom", IND_MOD_TNOM, IF_REAL,"Parameter measurement temperature"),
IOPA( "csect", IND_MOD_CSECT, IF_REAL,"Inductor cross section"),
IOPA( "length", IND_MOD_LENGTH, IF_REAL,"Inductor length"),
IOPA( "n", IND_MOD_N, IF_REAL,"Number of turns"),
IOPA( "nt", IND_MOD_NT, IF_REAL,"Model number of turns"),
IOPA( "mu", IND_MOD_MU, IF_REAL,"Relative magnetic permeability"),
OPU( "sind", IND_MOD_SIND, IF_REAL,"Specific model inductance"),
IP( "l", IND_MOD_L, IF_FLAG,"Inductor model")
};

View File

@ -46,7 +46,10 @@ INDask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value,
return(OK);
case IND_SCALE:
value->rValue = here->INDscale;
return(OK);
return(OK);
case IND_NT:
value->rValue = here->INDnt;
return(OK);
case IND_CURRENT :
if (ckt->CKTcurrentAnalysis & DOING_AC) {
errMsg = MALLOC(strlen(msg)+1);

View File

@ -36,6 +36,7 @@ typedef struct sINDinstance {
double INDtemp; /* Instance operating temperature */
double INDdtemp; /* Delta temp. of instance */
double INDscale; /* Scale factor */
double INDnt; /* Number of turns */
double INDinitCond; /* initial inductor voltage if specified */
double *INDposIbrptr; /* pointer to sparse matrix diagonal at
@ -55,6 +56,7 @@ typedef struct sINDinstance {
unsigned INDtempGiven : 1; /* flag to indicate operating temp. given */
unsigned INDdtempGiven : 1; /* flag to indicate delta temp. given */
unsigned INDscaleGiven : 1; /* flag to indicate scale factor given */
unsigned INDntGiven : 1; /* flag to indicate number of turns given */
int INDsenParmNo; /* parameter # for sensitivity use;
set equal to 0 if not a design parameter*/
@ -82,15 +84,16 @@ typedef struct sINDmodel { /* model structure for an inductor */
double INDtempCoeff1; /* first temperature coefficient */
double INDtempCoeff2; /* second temperature coefficient */
double INDcsect; /* Cross section of inductor */
double INDlength; /* Length of inductor */
double INDn; /* Number of turns */
double INDlength; /* Mean length of magnetic path */
double INDmodNt; /* Model number of turns */
double INDmu; /* Relative magnetic permeability */
double INDspecInd; /* Specific (one turn) inductance */
unsigned INDtnomGiven : 1; /* flag to indicate nominal temp was given */
unsigned INDtc1Given : 1; /* flag to indicate tc1 was specified */
unsigned INDtc2Given : 1; /* flag to indicate tc2 was specified */
unsigned INDcsectGiven : 1; /* flag to indicate cross section given */
unsigned INDlengthGiven: 1; /* flag to indicate length given */
unsigned INDnGiven : 1; /* flag to indicate n. of turns given */
unsigned INDmodNtGiven : 1; /* flag to indicate mod. n. of turns given */
unsigned INDmuGiven : 1; /* flag to indicate mu_r given */
unsigned INDmIndGiven : 1; /* flag to indicate model inductance given */
} INDmodel;
@ -151,6 +154,7 @@ typedef struct sMUTmodel { /* model structure for a mutual inductor */
#define IND_TEMP 9
#define IND_DTEMP 10
#define IND_SCALE 11
#define IND_NT 12
/* model parameters */
#define IND_MOD_IND 100
@ -159,9 +163,10 @@ typedef struct sMUTmodel { /* model structure for a mutual inductor */
#define IND_MOD_TNOM 103
#define IND_MOD_CSECT 104
#define IND_MOD_LENGTH 105
#define IND_MOD_N 106
#define IND_MOD_NT 106
#define IND_MOD_MU 107
#define IND_MOD_L 108
#define IND_MOD_SIND 108
#define IND_MOD_L 109
/* device questions */
#define IND_QUEST_SENS_REAL 201

View File

@ -38,8 +38,8 @@ INDmAsk(CKTcircuit *ckt, GENmodel *inst, int which, IFvalue *value)
case IND_MOD_LENGTH:
value->rValue = here->INDlength;
return(OK);
case IND_MOD_N:
value->rValue = here->INDn;
case IND_MOD_NT:
value->rValue = here->INDmodNt;
return(OK);
case IND_MOD_MU:
value->rValue = here->INDmu;

View File

@ -41,9 +41,9 @@ INDmParam(int param, IFvalue *value, GENmodel *inModel)
mod->INDlength = value->rValue;
mod->INDlengthGiven = TRUE;
break;
case IND_MOD_N :
mod->INDn = value->rValue;
mod->INDnGiven = TRUE;
case IND_MOD_NT :
mod->INDmodNt = value->rValue;
mod->INDmodNtGiven = TRUE;
break;
case IND_MOD_MU:
mod->INDmu = value->rValue;

View File

@ -37,7 +37,11 @@ INDparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
case IND_SCALE:
here->INDscale = value->rValue;
here->INDscaleGiven = TRUE;
break;
break;
case IND_NT:
here->INDnt = value->rValue;
here->INDntGiven = TRUE;
break;
case IND_IC:
here->INDinitCond = value->rValue;
here->INDicGiven = TRUE;

View File

@ -1,6 +1,8 @@
/**********
Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles
This function is obsolete (was used by an old sensitivity analysis)
**********/
/* actually load the current ac sensitivity

View File

@ -43,31 +43,34 @@ INDsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
if (!model->INDlengthGiven) {
model->INDlength = 0.0;
}
if (!model->INDnGiven) {
model->INDn = 0.0;
if (!model->INDmodNtGiven) {
model->INDmodNt = 0.0;
}
if (!model->INDmuGiven) {
model->INDmu = 0.0;
}
if (!model->INDmIndGiven) {
if((model->INDlengthGiven)
/* precompute specific inductance (one turn) */
if((model->INDlengthGiven)
&& (model->INDlength > 0.0)) {
if (model->INDmuGiven)
model->INDmInd = ((model->INDmu * CONSTmuZero)
* model->INDn * model->INDn * model->INDcsect)
/ model->INDlength;
else
model->INDmInd = (CONSTmuZero
* model->INDn * model->INDn * model->INDcsect)
/ model->INDlength;
model->INDspecInd = (model->INDmu * CONSTmuZero
* model->INDcsect) / model->INDlength;
else
model->INDspecInd = (CONSTmuZero * model->INDcsect)
/ model->INDlength;
} else {
model->INDspecInd = 0.0;
}
if (!model->INDmIndGiven)
model->INDmInd = model->INDmodNt * model->INDmodNt * model->INDspecInd;
} else {
model->INDmInd = 0.0;
}
}
/* loop through all the instances of the model */
for (here = model->INDinstances; here != NULL ;
here=here->INDnextInstance) {

View File

@ -1,6 +1,8 @@
/**********
Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles
This function is obsolete (was used by an old sensitivity analysis)
**********/
/* actually load the current ac sensitivity

View File

@ -1,6 +1,8 @@
/**********
Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles
This function is obsolete (was used by an old sensitivity analysis)
**********/
/* Pretty print the sensitivity info for all

View File

@ -1,6 +1,8 @@
/**********
Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles
This function is obsolete (was used by an old sensitivity analysis)
**********/
/* loop through all the devices and

View File

@ -1,6 +1,8 @@
/**********
Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles
This function is obsolete (was used by an old sensitivity analysis)
**********/
/* update the charge sensitivities and their derivatives */

View File

@ -44,10 +44,14 @@ INDtemp(GENmodel *inModel, CKTcircuit *ckt)
if (!here->INDscaleGiven) here->INDscale = 1.0;
if (!here->INDmGiven) here->INDm = 1.0;
if (!here->INDntGiven) here->INDnt = 0.0;
if (!here->INDindGiven) /* No instance inductance given */
here->INDinduct = model->INDmInd;
if (!here->INDindGiven) { /* No instance inductance given */
if (here->INDntGiven)
here->INDinduct = model->INDspecInd * here->INDnt * here->INDnt;
else
here->INDinduct = model->INDmInd;
}
difference = (here->INDtemp + here->INDdtemp) - model->INDtnom;
factor = 1.0 + (model->INDtempCoeff1)*difference +

View File

@ -1,6 +1,8 @@
/**********
Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles
This function is obsolete (was used by an old sensitivity analysis)
**********/
/* Pretty print the sensitivity info for all

View File

@ -1,6 +1,8 @@
/**********
Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles
This function is obsolete (was used by an old sensitivity analysis)
**********/
/* loop through all the devices and

View File

@ -34,7 +34,9 @@ MUTtemp(GENmodel *inModel, CKTcircuit *ckt)
ind1 = here->MUTind1->INDinduct;
ind2 = here->MUTind2->INDinduct;
/* _______
* M = k * \/l1 * l2
*/
here->MUTfactor = here->MUTcoupling * sqrt(ind1 * ind2);
}