whitespaces
This commit is contained in:
parent
4965d02b5f
commit
5d2fd1ece0
|
|
@ -14,8 +14,8 @@ Modified: September 2003 Paolo Nenzi
|
|||
|
||||
/* ARGSUSED */
|
||||
int
|
||||
CAPask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value,
|
||||
IFvalue *select)
|
||||
CAPask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value,
|
||||
IFvalue *select)
|
||||
{
|
||||
CAPinstance *here = (CAPinstance *)inst;
|
||||
double vr;
|
||||
|
|
@ -27,14 +27,14 @@ CAPask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value,
|
|||
|
||||
switch(which) {
|
||||
case CAP_TEMP:
|
||||
value->rValue = here->CAPtemp - CONSTCtoK;
|
||||
return(OK);
|
||||
case CAP_DTEMP:
|
||||
value->rValue = here->CAPdtemp;
|
||||
return(OK);
|
||||
value->rValue = here->CAPtemp - CONSTCtoK;
|
||||
return(OK);
|
||||
case CAP_DTEMP:
|
||||
value->rValue = here->CAPdtemp;
|
||||
return(OK);
|
||||
case CAP_CAP:
|
||||
value->rValue=here->CAPcapac;
|
||||
value->rValue *= here->CAPm;
|
||||
value->rValue *= here->CAPm;
|
||||
return(OK);
|
||||
case CAP_IC:
|
||||
value->rValue = here->CAPinitCond;
|
||||
|
|
@ -45,12 +45,12 @@ CAPask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value,
|
|||
case CAP_LENGTH:
|
||||
value->rValue = here->CAPlength;
|
||||
return(OK);
|
||||
case CAP_SCALE:
|
||||
value->rValue = here->CAPscale;
|
||||
return(OK);
|
||||
case CAP_M:
|
||||
value->rValue = here->CAPm;
|
||||
return(OK);
|
||||
case CAP_SCALE:
|
||||
value->rValue = here->CAPscale;
|
||||
return(OK);
|
||||
case CAP_M:
|
||||
value->rValue = here->CAPm;
|
||||
return(OK);
|
||||
case CAP_CURRENT:
|
||||
if (ckt->CKTcurrentAnalysis & DOING_AC) {
|
||||
errMsg = TMALLOC(char, strlen(msg) + 1);
|
||||
|
|
@ -65,11 +65,11 @@ CAPask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value,
|
|||
} else {
|
||||
value->rValue = *(ckt->CKTstate0 + here->CAPccap);
|
||||
}
|
||||
} else value->rValue = *(ckt->CKTstate0 + here->CAPccap);
|
||||
|
||||
value->rValue *= here->CAPm;
|
||||
|
||||
return(OK);
|
||||
} else value->rValue = *(ckt->CKTstate0 + here->CAPccap);
|
||||
|
||||
value->rValue *= here->CAPm;
|
||||
|
||||
return(OK);
|
||||
case CAP_POWER:
|
||||
if (ckt->CKTcurrentAnalysis & DOING_AC) {
|
||||
errMsg = TMALLOC(char, strlen(msg) + 1);
|
||||
|
|
@ -83,16 +83,16 @@ CAPask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value,
|
|||
value->rValue = 0;
|
||||
} else {
|
||||
value->rValue = *(ckt->CKTstate0 + here->CAPccap) *
|
||||
(*(ckt->CKTrhsOld + here->CAPposNode) -
|
||||
(*(ckt->CKTrhsOld + here->CAPposNode) -
|
||||
*(ckt->CKTrhsOld + here->CAPnegNode));
|
||||
}
|
||||
} else value->rValue = *(ckt->CKTstate0 + here->CAPccap) *
|
||||
(*(ckt->CKTrhsOld + here->CAPposNode) -
|
||||
(*(ckt->CKTrhsOld + here->CAPposNode) -
|
||||
*(ckt->CKTrhsOld + here->CAPnegNode));
|
||||
|
||||
value->rValue *= here->CAPm;
|
||||
|
||||
return(OK);
|
||||
|
||||
value->rValue *= here->CAPm;
|
||||
|
||||
return(OK);
|
||||
case CAP_QUEST_SENS_DC:
|
||||
if(ckt->CKTsenInfo){
|
||||
value->rValue = *(ckt->CKTsenInfo->SEN_Sap[select->iValue + 1]+
|
||||
|
|
@ -113,8 +113,8 @@ CAPask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value,
|
|||
return(OK);
|
||||
case CAP_QUEST_SENS_MAG:
|
||||
if(ckt->CKTsenInfo){
|
||||
vr = *(ckt->CKTrhsOld + select->iValue + 1);
|
||||
vi = *(ckt->CKTirhsOld + select->iValue + 1);
|
||||
vr = *(ckt->CKTrhsOld + select->iValue + 1);
|
||||
vi = *(ckt->CKTirhsOld + select->iValue + 1);
|
||||
vm = sqrt(vr*vr + vi*vi);
|
||||
if(vm == 0){
|
||||
value->rValue = 0;
|
||||
|
|
@ -129,8 +129,8 @@ CAPask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value,
|
|||
return(OK);
|
||||
case CAP_QUEST_SENS_PH:
|
||||
if(ckt->CKTsenInfo){
|
||||
vr = *(ckt->CKTrhsOld + select->iValue + 1);
|
||||
vi = *(ckt->CKTirhsOld + select->iValue + 1);
|
||||
vr = *(ckt->CKTrhsOld + select->iValue + 1);
|
||||
vi = *(ckt->CKTirhsOld + select->iValue + 1);
|
||||
vm = vr*vr + vi*vi;
|
||||
if(vm == 0){
|
||||
value->rValue = 0;
|
||||
|
|
@ -147,10 +147,10 @@ CAPask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value,
|
|||
|
||||
case CAP_QUEST_SENS_CPLX:
|
||||
if(ckt->CKTsenInfo){
|
||||
value->cValue.real=
|
||||
value->cValue.real=
|
||||
*(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
|
||||
here->CAPsenParmNo);
|
||||
value->cValue.imag=
|
||||
value->cValue.imag=
|
||||
*(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
|
||||
here->CAPsenParmNo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ Author: 1985 Thomas L. Quarles
|
|||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
INDask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value,
|
||||
INDask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value,
|
||||
IFvalue *select)
|
||||
{
|
||||
INDinstance *here = (INDinstance*)inst;
|
||||
|
|
@ -22,6 +22,7 @@ INDask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value,
|
|||
double si;
|
||||
double vm;
|
||||
static char *msg = "Current and power not available for ac analysis";
|
||||
|
||||
switch(which) {
|
||||
case IND_FLUX:
|
||||
value->rValue = *(ckt->CKTstate0+here->INDflux);
|
||||
|
|
@ -32,24 +33,24 @@ INDask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value,
|
|||
case IND_IND:
|
||||
value->rValue = here->INDinduct;
|
||||
return(OK);
|
||||
case IND_IC:
|
||||
case IND_IC:
|
||||
value->rValue = here->INDinitCond;
|
||||
return(OK);
|
||||
case IND_TEMP:
|
||||
case IND_TEMP:
|
||||
value->rValue = here->INDtemp - CONSTCtoK;
|
||||
return(OK);
|
||||
case IND_DTEMP:
|
||||
return(OK);
|
||||
case IND_DTEMP:
|
||||
value->rValue = here->INDdtemp;
|
||||
return(OK);
|
||||
case IND_M:
|
||||
case IND_M:
|
||||
value->rValue = here->INDm;
|
||||
return(OK);
|
||||
case IND_SCALE:
|
||||
case IND_SCALE:
|
||||
value->rValue = here->INDscale;
|
||||
return(OK);
|
||||
case IND_NT:
|
||||
return(OK);
|
||||
case IND_NT:
|
||||
value->rValue = here->INDnt;
|
||||
return(OK);
|
||||
return(OK);
|
||||
case IND_CURRENT :
|
||||
if (ckt->CKTcurrentAnalysis & DOING_AC) {
|
||||
errMsg = TMALLOC(char, strlen(msg) + 1);
|
||||
|
|
@ -91,8 +92,8 @@ INDask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value,
|
|||
return(OK);
|
||||
case IND_QUEST_SENS_MAG:
|
||||
if(ckt->CKTsenInfo){
|
||||
vr = *(ckt->CKTrhsOld + select->iValue + 1);
|
||||
vi = *(ckt->CKTirhsOld + select->iValue + 1);
|
||||
vr = *(ckt->CKTrhsOld + select->iValue + 1);
|
||||
vi = *(ckt->CKTirhsOld + select->iValue + 1);
|
||||
vm = sqrt(vr*vr + vi*vi);
|
||||
if(vm == 0){
|
||||
value->rValue = 0;
|
||||
|
|
@ -107,8 +108,8 @@ INDask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value,
|
|||
return(OK);
|
||||
case IND_QUEST_SENS_PH:
|
||||
if(ckt->CKTsenInfo){
|
||||
vr = *(ckt->CKTrhsOld + select->iValue + 1);
|
||||
vi = *(ckt->CKTirhsOld + select->iValue + 1);
|
||||
vr = *(ckt->CKTrhsOld + select->iValue + 1);
|
||||
vi = *(ckt->CKTirhsOld + select->iValue + 1);
|
||||
vm = vr*vr + vi*vi;
|
||||
if(vm == 0){
|
||||
value->rValue = 0;
|
||||
|
|
@ -123,10 +124,10 @@ INDask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value,
|
|||
return(OK);
|
||||
case IND_QUEST_SENS_CPLX:
|
||||
if(ckt->CKTsenInfo){
|
||||
value->cValue.real=
|
||||
value->cValue.real=
|
||||
*(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
|
||||
here->INDsenParmNo);
|
||||
value->cValue.imag=
|
||||
value->cValue.imag=
|
||||
*(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
|
||||
here->INDsenParmNo);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue