Modeling SIR in matlab and simulink help needed

23 ビュー (過去 30 日間)
Galaxis
Galaxis 2015 年 11 月 27 日
回答済み: CIRO ANTONIO MAMI 2022 年 7 月 10 日
Hello, I am trying to model a SIR epidemic model in matlab and simulink. I think I've already done it in matlab but for some reason my simulink model won't work. It just shows straight lines in a scope. This is my function to calculate differential equations.
function dx = sir(t, x)
dx = [0; 0; 0];
beta = .5;
delta = .3;
dx(1) = -beta * x(1) * x(2);
dx(2) = beta * x(1) * x(2) - delta * x(2);
dx(3) = delta * x(2);
end
This is my workspace code to show plot
and this is mu simulink with yields this strange plot and this is after autoscaling with initial conditions set to S = 7900000 and R = 0 and I = 10
%
  2 件のコメント
Alaa Mohamed
Alaa Mohamed 2020 年 5 月 5 日
I am working on the same model rightnow, but for some reason the plot code is not running, could you help me?
MICHAEL Veneziano
MICHAEL Veneziano 2021 年 2 月 13 日
could it be that with an S many times greater than I, I seems 0? try running it for a longer time or witha greater I or beta

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

回答 (1 件)

CIRO ANTONIO MAMI
CIRO ANTONIO MAMI 2022 年 7 月 10 日
Same problem here, did you find any solutions?

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by