Set of initial values for a level with subscripts

Use this forum to post Vensim related questions.
Post Reply
Ashish_Kumar
Junior Member
Posts: 15
Joined: Tue Apr 06, 2021 9:31 am
Vensim version: DSS

Set of initial values for a level with subscripts

Post 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
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: Set of initial values for a level with subscripts

Post 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

Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
tomfid
Administrator
Posts: 3804
Joined: Wed May 24, 2006 4:54 am

Re: Set of initial values for a level with subscripts

Post 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
Ashish_Kumar
Junior Member
Posts: 15
Joined: Tue Apr 06, 2021 9:31 am
Vensim version: DSS

Re: Set of initial values for a level with subscripts

Post by Ashish_Kumar »

Thank you for those helpful replies. I am able to get the model to work.
Post Reply