Skip to content

Commit a9b7fa1

Browse files
committed
up
1 parent 0ad1f84 commit a9b7fa1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/systems/diffeqs/odesystem.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,8 @@ function ODESystem(eqs, iv; kwargs...)
329329
throw(ArgumentError("The differential variable $diffvar is not unique in the system of equations."))
330330
push!(diffvars, diffvar)
331331
end
332+
!(symtype(diffvar) === Real || eltype(symtype(var)) === Real) && throw(ArgumentError("Differential variable $var has type $(symtype(var)). Differential variables should not be concretely typed."))
333+
332334
push!(diffeq, eq)
333335
else
334336
push!(algeeq, eq)

src/utils.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,10 @@ function check_var_types(sys_type::Type{T}, dvs) where T <: AbstractSystem
161161
# elseif any(u -> (eltype(symtype(u)) !== eltype(symtype(dvs[1]))), dvs)
162162
# error("The element type of all the unknown variables in a system must all be the same.")
163163
if sys_type == ODESystem || sys_type == SDESystem || sys_type == PDESystem
164-
any(u -> !(symtype(u) == Real || eltype(symtype(u)) == Real), dvs) && error("The type of unknown variables for an SDESystem, PDESystem, or ODESystem should not be a concrete numeric type.")
164+
for var in dvs
165+
!(symtype(var) === Real || eltype(symtype(var)) === Real) && throw(ArgumentError("Differential variable $var has type $(symtype(var)). The type of unknown variables for an SDESystem, PDESystem, or ODESystem should be Real."))
166+
end
165167
end
166-
nothing
167168
end
168169

169170
function check_lhs(eq::Equation, op, dvs::Set)

0 commit comments

Comments
 (0)