@@ -262,9 +262,11 @@ function IndexCache(sys::AbstractSystem)
262
262
sym = eq. lhs
263
263
vs = vars (eq. rhs)
264
264
timeseries = TimeseriesSetType ()
265
- for v in vs
266
- if (idx = get (disc_idxs, v, nothing )) != = nothing
267
- push! (timeseries, idx. clock_idx)
265
+ if is_time_dependent (sys)
266
+ for v in vs
267
+ if (idx = get (disc_idxs, v, nothing )) != = nothing
268
+ push! (timeseries, idx. clock_idx)
269
+ end
268
270
end
269
271
end
270
272
ttsym = default_toterm (sym)
@@ -284,11 +286,20 @@ function IndexCache(sys::AbstractSystem)
284
286
sym = eq. lhs
285
287
vs = vars (eq. rhs)
286
288
timeseries = TimeseriesSetType ()
287
- for v in vs
288
- if (idx = get (disc_idxs, v, nothing )) != = nothing
289
- push! (timeseries, idx. clock_idx)
290
- elseif haskey (unk_idxs, v) || haskey (observed_syms_to_timeseries, v)
291
- push! (timeseries, ContinuousTimeseries ())
289
+ if is_time_dependent (sys)
290
+ for v in vs
291
+ if (idx = get (disc_idxs, v, nothing )) != = nothing
292
+ push! (timeseries, idx. clock_idx)
293
+ elseif haskey (unk_idxs, v)
294
+ push! (timeseries, ContinuousTimeseries ())
295
+ elseif haskey (observed_syms_to_timeseries, v)
296
+ union! (timeseries, observed_syms_to_timeseries[v])
297
+ elseif haskey (dependent_pars_to_timeseries, v)
298
+ union! (timeseries, dependent_pars_to_timeseries[v])
299
+ elseif iscall (v) && issym (operation (v)) &&
300
+ is_variable (sys, operation (v)(get_iv (sys)))
301
+ push! (timeseries, ContinuousTimeseries ())
302
+ end
292
303
end
293
304
end
294
305
ttsym = default_toterm (sym)
0 commit comments