Jspice3
Main Page
Data Structures
Files
File List
Globals
traacld.c
Go to the documentation of this file.
1
/**********
2
Copyright 1990 Regents of the University of California. All rights reserved.
3
Author: 1985 Thomas L. Quarles
4
**********/
5
6
#include "
spice.h
"
7
#include <stdio.h>
8
#include <math.h>
9
#include "
tradefs.h
"
10
#include "
sperror.h
"
11
12
13
int
14
TRAacLoad
(inModel,ckt)
15
16
GENmodel
*inModel;
17
CKTcircuit
*ckt;
18
/* actually load the current values into the
19
* sparse matrix previously provided
20
*/
21
{
22
TRAmodel
*
model
= (
TRAmodel
*)inModel;
23
TRAinstance
*here;
24
double
real;
25
double
imag;
26
27
/* loop through all the transmission line models */
28
for
( ; model !=
NULL
; model = model->
TRAnextModel
) {
29
30
/* loop through all the instances of the model */
31
for
(here = model->
TRAinstances
; here !=
NULL
;
32
here=here->
TRAnextInstance
) {
33
real =
cos
(-ckt->
CKTomega
*here->
TRAtd
);
34
imag =
sin
(-ckt->
CKTomega
*here->
TRAtd
);
35
36
*(here->
TRApos1Pos1Ptr
) += here->
TRAconduct
;
37
*(here->
TRApos1Int1Ptr
) -= here->
TRAconduct
;
38
*(here->
TRAneg1Ibr1Ptr
) -= 1;
39
*(here->
TRApos2Pos2Ptr
) += here->
TRAconduct
;
40
*(here->
TRAneg2Ibr2Ptr
) -= 1;
41
*(here->
TRAint1Pos1Ptr
) -= here->
TRAconduct
;
42
*(here->
TRAint1Int1Ptr
) += here->
TRAconduct
;
43
*(here->
TRAint1Ibr1Ptr
) += 1;
44
*(here->
TRAint2Int2Ptr
) += here->
TRAconduct
;
45
*(here->
TRAint2Ibr2Ptr
) += 1;
46
*(here->
TRAibr1Neg1Ptr
) -= 1;
47
*(here->
TRAibr1Pos2Ptr
+0) -= real;
48
*(here->
TRAibr1Pos2Ptr
+1) -= imag;
49
*(here->
TRAibr1Neg2Ptr
+0) += real;
50
*(here->
TRAibr1Neg2Ptr
+1) += imag;
51
*(here->
TRAibr1Int1Ptr
) += 1;
52
*(here->
TRAibr1Ibr2Ptr
+0) -= real * here->
TRAimped
;
53
*(here->
TRAibr1Ibr2Ptr
+1) -= imag * here->
TRAimped
;
54
*(here->
TRAibr2Pos1Ptr
+0) -= real;
55
*(here->
TRAibr2Pos1Ptr
+1) -= imag;
56
*(here->
TRAibr2Neg1Ptr
+0) += real;
57
*(here->
TRAibr2Neg1Ptr
+1) += imag;
58
*(here->
TRAibr2Neg2Ptr
) -= 1;
59
*(here->
TRAibr2Int2Ptr
) += 1;
60
*(here->
TRAibr2Ibr1Ptr
+0) -= real * here->
TRAimped
;
61
*(here->
TRAibr2Ibr1Ptr
+1) -= imag * here->
TRAimped
;
62
*(here->
TRApos2Int2Ptr
) -= here->
TRAconduct
;
63
*(here->
TRAint2Pos2Ptr
) -= here->
TRAconduct
;
64
65
}
66
}
67
return
(
OK
);
68
}
sTRAinstance::TRAibr1Neg1Ptr
double * TRAibr1Neg1Ptr
Definition:
tradefs.h:50
sTRAinstance::TRAnextInstance
struct sTRAinstance * TRAnextInstance
Definition:
tradefs.h:20
sTRAmodel::TRAinstances
TRAinstance * TRAinstances
Definition:
tradefs.h:89
sTRAinstance::TRAint1Pos1Ptr
double * TRAint1Pos1Ptr
Definition:
tradefs.h:60
sTRAmodel::TRAnextModel
struct sTRAmodel * TRAnextModel
Definition:
tradefs.h:87
sTRAinstance::TRAimped
double TRAimped
Definition:
tradefs.h:30
CKTcircuit
Definition:
cktdefs.h:62
sTRAinstance::TRApos2Pos2Ptr
double * TRApos2Pos2Ptr
Definition:
tradefs.h:69
sTRAinstance::TRAtd
double TRAtd
Definition:
tradefs.h:32
sTRAinstance::TRApos1Pos1Ptr
double * TRApos1Pos1Ptr
Definition:
tradefs.h:67
sTRAinstance::TRAint2Pos2Ptr
double * TRAint2Pos2Ptr
Definition:
tradefs.h:63
sTRAinstance::TRAint1Int1Ptr
double * TRAint1Int1Ptr
Definition:
tradefs.h:59
tradefs.h
TRAacLoad
int TRAacLoad(GENmodel *inModel, CKTcircuit *ckt)
Definition:
traacld.c:14
OK
#define OK
Definition:
iferrmsg.h:17
sTRAinstance::TRAibr2Ibr1Ptr
double * TRAibr2Ibr1Ptr
Definition:
tradefs.h:53
sTRAinstance::TRAibr2Neg2Ptr
double * TRAibr2Neg2Ptr
Definition:
tradefs.h:56
sperror.h
sTRAinstance
Definition:
tradefs.h:18
sTRAinstance::TRAibr1Pos2Ptr
double * TRAibr1Pos2Ptr
Definition:
tradefs.h:52
NULL
#define NULL
Definition:
spdefs.h:121
cos
double cos()
sTRAinstance::TRAibr2Pos1Ptr
double * TRAibr2Pos1Ptr
Definition:
tradefs.h:57
sTRAinstance::TRAibr1Ibr2Ptr
double * TRAibr1Ibr2Ptr
Definition:
tradefs.h:48
CKTcircuit::CKTomega
double CKTomega
Definition:
cktdefs.h:198
sin
double sin()
spice.h
sGENmodel
Definition:
gendefs.h:39
sTRAinstance::TRAibr1Int1Ptr
double * TRAibr1Int1Ptr
Definition:
tradefs.h:49
sTRAinstance::TRAibr2Neg1Ptr
double * TRAibr2Neg1Ptr
Definition:
tradefs.h:55
model
static char model[32]
Definition:
subckt.c:76
sTRAinstance::TRAneg1Ibr1Ptr
double * TRAneg1Ibr1Ptr
Definition:
tradefs.h:64
sTRAinstance::TRAconduct
double TRAconduct
Definition:
tradefs.h:31
sTRAinstance::TRAibr1Neg2Ptr
double * TRAibr1Neg2Ptr
Definition:
tradefs.h:51
sTRAinstance::TRAint2Ibr2Ptr
double * TRAint2Ibr2Ptr
Definition:
tradefs.h:61
sTRAmodel
Definition:
tradefs.h:85
sTRAinstance::TRApos1Int1Ptr
double * TRApos1Int1Ptr
Definition:
tradefs.h:66
sTRAinstance::TRAint2Int2Ptr
double * TRAint2Int2Ptr
Definition:
tradefs.h:62
sTRAinstance::TRAint1Ibr1Ptr
double * TRAint1Ibr1Ptr
Definition:
tradefs.h:58
sTRAinstance::TRAneg2Ibr2Ptr
double * TRAneg2Ibr2Ptr
Definition:
tradefs.h:65
sTRAinstance::TRApos2Int2Ptr
double * TRApos2Int2Ptr
Definition:
tradefs.h:68
sTRAinstance::TRAibr2Int2Ptr
double * TRAibr2Int2Ptr
Definition:
tradefs.h:54
src
lib
dev
tra
traacld.c
Generated by
1.8.11