Skip to content

Catalyst issue for remake on SDEProblems (alias_elimination! related?) #3302

@TorkelE

Description

@TorkelE
using Catalyst, StochasticDiffEq
model = @reaction_network begin
    @observables XY ~ X + Y
    (kp,kd), 0 <--> X
    (k1,k2), X <--> Y
end
@unpack XY, X, Y, kp, kd, k1, k2 = model

# Creates problem.
u0_vals = [X => 4, Y => 5]
tspan = (0.0, 10.0)
p_vals = [kp => 1.0, kd => 0.1, k1 => 0.25, k2 => 0.5]
sprob = SDEProblem(model,u0_vals, tspan, p_vals)

# tests remake.
rp = remake(sprob; u0 = [Y => 7])
rp[[X, Y]] == [4, 7] # false (should be true).
rp[X] # -7.0 (!, should be 4.0, X is never changed)
rp[Y] # 7.0 (correct)

@AayushSabharwal have already done some digging, suggesting that it could be caused by a bug in alias_elimination!.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions