Browse Source

devices/ind: whitespace cleanup

pre-master-46
h_vogt 13 years ago
committed by rlar
parent
commit
155e082641
  1. 100
      src/spicelib/devices/ind/ind.c
  2. 66
      src/spicelib/devices/ind/inddefs.h
  3. 32
      src/spicelib/devices/ind/indload.c
  4. 76
      src/spicelib/devices/ind/indmpar.c
  5. 86
      src/spicelib/devices/ind/indparam.c
  6. 80
      src/spicelib/devices/ind/indtemp.c

100
src/spicelib/devices/ind/ind.c

@ -9,45 +9,45 @@ Author: 1985 Thomas L. Quarles
#include "inddefs.h"
#include "ngspice/suffix.h"
IFparm INDpTable[] = { /* parameters */
IOPAP("inductance",IND_IND, IF_REAL, "Inductance of inductor"),
IOPAU("ic", IND_IC, IF_REAL, "Initial current through inductor"),
IP( "sens_ind", IND_IND_SENS, IF_FLAG,
"flag to request sensitivity WRT inductance"),
IOPZU("temp", IND_TEMP, IF_REAL, "Instance operating temperature"),
IOPZ( "dtemp", IND_DTEMP, IF_REAL,
"Instance temperature difference with the rest of the circuit"),
IOPU( "m", IND_M, IF_REAL, "Multiplication Factor"),
IOPU( "tc1", IND_TC1, IF_REAL, "First order temp. coefficient"),
IOPU( "tc2", IND_TC2, IF_REAL, "Second order temp. coefficient"),
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, ""),
OP( "i", IND_CURRENT, IF_REAL, "Current through the inductor"),
OPR( "current", IND_CURRENT, IF_REAL, ""),
OP( "p", IND_POWER, IF_REAL,
"instantaneous power dissipated by the inductor"),
OPU( "sens_dc", IND_QUEST_SENS_DC, IF_REAL, "dc sensitivity sensitivity"),
OPU( "sens_real", IND_QUEST_SENS_REAL, IF_REAL, "real part of ac sensitivity"),
OPU( "sens_imag", IND_QUEST_SENS_IMAG, IF_REAL,
"dc sensitivity and imag part of ac sensitivty"),
OPU( "sens_mag", IND_QUEST_SENS_MAG, IF_REAL, "sensitivity of AC magnitude"),
OPU( "sens_ph", IND_QUEST_SENS_PH, IF_REAL, "sensitivity of AC phase"),
OPU( "sens_cplx", IND_QUEST_SENS_CPLX, IF_COMPLEX, "ac sensitivity")
IFparm INDpTable[] = { /* parameters */
IOPAP("inductance",IND_IND, IF_REAL, "Inductance of inductor"),
IOPAU("ic", IND_IC, IF_REAL, "Initial current through inductor"),
IP( "sens_ind", IND_IND_SENS, IF_FLAG,
"flag to request sensitivity WRT inductance"),
IOPZU("temp", IND_TEMP, IF_REAL, "Instance operating temperature"),
IOPZ( "dtemp", IND_DTEMP, IF_REAL,
"Instance temperature difference with the rest of the circuit"),
IOPU( "m", IND_M, IF_REAL, "Multiplication Factor"),
IOPU( "tc1", IND_TC1, IF_REAL, "First order temp. coefficient"),
IOPU( "tc2", IND_TC2, IF_REAL, "Second order temp. coefficient"),
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, ""),
OP( "i", IND_CURRENT, IF_REAL, "Current through the inductor"),
OPR( "current", IND_CURRENT, IF_REAL, ""),
OP( "p", IND_POWER, IF_REAL,
"instantaneous power dissipated by the inductor"),
OPU( "sens_dc", IND_QUEST_SENS_DC, IF_REAL, "dc sensitivity sensitivity"),
OPU( "sens_real", IND_QUEST_SENS_REAL, IF_REAL, "real part of ac sensitivity"),
OPU( "sens_imag", IND_QUEST_SENS_IMAG, IF_REAL,
"dc sensitivity and imag part of ac sensitivty"),
OPU( "sens_mag", IND_QUEST_SENS_MAG, IF_REAL, "sensitivity of AC magnitude"),
OPU( "sens_ph", IND_QUEST_SENS_PH, IF_REAL, "sensitivity of AC phase"),
OPU( "sens_cplx", IND_QUEST_SENS_CPLX, IF_COMPLEX, "ac sensitivity")
};
IFparm INDmPTable[] = { /* model parameters */
IOPA( "ind", IND_MOD_IND, IF_REAL,"Model inductance"),
IOPA( "tc1", IND_MOD_TC1, IF_REAL,"First order temp. coefficient"),
IOPA( "tc2", IND_MOD_TC2, IF_REAL,"Second order temp. coefficient"),
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( "nt", IND_MOD_NT, IF_REAL,"Model number of turns"),
IOPA( "mu", IND_MOD_MU, IF_REAL,"Relative magnetic permeability"),
IP( "l", IND_MOD_L, IF_FLAG,"Inductor model")
IOPA( "ind", IND_MOD_IND, IF_REAL,"Model inductance"),
IOPA( "tc1", IND_MOD_TC1, IF_REAL,"First order temp. coefficient"),
IOPA( "tc2", IND_MOD_TC2, IF_REAL,"Second order temp. coefficient"),
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( "nt", IND_MOD_NT, IF_REAL,"Model number of turns"),
IOPA( "mu", IND_MOD_MU, IF_REAL,"Relative magnetic permeability"),
IP( "l", IND_MOD_L, IF_FLAG,"Inductor model")
};
@ -65,20 +65,20 @@ int INDmSize = sizeof(INDmodel);
#ifdef MUTUAL
IFparm MUTpTable[] = { /* parameters */
IOPAP( "k", MUT_COEFF, IF_REAL , "Mutual inductance"),
IOPR( "coefficient", MUT_COEFF, IF_REAL , ""),
IOP( "inductor1", MUT_IND1, IF_INSTANCE, "First coupled inductor"),
IOP( "inductor2", MUT_IND2, IF_INSTANCE, "Second coupled inductor"),
IP( "sens_coeff", MUT_COEFF_SENS, IF_FLAG,
"flag to request sensitivity WRT coupling factor"),
OPU( "sens_dc", MUT_QUEST_SENS_DC, IF_REAL, "dc sensitivity "),
OPU( "sens_real", MUT_QUEST_SENS_REAL, IF_REAL, "real part of ac sensitivity"),
OPU( "sens_imag", MUT_QUEST_SENS_IMAG, IF_REAL,
"dc sensitivity and imag part of ac sensitivty"),
OPU( "sens_mag", MUT_QUEST_SENS_MAG, IF_REAL, "sensitivity of AC magnitude"),
OPU( "sens_ph", MUT_QUEST_SENS_PH, IF_REAL, "sensitivity of AC phase"),
OPU( "sens_cplx", MUT_QUEST_SENS_CPLX, IF_COMPLEX, "ac sensitivity")
IFparm MUTpTable[] = { /* parameters */
IOPAP( "k", MUT_COEFF, IF_REAL , "Mutual inductance"),
IOPR( "coefficient", MUT_COEFF, IF_REAL , ""),
IOP( "inductor1", MUT_IND1, IF_INSTANCE, "First coupled inductor"),
IOP( "inductor2", MUT_IND2, IF_INSTANCE, "Second coupled inductor"),
IP( "sens_coeff", MUT_COEFF_SENS, IF_FLAG,
"flag to request sensitivity WRT coupling factor"),
OPU( "sens_dc", MUT_QUEST_SENS_DC, IF_REAL, "dc sensitivity "),
OPU( "sens_real", MUT_QUEST_SENS_REAL, IF_REAL, "real part of ac sensitivity"),
OPU( "sens_imag", MUT_QUEST_SENS_IMAG, IF_REAL,
"dc sensitivity and imag part of ac sensitivty"),
OPU( "sens_mag", MUT_QUEST_SENS_MAG, IF_REAL, "sensitivity of AC magnitude"),
OPU( "sens_ph", MUT_QUEST_SENS_PH, IF_REAL, "sensitivity of AC phase"),
OPU( "sens_cplx", MUT_QUEST_SENS_CPLX, IF_COMPLEX, "ac sensitivity")
};
int MUTnSize = NUMELEMS(INDnames);

66
src/spicelib/devices/ind/inddefs.h

@ -15,14 +15,14 @@ Author: 1985 Thomas L. Quarles
#include "ngspice/gendefs.h"
#include "ngspice/cktdefs.h"
/* structures used to descrive inductors */
/* structures used to descrive inductors */
/* information needed for each instance */
typedef struct sINDinstance {
struct sINDmodel *INDmodPtr; /* backpointer to model */
struct sINDinstance *INDnextInstance; /* pointer to next instance of
struct sINDinstance *INDnextInstance; /* pointer to next instance of
* current model*/
IFuid INDname; /* pointer to character string naming this instance */
int INDstate; /* pointer to beginning of state vector for inductor */
@ -40,17 +40,17 @@ typedef struct sINDinstance {
double INDnt; /* Number of turns */
double INDinitCond; /* initial inductor voltage if specified */
double *INDposIbrptr; /* pointer to sparse matrix diagonal at
double *INDposIbrptr; /* pointer to sparse matrix diagonal at
* (positive,branch eq) */
double *INDnegIbrptr; /* pointer to sparse matrix diagonal at
double *INDnegIbrptr; /* pointer to sparse matrix diagonal at
* (negative,branch eq) */
double *INDibrNegptr; /* pointer to sparse matrix offdiagonal at
double *INDibrNegptr; /* pointer to sparse matrix offdiagonal at
* (branch eq,negative) */
double *INDibrPosptr; /* pointer to sparse matrix offdiagonal at
double *INDibrPosptr; /* pointer to sparse matrix offdiagonal at
* (branch eq,positive) */
double *INDibrIbrptr; /* pointer to sparse matrix offdiagonal at
double *INDibrIbrptr; /* pointer to sparse matrix offdiagonal at
* (branch eq,branch eq) */
unsigned INDindGiven : 1; /* flag to indicate inductance was specified */
unsigned INDicGiven : 1; /* flag to indicate init. cond. was specified */
unsigned INDmGiven : 1; /* flag to indicate multiplier given */
@ -68,20 +68,20 @@ typedef struct sINDinstance {
#define INDflux INDstate /* flux in the inductor */
#define INDvolt INDstate+1 /* voltage - save an entry in table */
#define INDsensxp INDstate+2 /* charge sensitivities and their derivatives.
+3 for the derivatives - pointer to the
beginning of the array */
+3 for the derivatives - pointer to the
beginning of the array */
/* per model data */
typedef struct sINDmodel { /* model structure for an inductor */
int INDmodType; /* type index of this device type */
struct sINDmodel *INDnextModel; /* pointer to next possible model in
struct sINDmodel *INDnextModel; /* pointer to next possible model in
* linked list */
INDinstance * INDinstances; /* pointer to list of instances that have this
* model */
IFuid INDmodName; /* pointer to character string naming this model */
double INDmInd; /* Model inductance */
double INDtnom; /* temperature at which inductance measured */
double INDtempCoeff1; /* first temperature coefficient */
@ -90,8 +90,8 @@ typedef struct sINDmodel { /* model structure for an inductor */
double INDlength; /* Mean length of magnetic path */
double INDmodNt; /* Model number of turns */
double INDmu; /* Relative magnetic permeability */
unsigned INDtnomGiven : 1; /* flag to indicate nominal temp was given */
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 */
@ -106,27 +106,27 @@ typedef struct sINDmodel { /* model structure for an inductor */
#ifdef MUTUAL
/* structures used to describe mutual inductors */
/* structures used to describe mutual inductors */
/* information needed for each instance */
typedef struct sMUTinstance {
struct sMUTmodel *MUTmodPtr; /* backpointer to model */
struct sMUTinstance *MUTnextInstance; /* pointer to next instance of
struct sMUTmodel *MUTmodPtr; /* backpointer to model */
struct sMUTinstance *MUTnextInstance; /* pointer to next instance of
* current model*/
IFuid MUTname; /* pointer to character string naming this instance */
double MUTcoupling; /* mutual inductance input by user */
double MUTfactor; /* mutual inductance scaled for internal use */
IFuid MUTindName1; /* name of coupled inductor 1 */
IFuid MUTindName2; /* name of coupled inductor 2 */
INDinstance *MUTind1; /* pointer to coupled inductor 1 */
INDinstance *MUTind2; /* pointer to coupled inductor 2 */
double *MUTbr1br2; /* pointers to off-diagonal intersections of */
double *MUTbr2br1; /* current branch equations in matrix */
unsigned MUTindGiven : 1; /* flag to indicate inductance was specified */
int MUTsenParmNo; /* parameter # for sensitivity use;
IFuid MUTname; /* pointer to character string naming this instance */
double MUTcoupling; /* mutual inductance input by user */
double MUTfactor; /* mutual inductance scaled for internal use */
IFuid MUTindName1; /* name of coupled inductor 1 */
IFuid MUTindName2; /* name of coupled inductor 2 */
INDinstance *MUTind1; /* pointer to coupled inductor 1 */
INDinstance *MUTind2; /* pointer to coupled inductor 2 */
double *MUTbr1br2; /* pointers to off-diagonal intersections of */
double *MUTbr2br1; /* current branch equations in matrix */
unsigned MUTindGiven : 1; /* flag to indicate inductance was specified */
int MUTsenParmNo; /* parameter # for sensitivity use;
set equal to 0 if not a design parameter*/
@ -136,12 +136,12 @@ typedef struct sMUTinstance {
/* per model data */
typedef struct sMUTmodel { /* model structure for a mutual inductor */
int MUTmodType; /* type index of this device type */
struct sMUTmodel *MUTnextModel; /* pointer to next possible model in
int MUTmodType; /* type index of this device type */
struct sMUTmodel *MUTnextModel; /* pointer to next possible model in
* linked list */
MUTinstance * MUTinstances; /* pointer to list of instances that have this
MUTinstance * MUTinstances; /* pointer to list of instances that have this
* model */
IFuid MUTmodName; /* pointer to character string naming this model */
IFuid MUTmodName; /* pointer to character string naming this model */
} MUTmodel;
#endif /*MUTUAL*/

32
src/spicelib/devices/ind/indload.c

@ -3,9 +3,9 @@ Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles
**********/
/* actually load the current inductance value into the
* sparse matrix previously provided
*/
/* actually load the current inductance value into the
* sparse matrix previously provided
*/
#include "ngspice/ngspice.h"
#include "ngspice/cktdefs.h"
@ -22,7 +22,7 @@ INDload(GENmodel *inModel, CKTcircuit *ckt)
double veq;
double req;
int error;
#ifdef MUTUAL
MUTinstance *muthere;
MUTmodel *mutmodel;
@ -40,10 +40,10 @@ INDload(GENmodel *inModel, CKTcircuit *ckt)
if(!(ckt->CKTmode & (MODEDC|MODEINITPRED))) {
if(ckt->CKTmode & MODEUIC && ckt->CKTmode & MODEINITTRAN) {
*(ckt->CKTstate0 + here->INDflux) = here->INDinduct *
here->INDinitCond;
here->INDinitCond;
} else {
*(ckt->CKTstate0 + here->INDflux) = here->INDinduct *
*(ckt->CKTrhsOld + here->INDbrEq);
*(ckt->CKTrhsOld + here->INDbrEq);
}
}
#ifdef MUTUAL
@ -61,13 +61,13 @@ INDload(GENmodel *inModel, CKTcircuit *ckt)
if(!(ckt->CKTmode& (MODEDC|MODEINITPRED))) {
*(ckt->CKTstate0 + muthere->MUTind1->INDflux) +=
muthere->MUTfactor * *(ckt->CKTrhsOld +
muthere->MUTind2->INDbrEq);
muthere->MUTind2->INDbrEq);
*(ckt->CKTstate0 + muthere->MUTind2->INDflux) +=
muthere->MUTfactor * *(ckt->CKTrhsOld +
muthere->MUTind1->INDbrEq);
muthere->MUTind1->INDbrEq);
}
*(muthere->MUTbr1br2) -= muthere->MUTfactor*ckt->CKTag[0];
*(muthere->MUTbr2br1) -= muthere->MUTfactor*ckt->CKTag[0];
}
@ -94,7 +94,7 @@ INDload(GENmodel *inModel, CKTcircuit *ckt)
#endif /*PREDICTOR*/
if (ckt->CKTmode & MODEINITTRAN) {
*(ckt->CKTstate1 + here->INDflux) =
*(ckt->CKTstate0 + here->INDflux);
*(ckt->CKTstate0 + here->INDflux);
}
#ifndef PREDICTOR
}
@ -102,14 +102,14 @@ INDload(GENmodel *inModel, CKTcircuit *ckt)
error=NIintegrate(ckt,&req,&veq,here->INDinduct,here->INDflux);
if(error) return(error);
}
*(ckt->CKTrhs+here->INDbrEq) += veq;
if(ckt->CKTmode & MODEINITTRAN) {
*(ckt->CKTstate1+here->INDvolt) =
if(ckt->CKTmode & MODEINITTRAN) {
*(ckt->CKTstate1+here->INDvolt) =
*(ckt->CKTstate0+here->INDvolt);
}
*(here->INDposIbrptr) += 1;
*(here->INDnegIbrptr) -= 1;
*(here->INDibrPosptr) += 1;

76
src/spicelib/devices/ind/indmpar.c

@ -17,44 +17,44 @@ INDmParam(int param, IFvalue *value, GENmodel *inModel)
{
INDmodel *mod = (INDmodel*)inModel;
switch(param) {
case IND_MOD_IND:
mod->INDmInd = value->rValue;
mod->INDmIndGiven = TRUE;
break;
case IND_MOD_TNOM:
mod->INDtnom = value->rValue+CONSTCtoK;
mod->INDtnomGiven = TRUE;
break;
case IND_MOD_TC1:
mod->INDtempCoeff1 = value->rValue;
mod->INDtc1Given = TRUE;
break;
case IND_MOD_TC2:
mod->INDtempCoeff2 = value->rValue;
mod->INDtc2Given = TRUE;
break;
case IND_MOD_CSECT:
mod->INDcsect = value->rValue;
mod->INDcsectGiven = TRUE;
break;
case IND_MOD_LENGTH :
mod->INDlength = value->rValue;
mod->INDlengthGiven = TRUE;
break;
case IND_MOD_NT :
mod->INDmodNt = value->rValue;
mod->INDmodNtGiven = TRUE;
break;
case IND_MOD_MU:
mod->INDmu = value->rValue;
mod->INDmuGiven = TRUE;
break;
case IND_MOD_L:
/* just being reassured by the user that we are an inductor */
/* no-op */
break;
default:
return(E_BADPARM);
case IND_MOD_IND:
mod->INDmInd = value->rValue;
mod->INDmIndGiven = TRUE;
break;
case IND_MOD_TNOM:
mod->INDtnom = value->rValue+CONSTCtoK;
mod->INDtnomGiven = TRUE;
break;
case IND_MOD_TC1:
mod->INDtempCoeff1 = value->rValue;
mod->INDtc1Given = TRUE;
break;
case IND_MOD_TC2:
mod->INDtempCoeff2 = value->rValue;
mod->INDtc2Given = TRUE;
break;
case IND_MOD_CSECT:
mod->INDcsect = value->rValue;
mod->INDcsectGiven = TRUE;
break;
case IND_MOD_LENGTH :
mod->INDlength = value->rValue;
mod->INDlengthGiven = TRUE;
break;
case IND_MOD_NT :
mod->INDmodNt = value->rValue;
mod->INDmodNtGiven = TRUE;
break;
case IND_MOD_MU:
mod->INDmu = value->rValue;
mod->INDmuGiven = TRUE;
break;
case IND_MOD_L:
/* just being reassured by the user that we are an inductor */
/* no-op */
break;
default:
return(E_BADPARM);
}
return(OK);
}

86
src/spicelib/devices/ind/indparam.c

@ -21,49 +21,49 @@ INDparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
NG_IGNORE(select);
switch(param) {
case IND_IND:
here->INDinduct = value->rValue;
if (!here->INDmGiven)
here->INDm =1.0;
here->INDindGiven = TRUE;
break;
case IND_TEMP:
here->INDtemp = value->rValue + CONSTCtoK;
here->INDtempGiven = TRUE;
break;
case IND_DTEMP:
here->INDdtemp = value->rValue;
here->INDdtempGiven = TRUE;
break;
case IND_M:
here->INDm = value->rValue;
here->INDmGiven = TRUE;
break;
case IND_TC1:
here->INDtc1 = value->rValue;
here->INDtc1Given = TRUE;
break;
case IND_TC2:
here->INDtc2 = value->rValue;
here->INDtc2Given = TRUE;
break;
case IND_SCALE:
here->INDscale = value->rValue;
here->INDscaleGiven = TRUE;
break;
case IND_NT:
here->INDnt = value->rValue;
here->INDntGiven = TRUE;
break;
case IND_IC:
here->INDinitCond = value->rValue;
here->INDicGiven = TRUE;
break;
case IND_IND_SENS:
here->INDsenParmNo = value->iValue;
break;
default:
return(E_BADPARM);
case IND_IND:
here->INDinduct = value->rValue;
if (!here->INDmGiven)
here->INDm =1.0;
here->INDindGiven = TRUE;
break;
case IND_TEMP:
here->INDtemp = value->rValue + CONSTCtoK;
here->INDtempGiven = TRUE;
break;
case IND_DTEMP:
here->INDdtemp = value->rValue;
here->INDdtempGiven = TRUE;
break;
case IND_M:
here->INDm = value->rValue;
here->INDmGiven = TRUE;
break;
case IND_TC1:
here->INDtc1 = value->rValue;
here->INDtc1Given = TRUE;
break;
case IND_TC2:
here->INDtc2 = value->rValue;
here->INDtc2Given = TRUE;
break;
case IND_SCALE:
here->INDscale = value->rValue;
here->INDscaleGiven = TRUE;
break;
case IND_NT:
here->INDnt = value->rValue;
here->INDntGiven = TRUE;
break;
case IND_IC:
here->INDinitCond = value->rValue;
here->INDicGiven = TRUE;
break;
case IND_IND_SENS:
here->INDsenParmNo = value->iValue;
break;
default:
return(E_BADPARM);
}
return(OK);
}

80
src/spicelib/devices/ind/indtemp.c

@ -31,47 +31,47 @@ INDtemp(GENmodel *inModel, CKTcircuit *ckt)
here=here->INDnextInstance) {
/* Default Value Processing for Inductor Instance */
if(!here->INDtempGiven) {
here->INDtemp = ckt->CKTtemp;
if(!here->INDdtempGiven) here->INDdtemp = 0.0;
} else { /* INDtempGiven */
here->INDdtemp = 0.0;
if (here->INDdtempGiven)
printf("%s: Instance temperature specified, dtemp ignored\n",
here->INDname);
}
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 */
if (here->INDntGiven)
here->INDinduct = model->INDspecInd * here->INDnt * here->INDnt;
else
here->INDinduct = model->INDmInd;
if(!here->INDtempGiven) {
here->INDtemp = ckt->CKTtemp;
if(!here->INDdtempGiven) here->INDdtemp = 0.0;
} else { /* INDtempGiven */
here->INDdtemp = 0.0;
if (here->INDdtempGiven)
printf("%s: Instance temperature specified, dtemp ignored\n",
here->INDname);
}
difference = (here->INDtemp + here->INDdtemp) - model->INDtnom;
/* instance parameters tc1 and tc2 will override
model parameters tc1 and tc2 */
if (here->INDtc1Given)
tc1 = here->INDtc1; /* instance */
else
tc1 = model->INDtempCoeff1; /* model */
if (here->INDtc2Given)
tc2 = here->INDtc2;
else
tc2 = model->INDtempCoeff2;
factor = 1.0 + tc1*difference + tc2*difference*difference;
here->INDinduct = here->INDinduct * factor * here->INDscale;
here->INDinduct = here->INDinduct / here->INDm;
}
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 */
if (here->INDntGiven)
here->INDinduct = model->INDspecInd * here->INDnt * here->INDnt;
else
here->INDinduct = model->INDmInd;
}
difference = (here->INDtemp + here->INDdtemp) - model->INDtnom;
/* instance parameters tc1 and tc2 will override
model parameters tc1 and tc2 */
if (here->INDtc1Given)
tc1 = here->INDtc1; /* instance */
else
tc1 = model->INDtempCoeff1; /* model */
if (here->INDtc2Given)
tc2 = here->INDtc2;
else
tc2 = model->INDtempCoeff2;
factor = 1.0 + tc1*difference + tc2*difference*difference;
here->INDinduct = here->INDinduct * factor * here->INDscale;
here->INDinduct = here->INDinduct / here->INDm;
}
}
return(OK);
}

Loading…
Cancel
Save