File tree Expand file tree Collapse file tree 5 files changed +10
-0
lines changed Expand file tree Collapse file tree 5 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -184,6 +184,7 @@ struct ODESystem <: AbstractODESystem
184
184
discrete_subsystems = nothing , solved_unknowns = nothing ,
185
185
split_idxs = nothing , parent = nothing ; checks:: Union{Bool, Int} = true )
186
186
if checks == true || (checks & CheckComponents) > 0
187
+ check_independent_variables ([iv])
187
188
check_variables (dvs, iv)
188
189
check_parameters (ps, iv)
189
190
check_equations (deqs, iv)
Original file line number Diff line number Diff line change @@ -137,6 +137,7 @@ struct SDESystem <: AbstractODESystem
137
137
complete = false , index_cache = nothing , parent = nothing ;
138
138
checks:: Union{Bool, Int} = true )
139
139
if checks == true || (checks & CheckComponents) > 0
140
+ check_independent_variables ([iv])
140
141
check_variables (dvs, iv)
141
142
check_parameters (ps, iv)
142
143
check_equations (deqs, iv)
Original file line number Diff line number Diff line change @@ -101,6 +101,7 @@ struct DiscreteSystem <: AbstractTimeDependentSystem
101
101
complete = false , index_cache = nothing , parent = nothing ;
102
102
checks:: Union{Bool, Int} = true )
103
103
if checks == true || (checks & CheckComponents) > 0
104
+ check_independent_variables ([iv])
104
105
check_variables (dvs, iv)
105
106
check_parameters (ps, iv)
106
107
end
Original file line number Diff line number Diff line change @@ -118,6 +118,7 @@ struct JumpSystem{U <: ArrayPartition} <: AbstractTimeDependentSystem
118
118
complete = false , index_cache = nothing ;
119
119
checks:: Union{Bool, Int} = true ) where {U <: ArrayPartition }
120
120
if checks == true || (checks & CheckComponents) > 0
121
+ check_independent_variables ([iv])
121
122
check_variables (unknowns, iv)
122
123
check_parameters (ps, iv)
123
124
end
Original file line number Diff line number Diff line change @@ -102,6 +102,12 @@ const CheckAll = 1 << 0
102
102
const CheckComponents = 1 << 1
103
103
const CheckUnits = 1 << 2
104
104
105
+ function check_independent_variables (ivs)
106
+ for iv in ivs
107
+ isparameter (iv) || throw (ArgumentError (" Independent variable $iv is not a parameter." ))
108
+ end
109
+ end
110
+
105
111
function check_parameters (ps, iv)
106
112
for p in ps
107
113
isequal (iv, p) &&
You can’t perform that action at this time.
0 commit comments