Skip to content
New issue

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

modelling of events #24

Open
fkrauer opened this issue Sep 26, 2020 · 1 comment
Open

modelling of events #24

fkrauer opened this issue Sep 26, 2020 · 1 comment

Comments

@fkrauer
Copy link

fkrauer commented Sep 26, 2020

Hi

I have just started using diffeqr for R and I would love to use it for my (rather large) disease modelling project. I will have an ODE model with a substantial number of compartments and I have to trigger changes the values of states or parameters at specific time points (externally forced, corresponding to an intervention). In plain R and deSolve() I would do this with an event function. Is there an equivalent for diffeqr? And if yes, is example code available?

Bw, Fabienne

@ChrisRackauckas
Copy link
Member

DifferentialEquations.jl has the callback functions defined here: https://diffeq.sciml.ai/stable/features/callback_functions/ . I haven't tried using them from R though. My guess is that they might have a few issues since they rely on mutation and R uses call-by-copy (https://stackoverflow.com/questions/2603184/can-you-pass-by-reference-in-r). So I think we'll need to expose an alternative non-mutating form for R users. Until then though, the solution would be to eval a callback function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants