tlevc=1 correction

This commit is contained in:
dwarning 2012-01-30 19:57:57 +00:00
parent b4424c9d2c
commit d2f9fe7379
7 changed files with 38 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2012-01-30 Dietmar Warning
* src/spicelib/devices/dio/diotemp.c: Add temperature dependent
junction potentials also for tlevc=1 capacitor temperature model
2012-01-28 Robert Larice
* src/include/ngspice/ngspice.h :
define NAN for non C99 environments

View File

@ -75,6 +75,11 @@ IFparm DIOmPTable[] = { /* model parameters */
IOP( "cta", DIO_MOD_CTA, IF_REAL, "Area junction temperature coefficient"),
IOPR( "ctc", DIO_MOD_CTA, IF_REAL, "Area junction capacitance temperature coefficient"),
IOP( "ctp", DIO_MOD_CTP, IF_REAL, "Perimeter junction capacitance temperature coefficient"),
IOP( "tbp", DIO_MOD_TBP, IF_REAL, "Area junction potential temperature coefficient"),
IOPR( "tvj", DIO_MOD_TBP, IF_REAL, "Area junction potential temperature coefficient"),
IOP( "tphp", DIO_MOD_TPHP, IF_REAL, "Perimeter junction potential temperature coefficient"),
IOP( "kf", DIO_MOD_KF, IF_REAL, "flicker noise coefficient"),
IOP( "af", DIO_MOD_AF, IF_REAL, "flicker noise exponent"),
IOP( "fc", DIO_MOD_FC, IF_REAL, "Forward bias junction fit parameter"),

View File

@ -186,6 +186,8 @@ typedef struct sDIOmodel { /* model structure for a diode */
unsigned DIOsaturationCurrentExpGiven : 1;
unsigned DIOctaGiven : 1;
unsigned DIOctpGiven : 1;
unsigned DIOtbpGiven : 1;
unsigned DIOtphpGiven : 1;
unsigned DIOdepletionCapCoeffGiven : 1;
unsigned DIOdepletionSWcapCoeffGiven :1;
unsigned DIObreakdownVoltageGiven : 1;
@ -223,6 +225,8 @@ typedef struct sDIOmodel { /* model structure for a diode */
double DIOsaturationCurrentExp; /* Saturation current exponential (XTI) */
double DIOcta; /* Area junction temperature coefficient */
double DIOctp; /* Perimeter junction temperature coefficient */
double DIOtbp; /* Area junction potential temperature coefficient */
double DIOtphp; /* Perimeter junction potential temperature coefficient */
double DIOdepletionCapCoeff; /* Depletion Cap fraction coefficient (FC)*/
double DIOdepletionSWcapCoeff; /* Depletion sw-Cap fraction coefficient (FCS)*/
double DIObreakdownVoltage; /* Voltage at reverse breakdown */
@ -293,7 +297,9 @@ typedef struct sDIOmodel { /* model structure for a diode */
#define DIO_MOD_TLEVC 132
#define DIO_MOD_CTA 133
#define DIO_MOD_CTP 134
#define DIO_MOD_TCV 135
#define DIO_MOD_TBP 135
#define DIO_MOD_TPHP 136
#define DIO_MOD_TCV 137
#include "dioext.h"
#endif /*DIO*/

View File

@ -104,6 +104,12 @@ DIOmAsk (CKTcircuit *ckt, GENmodel *inModel, int which, IFvalue *value)
case DIO_MOD_CTP:
value->rValue = model->DIOctp;
return(OK);
case DIO_MOD_TBP:
value->rValue = model->DIOtbp;
return(OK);
case DIO_MOD_TPHP:
value->rValue = model->DIOtphp;
return(OK);
case DIO_MOD_FC:
value->rValue = model->DIOdepletionCapCoeff;
return(OK);

View File

@ -125,6 +125,14 @@ DIOmParam(int param, IFvalue *value, GENmodel *inModel)
model->DIOctp = value->rValue;
model->DIOctpGiven = TRUE;
break;
case DIO_MOD_TBP:
model->DIOtbp = value->rValue;
model->DIOtbpGiven = TRUE;
break;
case DIO_MOD_TPHP:
model->DIOtphp = value->rValue;
model->DIOtphpGiven = TRUE;
break;
case DIO_MOD_FC:
model->DIOdepletionCapCoeff = value->rValue;
model->DIOdepletionCapCoeffGiven = TRUE;

View File

@ -102,6 +102,12 @@ DIOsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
if(!model->DIOctpGiven) {
model->DIOctp = 0.0;
}
if(!model->DIOtbpGiven) {
model->DIOtbp = 0.0;
}
if(!model->DIOtphpGiven) {
model->DIOtphp = 0.0;
}
if(!model->DIOfNcoefGiven) {
model->DIOfNcoef = 0.0;
}

View File

@ -132,6 +132,7 @@ DIOtemp(GENmodel *inModel, CKTcircuit *ckt)
here->DIOtJctCap *= 1+here->DIOtGradingCoeff*
(400e-6*(here->DIOtemp-REFTEMP)-gmanew);
} else if (model->DIOtlevc == 1) {
here->DIOtJctPot = model->DIOjunctionPot - model->DIOtbp*(here->DIOtemp-REFTEMP);
here->DIOtJctCap = model->DIOjunctionCap *
(model->DIOcta*(here->DIOtemp-REFTEMP));
}
@ -147,6 +148,7 @@ DIOtemp(GENmodel *inModel, CKTcircuit *ckt)
here->DIOtJctSWCap *= 1+model->DIOgradingSWCoeff*
(400e-6*(here->DIOtemp-REFTEMP)-gmaSWnew);
} else if (model->DIOtlevc == 1) {
here->DIOtJctSWPot = model->DIOjunctionSWPot - model->DIOtphp*(here->DIOtemp-REFTEMP);
here->DIOtJctSWCap = model->DIOjunctionSWCap *
(model->DIOctp*(here->DIOtemp-REFTEMP));
}