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

Allow tstops in PresetTimeCallback to depend on model parameters #178

Open
sebapersson opened this issue Nov 29, 2023 · 1 comment
Open

Comments

@sebapersson
Copy link

Is your feature request related to a problem? Please describe.

Sometimes when parameter estimating ODE-models, or when importing a model in the SBML format, event time-points are dependent on model parameters. As I understood PresetTimeCallback accepts a vector of event-times, so it cannot be used (without rebuilding the callback for each parameter vector) when event-times are model parameter dependent.

Describe the solution you’d like

I would like PresetTimeCallback to also accept a function like:

function get_tstops(integrator) ... end

And that a preset callback then can be created with

PresetTimeCallback(get_tstops, user_affect!; ...)

Describe alternatives you’ve considered

Currently in PEtab.jl and SBMLImporter if we have events we provide a function for computing tstops:

sys, specie_map, parameter_map, cb, get_tstops = SBML_to_ODESystem(path_SBML)

It works, but the interface would be cleaner and more easy to use if we did not have to return the get_tstops function.

@ChrisRackauckas
Copy link
Member

Yeah this could be added to the interface.

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