Bounding output value from ode113
Show older comments
Hi,
I have a question about ODE (namely ode113). I try to model ADEX neuron, but in the model (described below) output variable should be bounded so that if it reaches threshold then we should reset it to some value. During research I found an article in which researchers used ode113 but I am struggling to get it working. Do you have any ideas if it is possible to do that with built-in function or should I write my own ode113 method for that purpose?
Adex model:
dV/dt = (-gl * (V - El) + gl * DeltaT * exp((V - Vt) / DeltaT) - w + I) / C;
dw/dt = (a * (V - El) - w) / tw;
if V >= threshold -> V = Vreset
Answers (1)
Steven Lord
on 15 Feb 2017
0 votes
Use an events function to stop the solver's progress when V reaches your threshold. Use the state returned by the first call to the solver to generate the initial conditions for another call to the solver that starts at the point you stopped the first call.
See the ballode demo for an example that uses ode23 to do this, stopping when the ball's height above the ground reaches 0. You should be able to adapt that to your ODEs and your ode113 call.
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!