Replies: 2 comments 2 replies
-
Hi - the first order solution is used by default to start iterations when
method=stacked or method=period. Use startIterations="data" and supply some
initial values (time series on the simul range) for all variables in the
input databank.
Best
J
…On Mon, Aug 8, 2022, 1:56 PM Antti Ripatti ***@***.***> wrote:
I wonder if there is a way to simulate a simple SIR model with Iris?
The model code would like like this
%% Definitions
!transition-variables
S, I, R
!parameters
pi_r = 1/14; % per-period recovery rate
pi = 2.5/14; % =R0*pi_r
%% Model block
!transition_equations
S =# S{-1} - pi*I{-1}*S{-1};
I =# I{-1} + pi*I{-1}*S{-1} - pi_r*I{-1} ;
R =# R{-1} + pi_r*I{-1};
And the code to run
m = Model.fromFile('SIR.model','linear', false,'comment','SIR model');
len = 150;
idb = struct();
idb.I = 0.001;
idb.S = 1-idb.I;
idb.R = 1 - idb.S - idb.I;
R0 = m.pi/m.pi_r;
db = simulate(m, idb,1:len,'method','period');
But the last option does not work because we have not solved the model.
There is no steady state either.
—
Reply to this email directly, view it on GitHub
<#332>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGCVKKX2RT4MTLYE2TWNWUDVYDYYLANCNFSM5543IQCQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
2 replies
-
m = alter(m, 2);
m.pi = [ ...];
…On Tue, Aug 9, 2022, 3:26 PM Antti Ripatti ***@***.***> wrote:
It seems that assigning multiple parameter values does not work with this
model object?
eg
p.pi = [0.1 0.2];
assign(m,p);
does not work. (latest version of Iris)
—
Reply to this email directly, view it on GitHub
<#332 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGCVKKVWJF3HGECFDNZSCVDVYJL7VANCNFSM5543IQCQ>
.
You are receiving this because you commented.Message ID:
<IRIS-Solutions-Team/IRIS-Toolbox/repo-discussions/332/comments/3357997@
github.com>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I wonder if there is a way to simulate a simple SIR model with Iris?
The model code would like like this
And the code to run
But the last option does not work because we have not solved the model. There is no steady state either.
Beta Was this translation helpful? Give feedback.
All reactions