@@ -19,11 +19,10 @@ voltage source is modelled with an inner resistor):
19
19
20
20
### 1.1 Bi-Partite Graph
21
21
22
- After simple equations have been removed, this circuit can be
23
- described with 6 equations. The structure of the equations is
24
- displayed in the next figure:
22
+ In a first step, the structural information of the low pass filter model is provided as incidence matrix
23
+
24
+ ![ Incidence Matrix of Low Pass Filter ] ( ../resources/images/LowPassFilter_IncidenceMatrix.png )
25
25
26
- ![ Incidence Matrix of Low Pass Filter] ( ../resources/images/LowPassFilterReduced_IncidenceMatrix.png )
27
26
28
27
- Every ** column** corresponds to one time-varying ** variable** .
29
28
Parameters, so variables with constant values, are not shown.
@@ -37,36 +36,92 @@ displayed in the next figure:
37
36
38
37
The matrix above is called the ** incidence matrix** or the
39
38
** bi-partite graph** of the circuit. In ModiaBase, this matrix is represented
40
- as vector ` G ` of integer vectors:
39
+ as vector ` G ` of Integer vectors:
41
40
42
41
``` julia
43
42
# Bi-partite graph of low pass filter
44
- G = [ [1 ,2 ,4 ], # equation 1 depends on variables 1,2,4
45
- [1 ,7 ],
46
- [3 ,4 ],
47
- [3 ,7 ],
48
- [6 ,7 ],
49
- [2 ] ]
43
+ G = [ [25 ,27 ], # equation 1 depends on variables 25,27
44
+ [6 ,23 ],
45
+ [4 ,10 ],
46
+ ... ,
47
+ [27 ] ]
50
48
```
51
49
52
- This can be also made more explicit (and a bit more efficient storage
53
- by defining the incidence matrix as):
54
-
50
+ This can be also made more explicit (and a bit more efficient storage)
51
+ by defining the incidence matrix as:
55
52
56
53
``` julia
57
54
# Bi-partite graph of low pass filter
55
+ G = Vector{Int}[ [25 ,27 ], # equation 1 depends on variables 25,27
56
+ [6 ,23 ],
57
+ [4 ,10 ],
58
+ ... ,
59
+ [27 ] ]
60
+ ```
61
+
62
+ ### 1.2 Linear Integer Equations
63
+
64
+ Object-oriented models consist of a lot of linear Integer equations, especially due to the connect-statements.
65
+ The linear integer equations of ` G ` are identified and the corresponding linear factors
66
+ are determined. With function [ ` simplifyLinearIntegerEquations! ` ] ( @ref ) this information is used to simplify
67
+ the equations by transforming the linear Integer equations with a fraction-free (exact) Gaussian elimination to
68
+ a special normalized form and then perform the following simplifications:
69
+
70
+ - Equations of the form ` v = 0 ` are removed and ` v ` is replaced by „0“ at all places where
71
+ ` v ` occurs, and these equations are simplified.
72
+
73
+ - Equations of the form ` v1 = v2 ` and ` v1 = -v2 ` are removed, ` v1 ` is replaced by ` v2 ` (or ` -v2 ` )
74
+ at all places where ` v1 ` occurs (so called * alias-variables* ), and these equations are simplified.
75
+
76
+ - * Redundant equations* are removed.
77
+
78
+ - Variables that appear * only* in the linear Integer equations (and in no other equations) are set to zero, if
79
+ they can be * arbitrarily selected* . For example, if an electrical circuit is not
80
+ grounded, then one of the electrical potentials is arbitrarily set to zero.
81
+
82
+ - State constraints are made structurally visible.
83
+
84
+ After applying [ ` simplifyLinearIntegerEquations! ` ] ( @ref ) to the low pass filter circuit,
85
+ the incidence matrix is simplified to
86
+
87
+ ![ Incidence Matrix of Low Pass Filter] ( ../resources/images/LowPassFilterReduced_IncidenceMatrix.png )
88
+
89
+ ``` julia
90
+ # Bi-partite graph of simplified low pass filter
58
91
G = Vector{Int}[ [1 ,2 ,4 ],
59
92
[1 ,7 ],
60
93
[3 ,4 ],
61
94
[3 ,7 ],
62
95
[6 ,7 ],
63
96
[2 ] ]
97
+
98
+ # Eliminated variables
99
+ R. i = - (V. p. i)
100
+ ground. p. v = 0
101
+ R. p. i = - (V. p. i)
102
+ R. n. v = C. v
103
+ V. n. i = - (V. p. i)
104
+ V. n. v = 0
105
+ V. p. v = Ri. n. v
106
+ Ri. p. i = V. p. i
107
+ C. n. v = 0
108
+ C. p. v = C. v
109
+ Ri. p. v = R. p. v
110
+ C. n. i = V. p. i
111
+ V. i = V. p. i
112
+ R. n. i = V. p. i
113
+ C. p. i = - (V. p. i)
114
+ ground. p. i = 0
115
+ C. i = - (V. p. i)
116
+ Ri. i = V. p. i
117
+ V. v = Ri. n. v
118
+ Ri. n. i = - (V. p. i)
64
119
```
65
120
66
121
67
- ### 1.2 Assignment
122
+ ### 1.3 Assignment
68
123
69
- In a first step, an assignment is made (also called matching), to associate
124
+ In a follow-up step, an assignment is made (also called matching), to associate
70
125
one variable uniquely with one equation:
71
126
72
127
![ Matched IIncidence Matrix of Low Pass Filter] ( ../resources/images/LowPassFilterReduced_Matching.png )
@@ -75,7 +130,7 @@ one variable uniquely with one equation:
75
130
- * Blue* marks show if a variable is part of the respective equation
76
131
77
132
The assignment is computed with function [ ` ModiaBase.matching ` ] ( @ref )
78
- returning a vector ** assign** :
133
+ returning a vector ` assign ` :
79
134
80
135
``` julia
81
136
using ModiaBase
@@ -94,9 +149,9 @@ The meaning of vector `assign` is that
94
149
- etc.
95
150
96
151
97
- ### 1.3 Block Lower Triangular transformation
152
+ ### 1.4 Block Lower Triangular transformation
98
153
99
- In a second step, equations are sorted and algebraic loops determined:
154
+ In a follow-up step, equations are sorted and algebraic loops determined:
100
155
101
156
![ Incidence Matrix of sorted equations of Low Pass Filter] ( ../resources/images/LowPassFilterReduced_BLT.png )
102
157
@@ -112,8 +167,8 @@ blt = BLT(G, assign)
112
167
113
168
#=
114
169
blt = [ [6],
115
- [3,4,2,1],
116
- [5] ]
170
+ [3,4,2,1],
171
+ [5] ]
117
172
=#
118
173
```
119
174
0 commit comments