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
184184 discrete_subsystems = nothing , solved_unknowns = nothing ,
185185 split_idxs = nothing , parent = nothing ; checks:: Union{Bool, Int} = true )
186186 if checks == true || (checks & CheckComponents) > 0
187+ check_independent_variables ([iv])
187188 check_variables (dvs, iv)
188189 check_parameters (ps, iv)
189190 check_equations (deqs, iv)
Original file line number Diff line number Diff line change @@ -137,6 +137,7 @@ struct SDESystem <: AbstractODESystem
137137 complete = false , index_cache = nothing , parent = nothing ;
138138 checks:: Union{Bool, Int} = true )
139139 if checks == true || (checks & CheckComponents) > 0
140+ check_independent_variables ([iv])
140141 check_variables (dvs, iv)
141142 check_parameters (ps, iv)
142143 check_equations (deqs, iv)
Original file line number Diff line number Diff line change @@ -101,6 +101,7 @@ struct DiscreteSystem <: AbstractTimeDependentSystem
101101 complete = false , index_cache = nothing , parent = nothing ;
102102 checks:: Union{Bool, Int} = true )
103103 if checks == true || (checks & CheckComponents) > 0
104+ check_independent_variables ([iv])
104105 check_variables (dvs, iv)
105106 check_parameters (ps, iv)
106107 end
Original file line number Diff line number Diff line change @@ -118,6 +118,7 @@ struct JumpSystem{U <: ArrayPartition} <: AbstractTimeDependentSystem
118118 complete = false , index_cache = nothing ;
119119 checks:: Union{Bool, Int} = true ) where {U <: ArrayPartition }
120120 if checks == true || (checks & CheckComponents) > 0
121+ check_independent_variables ([iv])
121122 check_variables (unknowns, iv)
122123 check_parameters (ps, iv)
123124 end
Original file line number Diff line number Diff line change @@ -102,6 +102,12 @@ const CheckAll = 1 << 0
102102const CheckComponents = 1 << 1
103103const CheckUnits = 1 << 2
104104
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+
105111function check_parameters (ps, iv)
106112 for p in ps
107113 isequal (iv, p) &&
You can’t perform that action at this time.
0 commit comments