capsacl.c

来自「ngspice又一个电子CAD仿真软件代码.功能更全」· C语言 代码 · 共 66 行

C
66
字号
/**********Copyright 1990 Regents of the University of California.  All rights reserved.Author: 1985 Thomas L. QuarlesModified: September 2003 Paolo NenziThis function is obsolete (was used by an old sensitivity analysis)**********//* *//* actually load the current ac sensitivity  * information into the  array previously provided  */#include "ngspice.h"#include "cktdefs.h"#include "capdefs.h"#include "trandefs.h"#include "sperror.h"#include "suffix.h"intCAPsAcLoad(GENmodel *inModel, CKTcircuit *ckt){    CAPmodel *model = (CAPmodel*)inModel;    CAPinstance *here;    double vcap;    double ivcap;    double val;    double ival;    /*  loop through all the capacitor models */    for( ; model != NULL; model = model->CAPnextModel ) {        /* loop through all the instances of the model */        for (here = model->CAPinstances; here != NULL ;                    here=here->CAPnextInstance) {	    if (here->CAPowner != ARCHme) continue;            if(here->CAPsenParmNo){                vcap = *(ckt->CKTrhsOld+here->CAPposNode) -                     *(ckt->CKTrhsOld+here->CAPnegNode);                ivcap = *(ckt->CKTirhsOld+here->CAPposNode) -                     *(ckt->CKTirhsOld+here->CAPnegNode);                   val = ckt->CKTomega * ivcap;                ival = ckt->CKTomega * vcap;                /* load the RHS matrix */                *(ckt->CKTsenInfo->SEN_RHS[here->CAPposNode] +                         here->CAPsenParmNo) += val;                *(ckt->CKTsenInfo->SEN_iRHS[here->CAPposNode] +                        here->CAPsenParmNo) -= ival;                *(ckt->CKTsenInfo->SEN_RHS[here->CAPnegNode] +                         here->CAPsenParmNo) -= val;                *(ckt->CKTsenInfo->SEN_iRHS[here->CAPnegNode] +                         here->CAPsenParmNo) += ival;            }        }    }    return(OK);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?