forked from OpenModelica/OpenModelicaLibraryTesting
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCauerLowPassAnalog.bmo
More file actions
177 lines (177 loc) · 13.2 KB
/
CauerLowPassAnalog.bmo
File metadata and controls
177 lines (177 loc) · 13.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
//! base 0.1.0
package 'CauerLowPassAnalog'
model 'CauerLowPassAnalog' "Cauer low pass filter with analog components"
parameter Real 'l1'(unit = "H", quantity = "Inductance") = 1.304 "Filter coefficient I1";
parameter Real 'l2'(unit = "H", quantity = "Inductance") = 0.8586 "Filter coefficient I2";
parameter Real 'c1'(min = 0.0, unit = "F", quantity = "Capacitance") = 1.072 "Filter coefficient c1";
parameter Real 'c2'(min = 0.0, unit = "F", quantity = "Capacitance") = 1.0 / (2.906997720064 * 'l1') "Filter coefficient c2";
parameter Real 'c3'(min = 0.0, unit = "F", quantity = "Capacitance") = 1.682 "Filter coefficient c3";
parameter Real 'c4'(min = 0.0, unit = "F", quantity = "Capacitance") = 1.0 / (1.392270203025 * 'l2') "Filter coefficient c4";
parameter Real 'c5'(min = 0.0, unit = "F", quantity = "Capacitance") = 0.7262 "Filter coefficient c5";
Real 'G.p.v'(unit = "V", quantity = "ElectricPotential") "Potential at the pin";
Real 'G.p.i'(unit = "A", quantity = "ElectricCurrent") "Current flowing into the pin";
Real 'C1.v'(fixed = true, start = 0.0, unit = "V", quantity = "ElectricPotential") "Voltage drop of the two pins (= p.v - n.v)";
Real 'C1.p.v'(unit = "V", quantity = "ElectricPotential") "Potential at the pin";
Real 'C1.p.i'(unit = "A", quantity = "ElectricCurrent") "Current flowing into the pin";
Real 'C1.n.v'(unit = "V", quantity = "ElectricPotential") "Potential at the pin";
Real 'C1.n.i'(unit = "A", quantity = "ElectricCurrent") "Current flowing into the pin";
Real 'C1.i'(unit = "A", quantity = "ElectricCurrent") "Current flowing from pin p to pin n";
parameter Real 'C1.C'(start = 1.0, min = 0.0, unit = "F", quantity = "Capacitance") = 'c1' "Capacitance";
Real 'C2.v'(start = 0.0, unit = "V", quantity = "ElectricPotential") "Voltage drop of the two pins (= p.v - n.v)";
Real 'C2.p.v'(unit = "V", quantity = "ElectricPotential") "Potential at the pin";
Real 'C2.p.i'(unit = "A", quantity = "ElectricCurrent") "Current flowing into the pin";
Real 'C2.n.v'(unit = "V", quantity = "ElectricPotential") "Potential at the pin";
Real 'C2.n.i'(unit = "A", quantity = "ElectricCurrent") "Current flowing into the pin";
Real 'C2.i'(unit = "A", quantity = "ElectricCurrent") "Current flowing from pin p to pin n";
parameter Real 'C2.C'(start = 1.0, min = 0.0, unit = "F", quantity = "Capacitance") = 'c2' "Capacitance";
Real 'C3.v'(fixed = true, start = 0.0, unit = "V", quantity = "ElectricPotential") "Voltage drop of the two pins (= p.v - n.v)";
Real 'C3.p.v'(unit = "V", quantity = "ElectricPotential") "Potential at the pin";
Real 'C3.p.i'(unit = "A", quantity = "ElectricCurrent") "Current flowing into the pin";
Real 'C3.n.v'(unit = "V", quantity = "ElectricPotential") "Potential at the pin";
Real 'C3.n.i'(unit = "A", quantity = "ElectricCurrent") "Current flowing into the pin";
Real 'C3.i'(unit = "A", quantity = "ElectricCurrent") "Current flowing from pin p to pin n";
parameter Real 'C3.C'(start = 1.0, min = 0.0, unit = "F", quantity = "Capacitance") = 'c3' "Capacitance";
Real 'C4.v'(start = 0.0, unit = "V", quantity = "ElectricPotential") "Voltage drop of the two pins (= p.v - n.v)";
Real 'C4.p.v'(unit = "V", quantity = "ElectricPotential") "Potential at the pin";
Real 'C4.p.i'(unit = "A", quantity = "ElectricCurrent") "Current flowing into the pin";
Real 'C4.n.v'(unit = "V", quantity = "ElectricPotential") "Potential at the pin";
Real 'C4.n.i'(unit = "A", quantity = "ElectricCurrent") "Current flowing into the pin";
Real 'C4.i'(unit = "A", quantity = "ElectricCurrent") "Current flowing from pin p to pin n";
parameter Real 'C4.C'(start = 1.0, min = 0.0, unit = "F", quantity = "Capacitance") = 'c4' "Capacitance";
Real 'C5.v'(fixed = true, start = 0.0, unit = "V", quantity = "ElectricPotential") "Voltage drop of the two pins (= p.v - n.v)";
Real 'C5.p.v'(unit = "V", quantity = "ElectricPotential") "Potential at the pin";
Real 'C5.p.i'(unit = "A", quantity = "ElectricCurrent") "Current flowing into the pin";
Real 'C5.n.v'(unit = "V", quantity = "ElectricPotential") "Potential at the pin";
Real 'C5.n.i'(unit = "A", quantity = "ElectricCurrent") "Current flowing into the pin";
Real 'C5.i'(unit = "A", quantity = "ElectricCurrent") "Current flowing from pin p to pin n";
parameter Real 'C5.C'(start = 1.0, min = 0.0, unit = "F", quantity = "Capacitance") = 'c5' "Capacitance";
Real 'L1.v'(unit = "V", quantity = "ElectricPotential") "Voltage drop of the two pins (= p.v - n.v)";
Real 'L1.p.v'(unit = "V", quantity = "ElectricPotential") "Potential at the pin";
Real 'L1.p.i'(unit = "A", quantity = "ElectricCurrent") "Current flowing into the pin";
Real 'L1.n.v'(unit = "V", quantity = "ElectricPotential") "Potential at the pin";
Real 'L1.n.i'(unit = "A", quantity = "ElectricCurrent") "Current flowing into the pin";
Real 'L1.i'(fixed = true, start = 0.0, unit = "A", quantity = "ElectricCurrent") "Current flowing from pin p to pin n";
parameter Real 'L1.L'(start = 1.0, unit = "H", quantity = "Inductance") = 'l1' "Inductance";
Real 'L2.v'(unit = "V", quantity = "ElectricPotential") "Voltage drop of the two pins (= p.v - n.v)";
Real 'L2.p.v'(unit = "V", quantity = "ElectricPotential") "Potential at the pin";
Real 'L2.p.i'(unit = "A", quantity = "ElectricCurrent") "Current flowing into the pin";
Real 'L2.n.v'(unit = "V", quantity = "ElectricPotential") "Potential at the pin";
Real 'L2.n.i'(unit = "A", quantity = "ElectricCurrent") "Current flowing into the pin";
Real 'L2.i'(fixed = true, start = 0.0, unit = "A", quantity = "ElectricCurrent") "Current flowing from pin p to pin n";
parameter Real 'L2.L'(start = 1.0, unit = "H", quantity = "Inductance") = 'l2' "Inductance";
parameter Real 'R1.R'(start = 1.0, unit = "Ohm", quantity = "Resistance") = 1.0 "Resistance at temperature T_ref";
parameter Real 'R1.T_ref'(nominal = 300.0, start = 288.15, min = 0.0, displayUnit = "degC", unit = "K", quantity = "ThermodynamicTemperature") = 300.15 "Reference temperature";
parameter Real 'R1.alpha'(unit = "1/K", quantity = "LinearTemperatureCoefficient") = 0.0 "Temperature coefficient of resistance (R_actual = R*(1 + alpha*(T_heatPort - T_ref))";
Real 'R1.v'(unit = "V", quantity = "ElectricPotential") "Voltage drop of the two pins (= p.v - n.v)";
Real 'R1.p.v'(unit = "V", quantity = "ElectricPotential") "Potential at the pin";
Real 'R1.p.i'(unit = "A", quantity = "ElectricCurrent") "Current flowing into the pin";
Real 'R1.n.v'(unit = "V", quantity = "ElectricPotential") "Potential at the pin";
Real 'R1.n.i'(unit = "A", quantity = "ElectricCurrent") "Current flowing into the pin";
Real 'R1.i'(unit = "A", quantity = "ElectricCurrent") "Current flowing from pin p to pin n";
parameter Boolean 'R1.useHeatPort' = false "= true, if heatPort is enabled" annotation(Evaluate = true);
parameter Real 'R1.T'(nominal = 300.0, start = 288.15, min = 0.0, displayUnit = "degC", unit = "K", quantity = "ThermodynamicTemperature") = 'R1.T_ref' "Fixed device temperature if useHeatPort = false";
Real 'R1.LossPower'(unit = "W", quantity = "Power") "Loss power leaving component via heatPort";
Real 'R1.T_heatPort'(nominal = 300.0, start = 288.15, min = 0.0, displayUnit = "degC", unit = "K", quantity = "ThermodynamicTemperature") "Temperature of heatPort";
Real 'R1.R_actual'(unit = "Ohm", quantity = "Resistance") "Actual resistance = R*(1 + alpha*(T_heatPort - T_ref))";
parameter Real 'R2.R'(start = 1.0, unit = "Ohm", quantity = "Resistance") = 1.0 "Resistance at temperature T_ref";
parameter Real 'R2.T_ref'(nominal = 300.0, start = 288.15, min = 0.0, displayUnit = "degC", unit = "K", quantity = "ThermodynamicTemperature") = 300.15 "Reference temperature";
parameter Real 'R2.alpha'(unit = "1/K", quantity = "LinearTemperatureCoefficient") = 0.0 "Temperature coefficient of resistance (R_actual = R*(1 + alpha*(T_heatPort - T_ref))";
Real 'R2.v'(unit = "V", quantity = "ElectricPotential") "Voltage drop of the two pins (= p.v - n.v)";
Real 'R2.p.v'(unit = "V", quantity = "ElectricPotential") "Potential at the pin";
Real 'R2.p.i'(unit = "A", quantity = "ElectricCurrent") "Current flowing into the pin";
Real 'R2.n.v'(unit = "V", quantity = "ElectricPotential") "Potential at the pin";
Real 'R2.n.i'(unit = "A", quantity = "ElectricCurrent") "Current flowing into the pin";
Real 'R2.i'(unit = "A", quantity = "ElectricCurrent") "Current flowing from pin p to pin n";
parameter Boolean 'R2.useHeatPort' = false "= true, if heatPort is enabled" annotation(Evaluate = true);
parameter Real 'R2.T'(nominal = 300.0, start = 288.15, min = 0.0, displayUnit = "degC", unit = "K", quantity = "ThermodynamicTemperature") = 'R2.T_ref' "Fixed device temperature if useHeatPort = false";
Real 'R2.LossPower'(unit = "W", quantity = "Power") "Loss power leaving component via heatPort";
Real 'R2.T_heatPort'(nominal = 300.0, start = 288.15, min = 0.0, displayUnit = "degC", unit = "K", quantity = "ThermodynamicTemperature") "Temperature of heatPort";
Real 'R2.R_actual'(unit = "Ohm", quantity = "Resistance") "Actual resistance = R*(1 + alpha*(T_heatPort - T_ref))";
parameter Real 'V.V'(start = 1.0, unit = "V", quantity = "ElectricPotential") = 1.0 "Height of step";
Real 'V.v'(unit = "V", quantity = "ElectricPotential") "Voltage drop of the two pins (= p.v - n.v)";
Real 'V.p.v'(unit = "V", quantity = "ElectricPotential") "Potential at the pin";
Real 'V.p.i'(unit = "A", quantity = "ElectricCurrent") "Current flowing into the pin";
Real 'V.n.v'(unit = "V", quantity = "ElectricPotential") "Potential at the pin";
Real 'V.n.i'(unit = "A", quantity = "ElectricCurrent") "Current flowing into the pin";
Real 'V.i'(unit = "A", quantity = "ElectricCurrent") "Current flowing from pin p to pin n";
parameter Real 'V.signalSource.height' = 'V.V' "Height of step";
Real 'V.signalSource.y' "Connector of Real output signal";
parameter Real 'V.signalSource.offset' = 'V.offset' "Offset of output signal y";
parameter Real 'V.signalSource.startTime'(unit = "s", quantity = "Time") = 'V.startTime' "Output y = offset for time < startTime";
parameter Real 'V.offset'(unit = "V", quantity = "ElectricPotential") = 0.0 "Voltage offset";
parameter Real 'V.startTime'(unit = "s", quantity = "Time") = 1.0 "Time offset";
equation
'L1.p.v' = 'C1.p.v';
'L1.p.v' = 'C2.p.v';
'L1.p.v' = 'R1.n.v';
'C2.n.v' = 'L2.p.v';
'C2.n.v' = 'C4.p.v';
'C2.n.v' = 'C3.p.v';
'C2.n.v' = 'L1.n.v';
'C4.n.v' = 'R2.p.v';
'C4.n.v' = 'C5.p.v';
'C4.n.v' = 'L2.n.v';
'V.n.v' = 'G.p.v';
'V.n.v' = 'R2.n.v';
'V.n.v' = 'C1.n.v';
'V.n.v' = 'C5.n.v';
'V.n.v' = 'C3.n.v';
'R1.p.v' = 'V.p.v';
'V.n.i' + 'R2.n.i' + 'C5.n.i' + 'C3.n.i' + 'C1.n.i' + 'G.p.i' = 0.0;
'L2.p.i' + 'L1.n.i' + 'C4.p.i' + 'C3.p.i' + 'C2.n.i' = 0.0;
'R2.p.i' + 'L2.n.i' + 'C5.p.i' + 'C4.n.i' = 0.0;
'V.p.i' + 'R1.p.i' = 0.0;
'R1.n.i' + 'L1.p.i' + 'C2.p.i' + 'C1.p.i' = 0.0;
'G.p.v' = 0.0;
'C1.i' = 'C1.C' * der('C1.v');
0.0 = 'C1.p.i' + 'C1.n.i';
'C1.i' = 'C1.p.i';
'C1.v' = 'C1.p.v' - 'C1.n.v';
'C2.i' = 'C2.C' * der('C2.v');
0.0 = 'C2.p.i' + 'C2.n.i';
'C2.i' = 'C2.p.i';
'C2.v' = 'C2.p.v' - 'C2.n.v';
'C3.i' = 'C3.C' * der('C3.v');
0.0 = 'C3.p.i' + 'C3.n.i';
'C3.i' = 'C3.p.i';
'C3.v' = 'C3.p.v' - 'C3.n.v';
'C4.i' = 'C4.C' * der('C4.v');
0.0 = 'C4.p.i' + 'C4.n.i';
'C4.i' = 'C4.p.i';
'C4.v' = 'C4.p.v' - 'C4.n.v';
'C5.i' = 'C5.C' * der('C5.v');
0.0 = 'C5.p.i' + 'C5.n.i';
'C5.i' = 'C5.p.i';
'C5.v' = 'C5.p.v' - 'C5.n.v';
'L1.L' * der('L1.i') = 'L1.v';
0.0 = 'L1.p.i' + 'L1.n.i';
'L1.i' = 'L1.p.i';
'L1.v' = 'L1.p.v' - 'L1.n.v';
'L2.L' * der('L2.i') = 'L2.v';
0.0 = 'L2.p.i' + 'L2.n.i';
'L2.i' = 'L2.p.i';
'L2.v' = 'L2.p.v' - 'L2.n.v';
assert(1.0 + 'R1.alpha' * ('R1.T_heatPort' - 'R1.T_ref') >= 2.220446049250313e-16, "Temperature outside scope of model!", AssertionLevel.error);
'R1.R_actual' = 'R1.R' * (1.0 + 'R1.alpha' * ('R1.T_heatPort' - 'R1.T_ref'));
'R1.v' = 'R1.R_actual' * 'R1.i';
'R1.LossPower' = 'R1.v' * 'R1.i';
'R1.T_heatPort' = 'R1.T';
0.0 = 'R1.p.i' + 'R1.n.i';
'R1.i' = 'R1.p.i';
'R1.v' = 'R1.p.v' - 'R1.n.v';
assert(1.0 + 'R2.alpha' * ('R2.T_heatPort' - 'R2.T_ref') >= 2.220446049250313e-16, "Temperature outside scope of model!", AssertionLevel.error);
'R2.R_actual' = 'R2.R' * (1.0 + 'R2.alpha' * ('R2.T_heatPort' - 'R2.T_ref'));
'R2.v' = 'R2.R_actual' * 'R2.i';
'R2.LossPower' = 'R2.v' * 'R2.i';
'R2.T_heatPort' = 'R2.T';
0.0 = 'R2.p.i' + 'R2.n.i';
'R2.i' = 'R2.p.i';
'R2.v' = 'R2.p.v' - 'R2.n.v';
'V.signalSource.y' = 'V.signalSource.offset' + (if time < 'V.signalSource.startTime' then 0.0 else 'V.signalSource.height');
'V.v' = 'V.signalSource.y';
0.0 = 'V.p.i' + 'V.n.i';
'V.i' = 'V.p.i';
'V.v' = 'V.p.v' - 'V.n.v';
annotation(experiment(StopTime = 60));
end 'CauerLowPassAnalog';
end 'CauerLowPassAnalog';