Page 1 of 1

Set of initial values for a level with subscripts

Posted: Tue Apr 06, 2021 1:20 pm
by Ashish_Kumar
Hi,

I am working on a model of a hospital Emergency Department (ED). The number of patients in the ED is given by

Patients in ED[Priority]= INTEG (
Transportation rate to ED[Priority]+"Walk-in and other non-995 cases"-ED Treatment Rate
[Priority],
5000)
Units: Case

**************************************************************

There are four values (P1-P4) of the Priority subscript, and my current definition sets the initial value for each Priority level to 5000. I would like to set initial values for each of them to different starting points, for example:

P1 = 500, P2 = 1000, P3 = 1500, P4 = 2000.

How can I do this?

Best regards

Re: Set of initial values for a level with subscripts

Posted: Tue Apr 06, 2021 3:52 pm
by Administrator
The best option would be to put these values in a separate CIN file. You can hard code them into your model (see below), a CIN file will be better in the long run.

Code: Select all

Patients in ED[Priority]= INTEG (
Transportation rate to ED[Priority]+"Walk-in and other non-995 cases"-ED Treatment Rate
[Priority],
initial patients in ed[priority])

initial patients in ed[priority] = 500, 1000, 1500, 2000


Re: Set of initial values for a level with subscripts

Posted: Tue Apr 06, 2021 4:35 pm
by tomfid
Also, for things that are not expressible as a list of constants, TABBED ARRAY, or GET XLS link, you can always write equations individually for each element of a subscript range:
https://vensim.com/documentation/21265.html
https://vensim.com/documentation/except ... tions.html

Re: Set of initial values for a level with subscripts

Posted: Wed Apr 07, 2021 10:06 am
by Ashish_Kumar
Thank you for those helpful replies. I am able to get the model to work.