We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remake
remake does not update parameters that are vector-valued. The following example is taken from the Catalyst documentation:
using OrdinaryDiffEq using Catalyst two_state_model = @reaction_network begin @parameters k[1:2] @species X(t)[1:2] (k[1],k[2]), X[1] <--> X[2] end u0 = [:X => [0.0, 2.0]]; tspan = (0.0, 1.0); ps = [:k => [1.0, 2.0]]; oprob = ODEProblem(two_state_model, u0, tspan, ps); oprob_rmk = remake(oprob; p=[:k => [0.0, 0.0]]);
oprob_rmk does not have the updated parameters; both solve(oprob)(1.0) and solve(oprob_rmk)(1.0) produce the same output.
oprob_rmk
solve(oprob)(1.0)
solve(oprob_rmk)(1.0)
Interestingly, this behaviour is absent if the parameters are defined outside of the reaction_network macro:
reaction_network
@parameters k[1:2] two_state_model = @reaction_network begin @species X(t)[1:2] ($k[1],$k[2]), X[1] <--> X[2] end u0 = [:X => [0.0, 2.0]]; tspan = (0.0, 1.0); ps = [k => [1.0, 2.0]]; oprob = ODEProblem(two_state_model, u0, tspan, ps); oprob_rmk = remake(oprob; p=[k => [0.0, 0.0]]);
Here, solve(oprob_rmk)(1.0) produces the expected output, i.e. [0.0, 2.0].
[0.0, 2.0]
The text was updated successfully, but these errors were encountered:
AayushSabharwal
No branches or pull requests
remake
does not update parameters that are vector-valued. The following example is taken from the Catalyst documentation:oprob_rmk
does not have the updated parameters; bothsolve(oprob)(1.0)
andsolve(oprob_rmk)(1.0)
produce the same output.Interestingly, this behaviour is absent if the parameters are defined outside of the
reaction_network
macro:Here,
solve(oprob_rmk)(1.0)
produces the expected output, i.e.[0.0, 2.0]
.The text was updated successfully, but these errors were encountered: