You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/utils.jl
+18-1Lines changed: 18 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -171,7 +171,7 @@ end
171
171
"""
172
172
check_equations(eqs, iv)
173
173
174
-
Assert that equations are well-formed when building ODE, i.e., only containing a single independent variable.
174
+
Assert that ODE equations are well-formed.
175
175
"""
176
176
functioncheck_equations(eqs, iv)
177
177
ivs =collect_ivs(eqs)
@@ -183,6 +183,17 @@ function check_equations(eqs, iv)
183
183
isequal(single_iv, iv) ||
184
184
throw(ArgumentError("Differential w.r.t. variable ($single_iv) other than the independent variable ($iv) are not allowed."))
185
185
end
186
+
187
+
for eq in eqs
188
+
vars, pars =collect_vars(eq, iv)
189
+
ifisempty(vars)
190
+
ifisempty(pars)
191
+
throw(ArgumentError("Equation $eq contains no variables or parameters."))
192
+
else
193
+
throw(ArgumentError("Equation $eq contains only parameters, but relationships between parameters should be specified with defaults or parameter_dependencies."))
194
+
end
195
+
end
196
+
end
186
197
end
187
198
"""
188
199
Get all the independent variables with respect to which differentials are taken.
@@ -439,6 +450,12 @@ function find_derivatives!(vars, expr, f)
0 commit comments