From 1c5e954b476fc67265ef5ea748165f23c65b5aed Mon Sep 17 00:00:00 2001 From: rlar Date: Sun, 1 Oct 2017 19:04:16 +0200 Subject: [PATCH] devices/res, bug fix, semantics of "short" and "narrow", aka "dlr" and "dw" These need to be subtracted from both sides --- src/spicelib/devices/res/ressetup.c | 4 ++-- src/spicelib/devices/res/restemp.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/spicelib/devices/res/ressetup.c b/src/spicelib/devices/res/ressetup.c index fc9394593..412467c9d 100644 --- a/src/spicelib/devices/res/ressetup.c +++ b/src/spicelib/devices/res/ressetup.c @@ -58,8 +58,8 @@ RESsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit*ckt, int *state) here->RESbv_max = model->RESbv_max; if((here->RESwidthGiven)||(here->RESlengthGiven)) - here->RESeffNoiseArea = pow((here->RESlength-model->RESshort),model->RESlf) - *pow((here->RESwidth-model->RESnarrow),model->RESwf); + here->RESeffNoiseArea = pow(here->RESlength - 2 * model->RESshort, model->RESlf) + *pow(here->RESwidth - 2 * model->RESnarrow, model->RESwf); else here->RESeffNoiseArea = 1.0; diff --git a/src/spicelib/devices/res/restemp.c b/src/spicelib/devices/res/restemp.c index fe5d83f53..fc46a0a28 100644 --- a/src/spicelib/devices/res/restemp.c +++ b/src/spicelib/devices/res/restemp.c @@ -36,8 +36,8 @@ REStemp(GENmodel *inModel, CKTcircuit *ckt) if (!here->RESresGiven) { if (here->RESlength * here->RESwidth * model->RESsheetRes > 0.0) { here->RESresist = - (here->RESlength - model->RESshort) / - (here->RESwidth - model->RESnarrow) * + (here->RESlength - 2 * model->RESshort) / + (here->RESwidth - 2 * model->RESnarrow) * model->RESsheetRes; } else if (model->RESresGiven) { here->RESresist = model->RESres;