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
+12-3Lines changed: 12 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -222,7 +222,8 @@ function collect_ivs_from_nested_operator!(ivs, x, target_op)
222
222
end
223
223
224
224
functioniv_from_nested_derivative(x, op = Differential)
225
-
ifiscall(x) &&operation(x) == getindex
225
+
ifiscall(x) &&
226
+
(operation(x) == getindex ||operation(x) == real ||operation(x) == imag)
226
227
iv_from_nested_derivative(arguments(x)[1], op)
227
228
elseifiscall(x)
228
229
operation(x) isa op ?iv_from_nested_derivative(arguments(x)[1], op) :
@@ -1216,6 +1217,7 @@ end
1216
1217
Find all the unknowns and parameters from the equations of a SDESystem or ODESystem. Return re-ordered equations, differential variables, all variables, and parameters.
1217
1218
"""
1218
1219
functionprocess_equations(eqs, iv)
1220
+
eltype(eqs) <:Vector&& (eqs =vcat(eqs...))
1219
1221
eqs =collect(eqs)
1220
1222
1221
1223
diffvars =OrderedSet()
@@ -1249,8 +1251,8 @@ function process_equations(eqs, iv)
1249
1251
throw(ArgumentError("An ODESystem can only have one independent variable."))
1250
1252
diffvar in diffvars &&
1251
1253
throw(ArgumentError("The differential variable $diffvar is not unique in the system of equations."))
1252
-
!(symtype(diffvar) === Real ||eltype(symtype(diffvar)) === Real) &&
1253
-
throw(ArgumentError("Differential variable $diffvar has type $(symtype(diffvar)). Differential variables should not be concretely typed."))
1254
+
!has_diffvar_type(diffvar) &&
1255
+
throw(ArgumentError("Differential variable $diffvar has type $(symtype(diffvar)). Differential variables should be of a continuous, non-concrete number type: Real, Complex, AbstractFloat, or Number."))
1254
1256
push!(diffvars, diffvar)
1255
1257
end
1256
1258
push!(diffeq, eq)
@@ -1262,6 +1264,13 @@ function process_equations(eqs, iv)
0 commit comments