Skip to content

Commit 63e9383

Browse files
fix: partially fix observed generation for discrete-time (sub)systems
1 parent 3ac5867 commit 63e9383

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/systems/diffeqs/odesystem.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ function build_explicit_observed_function(sys, ts;
378378
checkbounds = true,
379379
drop_expr = drop_expr,
380380
ps = full_parameters(sys),
381-
op = Differential,
381+
op = Operator,
382382
throw = true)
383383
if (isscalar = !(ts isa AbstractVector))
384384
ts = [ts]

test/clock.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,3 +503,5 @@ prob = ODEProblem(model, [], (0.0, 10.0))
503503
sol = solve(prob, Tsit5(), kwargshandle = KeywordArgSilent)
504504

505505
@test sol.prob.kwargs[:disc_saved_values][1].t == sol.t[1:2:end] # Test that the discrete-tiem system executed at every step of the continuous solver. The solver saves each time step twice, one state value before discrete affect and one after.
506+
@test_nowarn ModelingToolkit.build_explicit_observed_function(
507+
model, model.counter.ud(k - 1))(sol.u[1], prob.p..., sol.t[1])

0 commit comments

Comments
 (0)