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

How to add Callbacks for FODEProblem solvers? #122

Open
junaidaliop opened this issue Dec 30, 2024 · 2 comments
Open

How to add Callbacks for FODEProblem solvers? #122

junaidaliop opened this issue Dec 30, 2024 · 2 comments

Comments

@junaidaliop
Copy link

I am looking to find fractional-order solutions of Izhikevich neuron?
Are callbacks such as the one implemented here:

https://docs.sciml.ai/SciMLTutorialsOutput/html/models/08-spiking_neural_systems.html

function thr(u,t,integrator)
    integrator.u[1] >= 30
end

function reset!(integrator)
    integrator.u[1] = integrator.p[3]
    integrator.u[2] += integrator.p[4]
end

threshold = DiscreteCallback(thr,reset!)
current_step= PresetTimeCallback(50,integrator -> integrator.p[5] += 10)
cb = CallbackSet(current_step,threshold)

be imported with

prob = FODEProblem(izh!, alpha, u0, tspan, p, callback=cb)

I think that the callback doesn't intregate with FODEProblem.
What would be a way around this?

Also, which solver would be recommended to use with this?

@junaidaliop junaidaliop changed the title How to add Callbacks for FODESystem solvers? How to add Callbacks for FODEProblem solvers? Dec 30, 2024
@ErikQQY
Copy link
Member

ErikQQY commented Jan 3, 2025

Sorry, the current state of FractionalDiffEq doesn't support discrete or continuous callbacks, I think you might have to work on the rhs part to implement similar functionalities in FractionalDiffEq.

@junaidaliop
Copy link
Author

I would appreciate if you could provide me with a starting point or guidance to get started on this.

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