-
-
Notifications
You must be signed in to change notification settings - Fork 234
Closed
SciML/SciMLBase.jl
#906Labels
bugSomething isn't workingSomething isn't working
Description
We previously had problems that conservation law parameters had he wrong value after remake. However, now it seems remake fails when there are involved entirely:
using Catalyst, OrdinaryDiffEqDefault
# Create model.
rs = @reaction_network begin
@parameters Y0
@species Y(t) = Y0
(p,d), 0 <--> Y
(k1,k2), X1 <--> X2
end
osys = complete(convert(ODESystem, rs; remove_conserved = true))
# Create initial `ODEProblem`.
u0 = [osys.X1 => 1.0, osys.X2 => 2.0]
ps = [osys.p => 10.0, osys.d => 5.0, osys.Y0 => 3.0, osys.k1 => 1.0, osys.k2 => 2.0]
oprob = ODEProblem(osys, u0, (0.0, 1.0), ps)
# Try `remake`.
u0_new = [osys.X1 => 0.1]
ps_new = [osys.Y0 => 0.3, osys.p => 100.0]
oprob_new = remake(oprob; u0 = u0_new, p = ps_new) # ERROR: TypeError: in validate_parameter_type, in Parameter Γ[1], expected Real, got a value of type SymbolicUtils.BasicSymbolic{Real}
# Check the types of all 6 parameters (5 declared, plus the conservation law one)
for param in parameters(osys)
println(typeof(param)) # all are `SymbolicUtils.BasicSymbolic{Real}`
endAs a bonus, for some reason, providing an empty u0 in these cases fail (normally work):
oprob_new = remake(oprob; u0 = [], p = ps_new) # ERROR: BoundsError: attempt to access 0-element Vector{Any} at index [1]@AayushSabharwal Do you have any idea what might be going on?
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working