Skip to content

Commit 29c15c7

Browse files
adds missing connection
1 parent bdc2aef commit 29c15c7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Electrical/Analog/ideal_components.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ function HeatingResistor(; name, R_ref = 1.0, T_ref = 300.15, alpha = 0)
186186
T_ref = T_ref
187187
alpha = alpha
188188
end
189-
@variables R(t)
189+
@variables R(t) = R_ref
190190
eqs = [R ~ R_ref * (1 + alpha * (heat_port.T - T_ref))
191191
heat_port.Q_flow ~ -v * i # -LossPower
192192
v ~ i * R]

test/multi_domain.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ end
193193
@named env = FixedTemperature(T = 273.15 + 20)
194194
connections = [connect(source.n, ground.g, heating_resistor.n)
195195
connect(source.p, heating_resistor.p)
196+
connect(voltage_sine.output, source.V)
196197
connect(heating_resistor.heat_port, thermal_conductor.port_a)
197198
connect(thermal_conductor.port_b, env.port)]
198199

@@ -207,7 +208,8 @@ end
207208
])
208209
sys = structural_simplify(model)
209210

210-
prob = ODAEProblem(sys, Pair[], (0, 6.0))
211+
prob = ODEProblem(sys, Pair[], (0, 6.0))
211212
sol = solve(prob, Rodas4())
212213
@test sol.retcode == :Success
214+
@test sol[source.v * source.i] == -sol[env.port.Q_flow]
213215
end

0 commit comments

Comments
 (0)