Modeling Complex SD DELAYS AND TABLES
Dennis T. Beng Hui, De La Salle University-Manila
Types of Rate Equations (Var.kl = …)
Constant*Level.k Level.k/life (goal.k-level.k)/adjustment aux.k*level.k level.k/aux.k norm.k+effect.k norm.k*effect.k Dennis T. Beng Hui, De La Salle University-Manila
The Spreading Virus Problem
Virus starts with a few people who are susceptible to the virus. These susceptible people will become infected and in turn become sick. Once people get sick, they start taking medicine, as time progresses, these people will slowly get cured and on their way to recovery. Dennis T. Beng Hui, De La Salle University-Manila
The Spreading Virus Problem Susceptible People
Recovered People Infected People
Sick People
Dennis T. Beng Hui, De La Salle University-Manila
Examples of Delays: Delay1 R SYMP.KL=DELAY1 (INF.KL, TSS) Where
TSS = time to show symptoms INF = infection rate SYMP = symptom rate
Incubate
Healthy INF
Sick SYM
Delay1(INF.KL,TIME)
Dennis T. Beng Hui, De La Salle University-Manila
Recovered REC
Examples of Delays: Delay3 SYMP.KL=DELAY3 (INF.KL, TSS) Where
Susceptible
TSS = time to show symptoms INF = infection rate SYMP = symptom rate
INFC
INC1
Sic
Incubate3
Incubate2
Incubate1
INC2
Delay3(INFC.KL,TSS)
Dennis T. Beng Hui, De La Salle University-Manila
INC3
Effect of Delays
What happens to the diagram if there is an incubation period? What do you think is the behavior of the levels and the rates in this system? SMOOTH – delay command for information. Ex. smooth1, smooth3
Dennis T. Beng Hui, De La Salle University-Manila
Effect of Delays
Dennis T. Beng Hui, De La Salle University-Manila
The TABLE COMMAND
TABLE – use to describe a variable that is not a simple algebraic equation SYNTAX:
A T
VAR.K = TABLE (table_name, input_to_table, min-x, max-x, x-inc) table_name = y0/y1/y2/ … /yn
NOTE: n is equal to the number of x points available between min-x up to max-x.
Dennis T. Beng Hui, De La Salle University-Manila
TABLE Example A SALESMEN.K = TABLE (TSE, DDRM.K, 0, 10, 1) T TSE = 400/388/348/292/212/152/100/60/32/12/8 R ORDERS.KL = SALESMEN.K*SALES/PERSON.K Where TSE = table for SALEMEN DDRM.K = delivery delay (level or auxiliary variable, or even a rate variable) X
0
1
2
3
4
5
6
7
8
9
10
Y
400
388
348
292
212
152
100
60
32
12
8
Dennis T. Beng Hui, De La Salle University-Manila
TEST Commands RAMP - continuous growing or declining linear function of TIME. Var = RAMP(A,B) Where A = represents the slope of the linear function B = represents the starting time of the ramp NOISE - The noise function allows us to vary the value of a variable by –0.5 to 0.5. This command allows us to exhibit a little bit of randomness, but still maintaining the pattern of behavior. NOISE exhibits a uniform distribution. Var = A*NOISE()+B Where A and B are constants and that the value of Var is centered between A and B.
Dennis T. Beng Hui, De La Salle University-Manila
TEST Commands
PULSE – creates a sudden increase in the behavior and drops back to its original state. PULSE(HEIGHT,WIDTH,FIRST,INTVL) – from VENSIM -A pulse of height , starting at time FIRST and every INTVL lasting WIDTH time units. STEP – creates a step change in the behavior and does not return to its original state. STEP(H,T) – from VENSIM - Returns 0 till time T and then H.
Note: DYNAMO commands for PULSE and STEP will have a slightly different syntax. Dennis T. Beng Hui, De La Salle University-Manila