aggregating values over time steps
Posted: Fri Jun 07, 2019 5:48 pm
Hi, everyone. I am building an aging chain model to understand how interventions targeting diabetes incidence affect treatment cost.
In the model, a proportion of the susceptible population transitions to the first year of diabetes (DM1) , and then to the second and third year. Cost estimates for each year are applied to come up with a total cost of treating the population in each of the three years of disease progression.
The model documentation is appended below. I have two questions:
- I cannot seem to configure the model so that the total cost variable captures the aggregate cost of the model over time (i.e., the sum of Cost1, Cost2 and Cost3 across all time steps). Cost1-Cost3 are configured as auxiliary variables with arrows, rather than rates, linking DM1-DM3 to them. Cost1-Cost3 each have arrows linking to total cost, which is also an auxiliary.
- I'm getting unit errors for Cost1-Cost3. Units are specified as $/year, and the variables are a constant multiplied by the relevant DM stock (DM1-DM3), which is in persons/year. I'm not sure how to resolve this.
Thanks for any help you can offer!
(01) Cost1=
DM1*4100
Units: $/year
(02) Cost2=
DM2*4875
Units: $/year
(03) Cost3=
DM3*5650
Units: $/year
(04) DM1= INTEG (
toDM1-toDM2,
0)
Units: Persons/year
(05) DM2= INTEG (
toDM2-toDM3,
0)
Units: Persons/year
(06) DM3= INTEG (
toDM3,
0)
Units: Persons/year
(07) FINAL TIME = 10
Units: year
The final time for the simulation.
(08) INITIAL TIME = 0
Units: year
The initial time for the simulation.
(09) IR=
0.01
Units: Persons/year
(10) SAVEPER =
TIME STEP
Units: year [0,?]
The frequency with which output is stored.
(11) Susceptible= INTEG (
-toDM1,
1000)
Units: Persons
(12) TIME STEP = 1
Units: year [0,?]
The time step for the simulation.
(13) toDM1=
Susceptible*IR
Units: Persons/year
(14) toDM2=
DM1
Units: Persons/year
(15) toDM3=
DM2
Units: Persons/year
(16) totalCost=
Cost1+Cost2+Cost3
Units: $
In the model, a proportion of the susceptible population transitions to the first year of diabetes (DM1) , and then to the second and third year. Cost estimates for each year are applied to come up with a total cost of treating the population in each of the three years of disease progression.
The model documentation is appended below. I have two questions:
- I cannot seem to configure the model so that the total cost variable captures the aggregate cost of the model over time (i.e., the sum of Cost1, Cost2 and Cost3 across all time steps). Cost1-Cost3 are configured as auxiliary variables with arrows, rather than rates, linking DM1-DM3 to them. Cost1-Cost3 each have arrows linking to total cost, which is also an auxiliary.
- I'm getting unit errors for Cost1-Cost3. Units are specified as $/year, and the variables are a constant multiplied by the relevant DM stock (DM1-DM3), which is in persons/year. I'm not sure how to resolve this.
Thanks for any help you can offer!
(01) Cost1=
DM1*4100
Units: $/year
(02) Cost2=
DM2*4875
Units: $/year
(03) Cost3=
DM3*5650
Units: $/year
(04) DM1= INTEG (
toDM1-toDM2,
0)
Units: Persons/year
(05) DM2= INTEG (
toDM2-toDM3,
0)
Units: Persons/year
(06) DM3= INTEG (
toDM3,
0)
Units: Persons/year
(07) FINAL TIME = 10
Units: year
The final time for the simulation.
(08) INITIAL TIME = 0
Units: year
The initial time for the simulation.
(09) IR=
0.01
Units: Persons/year
(10) SAVEPER =
TIME STEP
Units: year [0,?]
The frequency with which output is stored.
(11) Susceptible= INTEG (
-toDM1,
1000)
Units: Persons
(12) TIME STEP = 1
Units: year [0,?]
The time step for the simulation.
(13) toDM1=
Susceptible*IR
Units: Persons/year
(14) toDM2=
DM1
Units: Persons/year
(15) toDM3=
DM2
Units: Persons/year
(16) totalCost=
Cost1+Cost2+Cost3
Units: $