@@ -53,6 +53,66 @@ Return the index of the given parameter `sym` in `indp`, or `nothing` otherwise.
53
53
"""
54
54
parameter_index (indp, sym) = parameter_index (symbolic_container (indp), sym)
55
55
56
+ """
57
+ is_timeseries_parameter(indp, sym)
58
+
59
+ Check whether the given `sym` is a timeseries parameter in `indp`.
60
+ """
61
+ function is_timeseries_parameter (indp, sym)
62
+ if hasmethod (symbolic_container, Tuple{typeof (indp)})
63
+ is_timeseries_parameter (symbolic_container (indp), sym)
64
+ else
65
+ return false
66
+ end
67
+ end
68
+
69
+ """
70
+ struct ParameterTimeseriesIndex
71
+ function ParameterTimeseriesIndex(timeseries_idx, parameter_idx)
72
+
73
+ A struct storing the index of the timeseries of a timeseries parameter in a parameter
74
+ timeseries object. `timeseries_idx` refers to an index that identifies the timeseries
75
+ that the parameter belongs to. `parameter_idx` refers to the index of the parameter's
76
+ timeseries in that timeseries object. Note that `parameter_idx` may be different from
77
+ the object returned by [`parameter_index`](@ref) for a given parameter. The two fields in
78
+ this struct are `timeseries_idx` and `parameter_idx`.
79
+ """
80
+ struct ParameterTimeseriesIndex{T, I}
81
+ timeseries_idx:: T
82
+ parameter_idx:: I
83
+ end
84
+
85
+ """
86
+ timeseries_parameter_index(indp, sym)
87
+
88
+ Return the index of timeseries parameter `sym` in `indp`. Must return this index as a
89
+ [`ParameterTimeseriesIndex`](@ref) object. Return `nothing` if `sym` is not a timeseries
90
+ parameter in `indp`. Defaults to returning `nothing`. Respects the
91
+ [`symbolic_container`](@ref) fallback for `indp` if present.
92
+ """
93
+ function timeseries_parameter_index (indp, sym)
94
+ if hasmethod (symbolic_container, Tuple{typeof (indp)})
95
+ timeseries_parameter_index (symbolic_container (indp), sym)
96
+ else
97
+ return nothing
98
+ end
99
+ end
100
+
101
+ struct ParameterObservedFunction{I, F <: Function }
102
+ timeseries_idx:: I
103
+ observed_fn:: F
104
+ end
105
+
106
+ """
107
+ parameter_observed(indp, sym)
108
+
109
+ Return the observed function of `sym` in `indp`. The returned function must have the
110
+ signature `(p, t) -> [values...]` where `p` is the parameter object and `t` is the
111
+ current time. If `!is_time_dependent(indp)` then the returned function must have the
112
+ signature `(p) -> [values...]`.
113
+ """
114
+ parameter_observed (indp, sym) = parameter_observed (symbolic_container (indp), sym)
115
+
56
116
"""
57
117
parameter_symbols(indp)
58
118
@@ -88,7 +148,7 @@ is_observed(indp, sym) = is_observed(symbolic_container(indp), sym)
88
148
89
149
Return the observed function of the given `sym` in `indp`. The returned function should
90
150
have the signature `(u, p) -> [values...]` where `u` and `p` is the current state and
91
- parameter vector , respectively. If `istimedependent(indp) == true`, the function should
151
+ parameter object , respectively. If `istimedependent(indp) == true`, the function should
92
152
accept the current time `t` as its third parameter. If `constant_structure(indp) == false`,
93
153
`observed` accepts a third parameter, which can either be a vector of symbols indicating
94
154
the order of states or a time index, which identifies the order of states. This function
0 commit comments