Connecting two functions within a single ODE15S call

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 comentarios

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
Kian O'Sullivan el 16 de Mzo. de 2023
Editada: Kian O'Sullivan el 16 de Mzo. de 2023
So the whole model is essentially a chain of point voltages connected by a resistance. The ODEs define the behaviour of the voltages but next cell reaches a threshold voltage, cause by the input current, it will trigger the wave that is shown in the first image (regardless of if the current drops afterwards).
Given that all the cells start at -84mV, I need to be able to plot the initial trace given a stimulated input current. The voltage for that cell should then in turn create a current into the next cell due to the potential difference, which will subsequently trigger the next cell. So I need to be able to track both voltages within ode15s as the next cell is triggered by the current between them meeting that threshold.
Hope that makes sense? The rough sketch below is just what the chain looks like and how the waveforms should eventually look like:

Iniciar sesión para comentar.

Respuestas (0)

Productos

Versión

R2022b

Etiquetas

Preguntada:

el 15 de Mzo. de 2023

Editada:

el 16 de Mzo. de 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by