SIR model with Maxima: Difference between revisions
From wikiluntti
(Created page with "== Introduction == Use WxMaxima to calculate SIR model. == Theory == thumb|SIR model <syntaxhighlight> depends([S,I,s, i],t); eqS : 'diff(S, t) = -β*S*...") |
(No difference)
|
Revision as of 12:35, 12 August 2021
Introduction
Use WxMaxima to calculate SIR model.
Theory

<syntaxhighlight> depends([S,I,s, i],t);
eqS : 'diff(S, t) = -β*S*I; eqI : 'diff(I, t) = β*S*I - α*I;
factor( rhs(eqI)>0);
eqsN : subst([S=N*s, I=N*i], eqS ); eqiN : subst([S=N*s, I=N*i], eqI );
eqs1 : ev(eqsN, nouns); eqi1 : ev(eqiN, nouns);
eqs : eqs1/N; eqi : ratsimp( eqi1/N );
plotdf([subst( [β=b], rhs(eqs)), subst( [α=a, β=b], rhs(eqi))], [s,i], [parameters,"a=10000,b=1.1,N=1000"], [s,0,75], [i,0,60], [sliders,"b=0.5:2.5"] ); </syntaxhiglight>