cccs (F source): multiplier m added

This commit is contained in:
h_vogt 2013-05-30 10:25:59 +02:00
parent d54e9aa82f
commit fe244d44f2
4 changed files with 13 additions and 0 deletions

View File

@ -12,6 +12,7 @@ Author: 1987 Thomas L. Quarles
IFparm CCCSpTable[] = { /* parameters */
IOPU("gain", CCCS_GAIN, IF_REAL ,"Gain of source"),
IOPU("control", CCCS_CONTROL, IF_INSTANCE,"Name of controlling source"),
IOP ( "m", CCCS_M, IF_REAL , "Parallel multiplier"),
IP("sens_gain",CCCS_GAIN_SENS,IF_FLAG, "flag to request sensitivity WRT gain"),
OPU("neg_node", CCCS_NEG_NODE,IF_INTEGER, "Negative node of source"),
OPU("pos_node", CCCS_POS_NODE,IF_INTEGER, "Positive node of source"),

View File

@ -36,6 +36,8 @@ CCCSask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value, IFvalue *
case CCCS_CONTROL:
value->uValue = here->CCCScontName;
return (OK);
case CCCS_M:
value->rValue = here->CCCSmValue;
case CCCS_POS_NODE:
value->iValue = here->CCCSposNode;
return (OK);

View File

@ -30,11 +30,14 @@ typedef struct sCCCSinstance {
double CCCScoeff; /* coefficient */
double CCCSmValue; /* Parallel multiplier */
double *CCCSposContBrptr; /* pointer to sparse matrix element at
*(positive node, control branch eq)*/
double *CCCSnegContBrptr; /* pointer to sparse matrix element at
*(negative node, control branch eq)*/
unsigned CCCScoeffGiven :1 ; /* flag to indicate coeff given */
unsigned CCCSmGiven :1 ; /* flag to indicate multiplier given */
int CCCSsenParmNo; /* parameter # for sensitivity use;
set equal to 0 if not a design parameter*/
@ -62,6 +65,7 @@ typedef struct sCCCSmodel { /* model structure for a source */
#define CCCS_CURRENT 7
#define CCCS_POWER 8
#define CCCS_VOLTS 9
#define CCCS_M 10
/* model parameters */

View File

@ -23,11 +23,17 @@ CCCSparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
switch(param) {
case CCCS_GAIN:
here->CCCScoeff = value->rValue;
if (here->CCCSmGiven)
here->CCCScoeff *= here->CCCSmValue;
here->CCCScoeffGiven = TRUE;
break;
case CCCS_CONTROL:
here->CCCScontName = value->uValue;
break;
case CCCS_M:
here->CCCSmValue = value->rValue;
here->CCCSmGiven = TRUE;
break;
case CCCS_GAIN_SENS:
here->CCCSsenParmNo = value->iValue;
break;