Skip to content

Commit 84b66a7

Browse files
author
Brad Carman
committed
add observables test
1 parent 9998635 commit 84b66a7

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/split_parameters.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,23 @@ prob = ODEProblem(sys, [], tspan, []; tofloat = false)
7676
@test prob.p isa Tuple{Vector{Float64}, Vector{Int64}}
7777
sol = solve(prob, ImplicitEuler());
7878
@test sol.retcode == ReturnCode.Success
79+
80+
81+
82+
# ------------------------- Observables
83+
84+
@named c = Sine(; frequency = 1)
85+
@named absb = Abs(;)
86+
@named int = Integrator(; k = 1)
87+
@named model = ODESystem([
88+
connect(c.output, absb.input),
89+
connect(absb.output, int.input),
90+
],
91+
t,
92+
systems = [int, absb, c])
93+
sys = structural_simplify(model)
94+
prob = ODEProblem(sys, Pair[int.x => 0.0], (0.0, 1.0))
95+
sol = solve(prob, Rodas4())
96+
@test isequal(unbound_inputs(sys), [])
97+
@test sol.retcode == Success
98+
sol[absb.output.u]

0 commit comments

Comments
 (0)