5주 모델링의 기초 1  Basics of Modeling I

Richardson, chpt 3, 김도훈외 6, 7장;

High Performance chpt 3(Stock and Flow, etc), 4(Generic Building Block), 5(Generic Flow Process)

Dynamo (Dynamic models)

6개월전 재고량이 1000개였는데 물품의 수령은 매달 80개, 출하는 100개였다면 현재 재고량은?

재고량현재=재고량과거+(과거부터 현재까지 시간 intervening time)´(변화율 constant rate of change)

재고량현재=1000과거+(6개월 intervening time)´(80-100 constant rate of change)

=1000+(-120)=880개

If inventory of items were 1000 units 6 months ago, and the receipt and shipment of items were 80 and 100 unit per month each, whats the inventory size now?

Inventory now=inventory past+intervening time*(constant inflow-outflow)

=1000units+(6month)*(80-100 unit/month)

=880 units

INV.K=INV.J+DT*(ORDRCV.JK-SHPMTS.JK)

INV.K=value of inventory now

INV.J=value of inventory a time interval ago

DT=length of intervening time (Delta Time )

ORDRCV.JK=orders received over the time interval JK

SHPMTS.JK=shipments over the time interval JK  J 커피가 식는 모습 coffee cooling 커피 온도현재=커피 온도과거+(시간 흐름 intervening time)*(커피온도변화율)

커피온도변화율=CONST*(방온도-커피온도)

COFFEE.K=COFFEE.J+DT*(CHNG.JK)

CHNG.KL=CONST*(ROOM-COFFEE.K)

With DT=0.5, ROOM=20, CONST=0.2, initial value of COFFEE=90 시스템다이내믹스 모델의 주요변수유형 Type of variables in system dynamics modeling

(1)수준변수(level, stock variable) a variable that accumulate over time. Designated as L

(2)변화율변수(rate, flow variable) a variable representing inflows and outflows in level equation. Designated as R

(3)보조변수, 상수(auxiliary variable, constant) a variable representing information in feedback system. Designated as A

피드백 시스템에서 정보를 계산하는 변수. 변화율 변수의 계산을 보조한다.

R CHNG.KL=CONST*DISC.K

A DISC.K=ROOM-COFFEE.K

A LFO.K=BLDNGS.K*LPB/AREA

LFO=land fraction occupied

BLDNGS=buildings

LPB=average land per buildings

AREA=city area

그래프함수로 표현되는 보조함수 (Table function)

A var.k=TABLE(table name, input to table, min-x, max-x, x-inc)

T table name=y0/y1/y2..yn

R OB.KL=S.K*SE.K          주문량=판매원*판매원1인당1달주문수주량

OB=order booked

S=salesmen

SE=sales effectiveness(orders booked/person/month)

If sales effectiveness is depended on the delay in filling orders, SE can be formulated as a function of the delivery delay recognized in the market (DDRM)

A SE.K=TABLE(TSE,DDRM.K,0,10,1)

T TSE=400/388/348/292/212/152/100/60/32/12/8

(4) N equation

initial value equation

수준변수와 변화율변수의 구분 distinction between level and rate variable

When you take picture, what you can see in the picture are usually stocks and you cannot see any flows in there.

Level is a system state (population size) while rate is in and outflow from the system (birth and death rate, in and out migration rate)

Delay, Smooths, and Averages

물질지연(material delay) Delay1  Stella: DELAY(INPUT, DELAY DURATION, INITIAL)

Smoothing information

단기적인 정보의 흐름을 안정적인 값으로 만들기 위하여 평균화 하는 것

Averaging information flow to smooth out extreme values or random values

A SVAR.K=SMOOTH(VAR.K, STIME)

VAR=variable to be smoothed

SVAR=smoothed variable

STIME=smoothing time

DT의 선택 Choice of DT

개략적으로, 모델에서 사용되는 최소 시간상수의 1/2-1/10이 되는 DT를 사용

Take DT between 1/2-1/10 of the smallest time constant in the model

정보의 지연(Information Delay)

당일의 판매량, 오늘의 GNP, 서울에 사는 사람이 부산의 직업사정에 대한 정보,

A SV3.K=DLINF3(VAR.K,STIME) ; third order information delay

변화율변수의 종류 Type of rate variables. See High Performance 5.

자기증식에 관한 변화율변수 compounding process

자기감소에 관한 변화율변수 draining process

목표지향적 변화율변수      (목표수준-수준변수)/조절시간 stock adjustment process

flow=(target for stock-stock)/time constant

복합적 요인의 곱으로서의 변화율 변수 production process

Logic Functions

Max(A,B) :  A if A>B, B if A<B

Min(A,B) : A if A<B, B if A>B

CLIP(A,B,X,Y) : A if X>Y, B if X<Y

SWITCH (A,B,X): A if X=0, B if X 0

Stella: AND, ELSE, IF, NOT, OR, THEN

CLIP(A,B,X,Y) : A if X>Y, B if X<Y

IF(X>Y) THEN A ELSE B

SWITCH (A,B,X): A if X=0, B if X 0

IF(X=0) THEN A ELSE B

Ex)

BONUS PAYMENT=IF(TIME=5) OR (sale>5000) THEN bonus ELSE 0

Capital acquisition = IF(IRR>=0.1) AND (CASH>=1,000,000) THEN 100,000 ELSE 0

THERMO SWITCH=IF(TEMP<SET POINT) THEN 1 ELSE 0

# Test Function

STEP(A,B) A:Height, B: Start time  STEP(5,10) RAMP(A,B) A: slope, B: Start time RAMP(1,10) PULSE(A,B,C) A:Height, B:Time of the first pulse, C: time interval b/w successive pulse

Stella - PULSE(Volume, First pulse, interval)            PULSE(10,5,5)  Coffee Cooling over time. Richardson. P.73.  coffee(t) = coffee(t - dt) + (rate_of_change) * dt

INIT coffee = 90

rate_of_change = const*(room_temperature-coffee)

const = 0.2

room_temperature = 20  coffee(t) = coffee(t - dt) + (rate_of_change) * dt

INIT coffee = 90

rate_of_change = const*(room_temperature-coffee)

room_temperature = 20

const = GRAPH(coffee)

(20.0, 0.00), (40.0, 0.1), (60.0, 0.2), (80.0, 0.2), (100, 0.2) EX. 김도훈외 128쪽. 130쪽 도시성장에 관한 흐름도와 equation을 이용하여 program을 하고 시뮬레이션을 해 볼 것  EX. Richardson, 1981. pp.95-96. Epidemic Model Use fig 3.6 and equation in fig 3.7, draw flow diagram and run it      INVENTORY MODEL Richardson, 1981:123-124.      EX) Simple Kaibab Plateau 김도훈외. 시스템다이내믹스 p.183, p.189  predator(t) = predator(t - dt) + (predator_birth - predator_death) * dt

INIT predator = 100

predator_birth = c*predator*prey

predator_death = d*predator

prey(t) = prey(t - dt) + (prey_birth - prey_death) * dt

INIT prey = 1000

prey_birth = prey*a

prey_death = b*predator*prey

a = 0.25

b = 0.001

c = 0.0001

d = 0.1      food(t) = food(t - dt) + (F_growth - F_consume) * dt

INIT food = 20000

F_growth = (F_capacity-food)/food_regeneration_time

F_consume = prey*food_consumption_per_prey

predator(t) = predator(t - dt) + (predator_birth - predator_death) * dt

INIT predator = 100

predator_birth = c*predator*prey

predator_death = d*predator+hunting_limit*test

prey(t) = prey(t - dt) + (prey_birth - prey_death) * dt

INIT prey = 1000

prey_birth = prey*a

prey_death = (b*predator*prey)+(prey/average_life_time)

a = 0.25

b = 0.001

c = 0.0001

d = 0.1

food_per_prey = food/prey

F_capacity = 25000

F_ratio = food/F_capacity

hunting_limit = STEP(20,50)

test = 1

average_life_time = GRAPH(food_per_prey)

(0.00, 0.45), (0.1, 0.75), (0.2, 1.50), (0.3, 2.55), (0.4, 3.60), (0.5, 4.85), (0.6, 6.65), (0.7, 8.95), (0.8, 9.70), (0.9, 9.95), (1, 9.95)

food_consumption_per_prey = GRAPH(food_per_prey)

(0.00, 0.00), (0.2, 0.2), (0.4, 0.4), (0.6, 0.6), (0.8, 0.8), (1.00, 1.00), (1.20, 1.00), (1.40, 1.00), (1.60, 1.00), (1.80, 1.00), (2.00, 1.00)

food_regeneration_time = GRAPH(F_ratio)

(0.00, 20.0), (0.1, 18.9), (0.2, 17.3), (0.3, 15.8), (0.4, 13.9), (0.5, 11.5), (0.6, 8.89), (0.7, 6.13), (0.8, 3.28), (0.9, 1.95), (1, 1.00)    