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/variables.jl
+24-5Lines changed: 24 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -111,12 +111,31 @@ end
111
111
"""
112
112
$(SIGNATURES)
113
113
114
-
Intercept the call to `handle_varmap` and convert it to an ordered list if the user has
115
-
ModelingToolkit loaded, and the problem has a symbolic origin.
114
+
Intercept the call to `process_p_u0_symbolic` and process symbolic maps of `p` and/or `u0` if the
115
+
user has `ModelingToolkit` loaded.
116
116
"""
117
-
function SciMLBase.handle_varmap(varmap, sys::AbstractSystem; field =:states, kwargs...)
118
-
out =varmap_to_vars(varmap, getfield(sys, field); kwargs...)
119
-
return out
117
+
function SciMLBase.process_p_u0_symbolic(prob::ODEProblem, p, u0)
118
+
# check if a symbolic remake is possible
119
+
ifeltype(p) <:Pair
120
+
hasproperty(prob.f, :sys) &&hasfield(typeof(prob.f.sys), :ps) ||throw(ArgumentError("This problem does not support symbolic maps with `remake`, i.e. it does not have a symbolic origin."*
121
+
" Please use `remake` with the `p` keyword argument as a vector of values, paying attention to parameter order."))
122
+
end
123
+
ifeltype(u0) <:Pair
124
+
hasproperty(prob.f, :sys) &&hasfield(typeof(prob.f.sys), :states) ||throw(ArgumentError("This problem does not support symbolic maps with `remake`, i.e. it does not have a symbolic origin."*
125
+
" Please use `remake` with the `u0` keyword argument as a vector of values, paying attention to state order."))
0 commit comments