#include "spice.h"
#include "spmatrix.h"
#include "util.h"
#include "srcdefs.h"
#include "outdata.h"
#include "sensdefs.h"
#include "sensgen.h"
#include "uflags.h"
Go to the source code of this file.
|
#define | NEWN(TYPE, COUNT) ((TYPE *) MALLOC(sizeof(TYPE) * (COUNT))) |
|
#define | M_LOG2E 1.4426950408889634074 |
|
|
static int | sens_acoperation () |
|
static int | sens_dcoperation () |
|
static int | sens_loadnew () |
|
static int | sens_setp () |
|
int | SENSan (GENERIC *cktp, int restart) |
|
static int | sens_dcoperation (CKTcircuit *ckt, struct sOUTdata *outd, int restart) |
|
static int | sens_acoperation (CKTcircuit *ckt, struct sOUTdata *outd, int restart) |
|
int | sens_getp (sgen *sg, CKTcircuit *ckt, IFvalue *val) |
|
static int | sens_setp (sgen *sg, CKTcircuit *ckt, IFvalue *val) |
|
static int | sens_loadnew (sgen *sg, CKTcircuit *ckt, int is_dc) |
|
#define M_LOG2E 1.4426950408889634074 |
#define NEWN |
( |
|
TYPE, |
|
|
|
COUNT |
|
) |
| ((TYPE *) MALLOC(sizeof(TYPE) * (COUNT))) |
static int sens_acoperation |
( |
| ) |
|
|
static |
Definition at line 361 of file sensan.c.
388 for (i = 0; i <= st->size; i++) {
427 for (j = 0; j <= st->size; j++) {
438 if (sg->value != 0.0)
443 nvalue.rValue = sg->value + delta_var;
451 for (j = 0; j <= st->size; j++) {
452 st->dIr[j] = -st->dIr[j];
453 st->dIi[j] = -st->dIi[j];
463 value.rValue = sg->value;
467 spMultiply(st->dY, st->dIdYr, E, st->dIdYi, iE);
470 for (j = 0; j <= st->size; j++) {
471 st->dIr[j] -= st->dIdYr[j];
472 st->dIi[j] -= st->dIdYi[j];
476 spSolve(
Y, st->dIr, st->dIr, st->dIi, st->dIi);
483 st->o_cvalues[i].real =
486 st->o_cvalues[i].imag =
491 st->o_cvalues[i].real =
494 st->o_cvalues[i].imag =
498 st->o_cvalues[i].real /= delta_var;
499 st->o_cvalues[i].imag /= delta_var;
501 nvalue.v.vec.cVec = st->o_cvalues;
static int sens_loadnew()
static double Sens_Abs_Delta
static int sens_dcoperation |
( |
| ) |
|
|
static |
Definition at line 227 of file sensan.c.
280 for (j = 0; j <= st->size; j++) {
290 if (sg->value != 0.0)
295 nvalue.rValue = sg->value + delta_var;
303 for (j = 0; j <= st->size; j++) {
304 st->dIr[j] = -st->dIr[j];
314 value.rValue = sg->value;
321 for (j = 0; j <= st->size; j++) {
322 st->dIr[j] -= st->dIdYr[j];
340 st->o_values[i] /= delta_var;
342 nvalue.v.vec.rVec = st->o_values;
int ACloop(int(*func)(), CKTcircuit *ckt, int restart, struct sACprms *ac, struct sOUTdata *outd)
static int sens_loadnew()
static double Sens_Abs_Delta
static int sens_acoperation()
GENinstance * elt[DCTNESTLEVEL]
Definition at line 518 of file sensan.c.
540 error = (*fn)(ckt, sg->
model, pid, val);
547 printf(
"GET ERROR: %s:%s:%s -> param %s (%d)\n",
553 printf(
"GET ERROR: %s:%s:%s -> mparam %s (%d)\n",
static int sens_loadnew |
( |
| ) |
|
|
static |
Definition at line 566 of file sensan.c.
588 error = (*fn)(pid, val, sg->
model);
595 printf(
"SET ERROR: %s:%s:%s -> param %s (%d)\n",
601 printf(
"SET ERROR: %s:%s:%s -> mparam %s (%d)\n",
int SENSan |
( |
GENERIC * |
cktp, |
|
|
int |
restart |
|
) |
| |
Definition at line 57 of file sensan.c.
75 "Sensitivity analysis not possible with Josephson junctions",
89 "Sensitivity Analysis source %s not in circuit",
105 "DCtrCurv: source %s not in circuit",
131 st->dY =
spCreate(st->size, 1, &error);
136 st->dIr =
NEWN(
double, st->size + 1);
137 st->dIi =
NEWN(
double, st->size + 1);
138 st->dIdYr =
NEWN(
double, st->size + 1);
139 st->dIdYi =
NEWN(
double, st->size + 1);
148 outd.dataNames =
NEWN(
IFuid,outd.numNames);
150 if (!sg->is_instparam) {
151 sprintf(namebuf,
"%s:%s",
152 sg->instance->GENname,
153 sg->ptable[sg->param].keyword);
155 else if ((sg->ptable[sg->param].dataType
157 sprintf(namebuf,
"%s", sg->instance->GENname);
160 sprintf(namebuf,
"%s.%s",
161 sg->instance->GENname,
162 sg->ptable[sg->param].keyword);
166 outd.dataNames + i,
NULL,
183 outd.circuitPtr = (
GENERIC *)ckt;
195 FREE(outd.dataNames);
198 st->o_values =
NEWN(
double, outd.numNames);
199 st->o_cvalues =
NULL;
int DCTloop(int(*func)(), CKTcircuit *ckt, int restart, struct sDCTprms *dc, struct sOUTdata *outd)
IFuid eltName[DCTNESTLEVEL]
static int sens_dcoperation()
double vsave[DCTNESTLEVEL]
#define NEWN(TYPE, COUNT)
GENinstance * elt[DCTNESTLEVEL]
double Sens_Abs_Delta = 0.000001 |
|
static |
double Sens_Delta = 0.000001 |
|
static |