Solving System of ODE with global condition

1 回表示 (過去 30 日間)
Cone
Cone 2021 年 4 月 19 日
コメント済み: Cone 2021 年 4 月 19 日
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
  2 件のコメント
Stephan
Stephan 2021 年 4 月 19 日
Cone
Cone 2021 年 4 月 19 日
Thanks a lot for your immediate answer, Stephan!
This should be the solution.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by