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-4Lines changed: 12 additions & 4 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) :
@@ -1204,7 +1205,7 @@ end
1204
1205
Find all the unknowns and parameters from the equations of a SDESystem or ODESystem. Return re-ordered equations, differential variables, all variables, and parameters.
1205
1206
"""
1206
1207
functionprocess_equations(eqs, iv)
1207
-
eqs =collect(eqs)
1208
+
eqs =collect(Iterators.flatten(eqs))
1208
1209
1209
1210
diffvars =OrderedSet()
1210
1211
allunknowns =OrderedSet()
@@ -1237,8 +1238,8 @@ function process_equations(eqs, iv)
1237
1238
throw(ArgumentError("An ODESystem can only have one independent variable."))
1238
1239
diffvar in diffvars &&
1239
1240
throw(ArgumentError("The differential variable $diffvar is not unique in the system of equations."))
1240
-
!(symtype(diffvar) === Real ||eltype(symtype(diffvar)) === Real) &&
1241
-
throw(ArgumentError("Differential variable $diffvar has type $(symtype(diffvar)). Differential variables should not be concretely typed."))
1241
+
!has_diffvar_type(diffvar) &&
1242
+
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."))
1242
1243
push!(diffvars, diffvar)
1243
1244
end
1244
1245
push!(diffeq, eq)
@@ -1250,6 +1251,13 @@ function process_equations(eqs, iv)
0 commit comments