21
David Tenenbaum – GEOG 110 – UNC-CH Fall 2005 Review - STELLA Model Elements Reservoirs – These are the default stock type Think of a reservoir as an undifferentiated pile of stuff (many instances of the same stuff) – Reservoirs passively accumulate inflows minus outflows (they are simply containers) Any units which flow into a Reservoir lose their individual identity - Reservoirs mix together all units into an undifferentiated mass as they accumulate Flows – Function is to fill and drain stocks – To bend a flow pipe, depress the shift key and change the direction of mouse movement as you drag the flow. Each time you depress the shift key, a 90 degree bend will be put in the flow pipe

Review - STELLA Model Elements · Review - STELLA Model Elements • Converters – These serve a utilitarian role in the software – They hold values for constants, define external

Embed Size (px)

Citation preview

Page 1: Review - STELLA Model Elements · Review - STELLA Model Elements • Converters – These serve a utilitarian role in the software – They hold values for constants, define external

David Tenenbaum – GEOG 110 – UNC-CH Fall 2005

Review - STELLA Model Elements• Reservoirs – These are the default stock type

– Think of a reservoir as an undifferentiated pile of stuff (many instances of the same stuff)

– Reservoirs passively accumulate inflows minus outflows (they are simply containers)

– Any units which flow into a Reservoir lose their individual identity - Reservoirs mix together all units into an undifferentiated mass as they accumulate

• Flows – Function is to fill and drain stocks– To bend a flow pipe, depress the shift key and

change the direction of mouse movement as you drag the flow. Each time you depress the shift key, a 90 degree bend will be put in the flow pipe

Page 2: Review - STELLA Model Elements · Review - STELLA Model Elements • Converters – These serve a utilitarian role in the software – They hold values for constants, define external

David Tenenbaum – GEOG 110 – UNC-CH Fall 2005

Review - STELLA Model Elements• Flows Cont.

– To draw an inflow to a stock, make sure that your cursor makes contact with the stock before you release the mouse button. The stock will turn gray on contact to let you know that it will receive the flow. If you release the mouse button prematurely, a cloud will appear at the destination end of the flow pipe

– To replace a cloud with a stock, select the stock with the Hand tool. Drag the stock over the cloud. When the cursor (the tip of the index finger on the hand) is directly atop of the cloud, the cloud will turn gray. Release the mouse button, and the flow will be connected to the stock (the cloud will disappear)

Page 3: Review - STELLA Model Elements · Review - STELLA Model Elements • Converters – These serve a utilitarian role in the software – They hold values for constants, define external

David Tenenbaum – GEOG 110 – UNC-CH Fall 2005

Review - STELLA Model Elements• Converters – These serve a utilitarian role in

the software– They hold values for constants, define external

inputs to the model, calculate algebraic relationships, and serve as repositories for graphical functions

– In general, they convert inputs into outputs, hence the name "converter"

• Connectors – These connect elements– There are two types of connectors available in

STELLA– Action connectors are shown as solid, directed

wires– Information connectors (which we most likely

will not be using) are signified by a dashed wire

Page 4: Review - STELLA Model Elements · Review - STELLA Model Elements • Converters – These serve a utilitarian role in the software – They hold values for constants, define external

David Tenenbaum – GEOG 110 – UNC-CH Fall 2005

Rules for Building Systems Models 1. Make systems diagrams as simple as possible2. Relationships between elements should be

defined mathematically3. If a mathematical expression is not available,

define relationships using graphs4. Observe the conservation law and maintain

consistency in units5. Reservoir values can only be changed by

inflows and outflows

Page 5: Review - STELLA Model Elements · Review - STELLA Model Elements • Converters – These serve a utilitarian role in the software – They hold values for constants, define external

David Tenenbaum – GEOG 110 – UNC-CH Fall 2005

Model Structures and Behavior Patterns• The systems modeler believes that the behavior of the

system is a function of the system itself• Translating that idea to the model realm, this means

that certain structures of elements should produce certain types of behavior patterns

• We are going to look at five common behavior patterns and their associated structures:

LinearGrowth

or Decay

ExponentialGrowth

or Decay

LogisticGrowth

Overshootand

Collapse

Oscillation

Page 6: Review - STELLA Model Elements · Review - STELLA Model Elements • Converters – These serve a utilitarian role in the software – They hold values for constants, define external

David Tenenbaum – GEOG 110 – UNC-CH Fall 2005

Linear Growth or Decay - Example• Consider the following example of a system:

– An oil reserve contains 10,000,000 barrels of oil– The oil is consumed at a rate of 10,000 barrels per day

• What would the system diagram look like here?

•What entity changes with time here?•What is/are the process(es) that cause that change?•What determines the rate of change?•Because it is constant, no converter is required

Page 7: Review - STELLA Model Elements · Review - STELLA Model Elements • Converters – These serve a utilitarian role in the software – They hold values for constants, define external

David Tenenbaum – GEOG 110 – UNC-CH Fall 2005

Linear Growth or Decay - Example• What is the difference equation for this system?

Oil Reserves tomorrow = Oil Reserves Today – 10,000 barrels

or more generally:Oil Reserves in t days = Present Oil Reserves – 10,000 * t days

and shown mathematically:R(t+∆t) = R(t) – (10,000 * ∆t)

• How will this system behave?– Reserve begins with 107 barrels– Decrease 10,000 barrels per day– After 1000 days, reserve is empty– NOTE: Once empty, eqn. not valid

Page 8: Review - STELLA Model Elements · Review - STELLA Model Elements • Converters – These serve a utilitarian role in the software – They hold values for constants, define external

David Tenenbaum – GEOG 110 – UNC-CH Fall 2005

Linear Growth or Decay – System Features, Diagrams, and Equations

• For a reservoir to exhibit linear growth or decay, the sum of all inflows minus the sum of all outflows to the reservoir must be constant– A positive constant indicates growth– A negative constant indicates decay– If the constant is zero, the reservoir content remains constant

Generic Linear System

• System can have any number of inflows and outflow

• Not all flows need be constant• It is necessary for the difference

between the sums to be constant

Page 9: Review - STELLA Model Elements · Review - STELLA Model Elements • Converters – These serve a utilitarian role in the software – They hold values for constants, define external

David Tenenbaum – GEOG 110 – UNC-CH Fall 2005

Linear Growth or Decay – System Features, Diagrams, and Equations

• For our generic example, the difference equation is:R(t+∆t) = R(t) + {(Inflow 1 + Inflow 2 + Inflow 3) – (Outflow 1 + Outflow 2)} * ∆t

or in general:R(t+∆t) = R(t) + {(Inflow 1 + … + Inflow n) – (Outflow 1 + … + Outflow n)} * ∆t

• This can be rearranged as:

Σi = 1

n

Inflowi -Σj = 1

nOutflowjR(t+∆t) - R(t) = * ∆t

and divided by ∆t to give:n n

Σi = 1

Inflowi -Σj = 1

OutflowjR(t+∆t) - R(t) =

∆t

Page 10: Review - STELLA Model Elements · Review - STELLA Model Elements • Converters – These serve a utilitarian role in the software – They hold values for constants, define external

David Tenenbaum – GEOG 110 – UNC-CH Fall 2005

Linear Growth or Decay – System Features, Diagrams, and Equations

• We are now set up to find the instantaneous rate of change of the reservoir with respect to time by taking the derivative of the expression:

R(t+∆t) - R(t)

∆tlim

∆t 0dR(t)dt

= = constant = kn n

Σi = 1

Inflowi -Σj = 1

Outflowj=

• In a linear system, the value kis the slope of the line

• We have positive values of kfor growth and negativevalues for decay

• What would k be in the Oil Reserve example?

Page 11: Review - STELLA Model Elements · Review - STELLA Model Elements • Converters – These serve a utilitarian role in the software – They hold values for constants, define external

David Tenenbaum – GEOG 110 – UNC-CH Fall 2005

Linear Growth or Decay – Feedbacks and Steady State Conditions

Generic Linear System

• The generic linear system contains no loops, therefore it cannot have any feedbacks

• This system changes as a constant rate and has linear chain of cause and effect

• For a system to be in a steady state, the rate of changeof the contents of the reservoir must be equal to zero

• We have shown that the rate of change here is constant• In the Oil Reserve example, this is true until we run out

of oil on day 1000, then the system is in steady state

Page 12: Review - STELLA Model Elements · Review - STELLA Model Elements • Converters – These serve a utilitarian role in the software – They hold values for constants, define external

David Tenenbaum – GEOG 110 – UNC-CH Fall 2005

Exponential Growth or Decay - Examples

• Consider the following example of a system:– A pair of white mice escape from their cage– They mate and have offspring, which mature and then do the

same, generation after generation …

• What would the system diagram look like here?• This model is going to be able more complex than the

linear model, so we will attempt to construct the model using a series of steps:Step 1: Identify the reservoir(s)– Since we are tracking the number of mice:

Page 13: Review - STELLA Model Elements · Review - STELLA Model Elements • Converters – These serve a utilitarian role in the software – They hold values for constants, define external

David Tenenbaum – GEOG 110 – UNC-CH Fall 2005

Exponential Growth or Decay - Examples

Step 2: Identify the process(es) that will change the contents of the reservoir(s) over time:– We obviously need to have mice being born, and mice dying

of old age:

Step 3: Identify the converter(s) that determine the rates of inflow and outflow:– We will need a Birth Rate and Death Rate:

Page 14: Review - STELLA Model Elements · Review - STELLA Model Elements • Converters – These serve a utilitarian role in the software – They hold values for constants, define external

David Tenenbaum – GEOG 110 – UNC-CH Fall 2005

Exponential Growth or Decay - Examples

Step 4: Define relationships between system elements with connectors:

• Just on the basis of the model structure, we should be able to guess that this will produce different behaviorfrom our linear model

• The key is how we define the Birth and Death Rates• Birth Rate = 1.1 births/capita/month• Death Rate = 0.08 deaths/capita/month

Page 15: Review - STELLA Model Elements · Review - STELLA Model Elements • Converters – These serve a utilitarian role in the software – They hold values for constants, define external

David Tenenbaum – GEOG 110 – UNC-CH Fall 2005

Exponential Growth or Decay - Examples

• What is the difference equation for this system?W(t+∆t) = W(t) + ({Birth - Death} * ∆t)

• Using Birth Rate = 1.1 and Death Rate = 0.08, we can find the expressions for the Birth and Death processes:

Birth = Birth Rate * W(t) = 1.1 * W(t)Death = Death Rate * W(t) = 0.08 * W(t)

• Substituting those back into the equation:W(t+∆t) = W(t) + ({1.1 * W(t) – 0.08 * W(t)} * ∆t)

= W(t) + (1.02 * W(t) * ∆t) .

• In each time step (selected to be a month for this model), the number of mice will more than double

Page 16: Review - STELLA Model Elements · Review - STELLA Model Elements • Converters – These serve a utilitarian role in the software – They hold values for constants, define external

David Tenenbaum – GEOG 110 – UNC-CH Fall 2005

Exponential Growth or Decay - Examples

• Such a system will exhibit the following behavior:

• Initially, the increasing number of mice is not particularly noticeable

• As time goes on, the mice population grows quite rapidly

• We can also come up with a system that will exhibit the opposite behavior:– A hanging bucket of water has a hole in the bottom– The rate at which the water drips out is a function of the

amount of water remaining in the bucket

Page 17: Review - STELLA Model Elements · Review - STELLA Model Elements • Converters – These serve a utilitarian role in the software – They hold values for constants, define external

David Tenenbaum – GEOG 110 – UNC-CH Fall 2005

Exponential Growth or Decay - Examples

• What would the system diagram look like here?

• Note: We don’t need to have inflow and outflow processes necessarily to produce this particular sort of behavior

• Exponential growth (or decay) occurs if and only if the reservoir increases (or decreases) at a rate that is proportional to its size– If the reservoir increases in size, this is exponential growth– If the reservoir decreases in size, this is exponential decay

Page 18: Review - STELLA Model Elements · Review - STELLA Model Elements • Converters – These serve a utilitarian role in the software – They hold values for constants, define external

David Tenenbaum – GEOG 110 – UNC-CH Fall 2005

Exponential Growth or Decay – System Features, Diagrams, and Equations

• A system that has exponential behavior generally takes the following form:

• Unlike a linear system, its possible to trace loops in this diagram, thus these systems do have feedback, which helps explain why their behavior runs “out of control”

• To see why we refer to this behavior as exponential, we need to have a look at the difference equation for one of these systems …

Page 19: Review - STELLA Model Elements · Review - STELLA Model Elements • Converters – These serve a utilitarian role in the software – They hold values for constants, define external

David Tenenbaum – GEOG 110 – UNC-CH Fall 2005

Exponential Growth or Decay – System Features, Diagrams, and Equations

• For our generic example, the difference equation is:R(t+∆t) = R(t) + {[Inflow Rate * R(t)] – [Outflow Rate * R(t)]} * ∆t

• This can be rearranged (by subtracting R(t)) as:R(t+∆t) - R(t) = {[Inflow Rate – Outflow Rate] * R(t)} * ∆t

• Then divide by ∆t:R(t+∆t) - R(t) = {[Inflow Rate – Outflow Rate] * R(t)}

∆t• Finally, take the derivative with respect to time:

R(t+∆t) - R(t)

∆tlim

∆t 0dR(t)dt

= = kR(t), where k = [Inflow Rate – Outflow Rate]

Page 20: Review - STELLA Model Elements · Review - STELLA Model Elements • Converters – These serve a utilitarian role in the software – They hold values for constants, define external

David Tenenbaum – GEOG 110 – UNC-CH Fall 2005

Exponential Growth or Decay – System Features, Diagrams, and Equations

• The solution to the rate equation is:R(t) = R0ekt

where: R0 is the value of R(t) at t = 0k = [Inflow Rate – Outflow Rate]

• So, we call it exponential growth because k is the rate constant, which appears in the equation as an exponent– k is the net growth or decay rate in the system– If k > 0, the system will exhibit exponential growth– If k < 0, the system will exhibit exponential decay– The ratio of change in the reservoir over one unit of time is ek,

i.e. in one time step, the reservoir changes from R(t) to ek * R(t)– The larger | k | is the more rapid the growth or decay

Page 21: Review - STELLA Model Elements · Review - STELLA Model Elements • Converters – These serve a utilitarian role in the software – They hold values for constants, define external

David Tenenbaum – GEOG 110 – UNC-CH Fall 2005

Exponential Growth or Decay – System Features, Diagrams, and Equations

•While the rate of change in the reservoir is slow initially in an exponential growth situation, and slow eventually in a exponential decay situation, it never quite reaches zero, but instead the reservoir value asymptotes at some value, and R(t) will asymptotically approach a steady state value of R = 0

| k | in Exponential Growth | k | in Exponential Decay