Skip to content

Commit af15bcb

Browse files
author
dd
committed
cosmetic changes
1 parent ab09ad0 commit af15bcb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/funcaffect.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ prob = ODEProblem(sys, u0, (0, 10.0))
9999
sol = solve(prob, Rodas4())
100100
@test all(sol[rc_model.capacitor.v] .< 0.4)
101101

102+
# hierarchical - result should be identical
103+
102104
function affect6!(integ, u,p,ctx)
103105
@test integ.u[u.v] 0.3
104106
integ.p[p.C] *= 200
@@ -115,8 +117,6 @@ function Capacitor2(; name, C = 1.0)
115117
extend(ODESystem(eqs, t, [], ps; name = name, continuous_events=[[v ~ 0.3]=>(affect6!, [v], [C], nothing)]), oneport)
116118
end
117119

118-
# hierarchical - result should be identical
119-
120120
@named capacitor2 = Capacitor2(C = C)
121121

122122
rc_eqs2 = [connect(source.p, resistor.p)
@@ -164,7 +164,7 @@ sol_ = solve(prob_,Tsit5(),callback=cb_)
164164

165165
# same - with MTK
166166
sts = @variables y(t), v(t)
167-
par = @parameters g
167+
par = @parameters g = 9.8
168168
bb_eqs = [
169169
D(y) ~ v
170170
D(v) ~ -g
@@ -177,7 +177,7 @@ end
177177
@named bb_model = ODESystem(bb_eqs, t, sts, par, continuous_events=[[y ~ 0] => (bb_affect!, [v], [], nothing)])
178178

179179
bb_sys = structural_simplify(bb_model)
180-
u0 = [v => 0.0, y => 50.0, g=>9.8]
180+
u0 = [v => 0.0, y => 50.0]
181181

182182
bb_prob = ODEProblem(bb_sys, u0, (0, 15.0))
183183
bb_sol = solve(bb_prob, Tsit5())

0 commit comments

Comments
 (0)