Skip to content

Allow tstops in PresetTimeCallback to depend on model parameters #178

Description

@sebapersson

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions