Solving System of ODE with global condition

1 view (last 30 days)
Cone
Cone on 19 Apr 2021
Commented: Cone on 19 Apr 2021
I'm currently working on a system of 10 differential equations describing the cell devision cycle.
I'm struggling with the implementation of the mass devision, which happens whenever the first varible crosses zero with a negative slope. This is a globsl condition which happens multiple times during the chose timeframe.
So far I've done it this way:
But the problem is that the devision of the mass dy(10) by 0.5 happens EVERYTIME it's below 0.
I want this division only to be executed when dy(1) crosses zero with a negative slope only.
Kind regard for your help!
function dy=cellcycle(t,y)
dy(1)=..;
dy(2)=...;
..
dy(10)=;
if(dy(1))
dy(10)=0.5*dy(10) %need to take care of the slope as well....
end
end

Answers (0)

Categories

Find more on Programming 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!