Connecting two functions within a single ODE15S call
Show older comments
I have some open source code which uses ODE15S to solve a large differential system, which essentiall produces the action potential graph of a cardiac cell, given an input current as a stimulus. it is using the Luo-Rudy model and so it essentiall produces a potential difference graph, which represents the movement of ions across a cell membrane.
Example output for single cell:

Current ODE function:

Calling ode15s:

The issue I am facing is that I need to be able to connect several cells together, whilst the current code can only solve for a single cell - i.e. I need to take the voltage from an initial wave and use this to 1) get the input current going into the next cell, and 2) use this current to trigger the wave on the next cell.
At the moment, I am struggling converting the code such that it runs the function twice within a single ODE15S call, which I am doing so that I can continuously update the voltages/currents. Any ideas on how best to approach this situation or if it is even possible to do so with ODE15S would be perfect.
I understand its quite an abstract concept so please let me know if any clarity is needed!
2 Comments
Steven Lord
on 15 Mar 2023
When you say "connect several cells together" are you talking about having the results for the second cell starting at the x = 1000 mark on your plot and continuing to x = 2000, then the third cell running from x = 2000 to x = 3000, etc.?
Or are you trying to start the next cell whenever the signal for the previous cell has reached a steady state?
Or do you have a different meaning in mind?
Kian O'Sullivan
on 16 Mar 2023
Edited: Kian O'Sullivan
on 16 Mar 2023
Answers (0)
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!