SciML / SciML/DiffEqCallbacks.jl

Allowing `affect!` to set values on a time interval instead of at a time point

Open
#245 5 comments 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.

Hi, everyone, DifferentialEquations.jl is awesome and efficient. I am trying to implement an affect! function to set values u[i] on a time interval instead of a single time point so that the delay differential equation module can work when I introduce, during integration, new particles whose history can be set by the callback function. Thanks a lot if you can consider making it possible to allow an affect! function to influence the state values of an integrator on a time interval, or if you have any other elegant workarounds to solving this.

Describe the solution you’d like

Instead of setting values only at one time point by a usual affect! function,

function affect!(integrator)
    integrator.u[2] = -integrator.u[2]
end

set its values for a whole time interval:

function affect!(integrator)
    #  here integrator is a DDE one (delay differential equation integrator) or others
    for integrator.t in a custom time span, e.g. [the timepoint of callback - 1.0, the timepoint of callback]:
        integrator.u .= (some custom function)
    end
end

Describe alternatives you’ve considered

Repeatedly invoke a one-time affect! in the time interval, but this probably has too much overhead.

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

No file or test is named. Start by tracing the callback API around affect! and the DDE integrator behavior described in the issue; determine how interval state updates should be represented without repeatedly invoking a point callback. Done means the intended interval semantics and supported integrator behavior are specified and covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.