SciML / SciML/DiffEqCallbacks.jl

Allow tstops in PresetTimeCallback to depend on model parameters

Open
#178 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
100
Forks
54
Avg merge
3h 29m
Merged PRs (30d)
8

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the PresetTimeCallback entry point and trace how it currently accepts a vector of event times. Compare that path with the proposed get_tstops(integrator) form and the existing PEtab.jl and SBMLImporter usage. Done means parameter-dependent event times can be supplied through PresetTimeCallback without rebuilding the callback for each parameter vector.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend-api-design
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.