### Archive

Author Archive

Conveyors are useful model elements for representing pipelines or processes that take a certain amount of time to complete.  However, adding a leakage flow to a conveyor can make it difficult to initialize a model in steady-state.  The following discussion will explain how to initialize conveyors with leakage in steady-state.  Please refer to the model structure below while reading this discussion.

These additional variables will be also used:

transit_time = TRANSTIME(conveyor)
conveyor_length = transit_time/DT
leakage_fraction = the user-specified leakage fraction

Linear Leakage

The default leakage is linear in behavior.  The total amount that leaks across the length of the conveyor is directly proportional to the inflowing amount.  The leakage fraction is the constant of proportionality.  Thus, the fraction of inflowing material that makes it to the conveyor’s outflow is exactly

1 – leakage_fraction

Given the sample model structure above, to achieve equilibrium, conveyor_outflow must equal outflow.  For this to happen, we need to set the inflow as follows:

inflow = outflow/(1 – leakage_fraction)

The conveyor’s steady-state value is then:

conveyor = transit_time*inflow – (conveyor_length – 1)*leakage*DT/2

where the initial value of leakage is:

leakage = leakage_fraction*inflow

This must be calculated outside the program and entered as a constant into the conveyor as conveyors cannot be given equations (they can, however, be set to a the value of a single converter, but you must be careful how you calculate this to avoid circularity).

Exponential Leakage

Optionally, leakage can be made exponential.  The amount that leaks each DT is proportional to the amount remaining in the conveyor.  In this case, the leakage fraction is the fraction that leaks each unit of time so, for long conveyors, a lot of material can leak away.  Given the transit time, the fraction of inflowing material that makes it to the conveyor’s outflow is approximately

1 – (1 – leakage_fraction)^transit_time

Given the sample model structure above, to achieve equilibrium, conveyor_outflow must equal outflow.  For this to happen, we need to set the inflow as follows:

per_dt_no_leak = 1 – leakage_fraction*DT
inflow = outflow/(per_dt_no_leak^conveyor_length)

For steady-state, the conveyor itself must then be set as follows:

conveyor = (inflow*DT)*(1 – per_dt_no_leak^conveyor_length)/(1 – per_dt_no_leak)

Categories: Modeling Tips Tags:

## Converting a Sector-based Model to Modules

I generally do not use modules to build very small models (only a couple of stocks and flows), which may then lead me to use sectors as the model grows because they are very convenient.  By the time I have three sectors, though, it starts to become clear that I should have used modules.  I will then need to convert my sector-based model into a module-based model.  Historically, I also have a number of sector-based models that are crying to be module-based.

Converting from sectors to modules is not very difficult:

1. Make sure there are no connections or flows between sectors.  Replace any of these with ghosts in the target sector.
2. In a new model, create one module for every sector.
3. Copy and paste the structure from each sector into its corresponding module.
4. Connect the modules:  At this point, the model structure has been rearranged into modules, but none of the modules are connected.  The ghosts that were in the sectors became real entities when they were pasted into the modules.  Go back to identify all of these connections and reconnect them in the module-based model.

Stepping Through a Sample Model

Let’s walk through an example.  A small sector-based model is shown below (and is available by clicking here).

This model violates what I would call good sector etiquette:  there are connectors that run between the sectors.  This is often useful in a small model such as this because it makes the feedback loops visible.  However, in a larger model, this can lead to problems such as crossed connections and difficulty in maintaining the model because sectors cannot be easily moved.

Categories: Modeling Tips Tags:

## Modeling Bass Diffusion with Rivalry

This is the last of a three-part series on the Limits to Growth Archetype.  The first part can be accessed here and the second part here.

Last time, we explored the effects of Type 1 rivalry (rivalry between different companies in a developing market) on the Bass diffusion model by replicating the model structure.  This part will generalize this structure and add Type 2 rivalry (customers switching between brands).

Bass Diffusion with Type 1 Rivalry

To model the general case of an emerging market with multiple competitors, we can return to the original single company case and use arrays to add additional companies.  In this case, everything except Potential Customers needs to be arrayed, as shown below (and available by clicking here).

For this example, three companies will be competing for the pool of Potential Customers.  Each array has one-dimension, named Company, and that dimension has three elements, named A, B, and C, one for each company.  Although each different parameter, wom multiplier, fraction gained per \$K, and marketing spend in \$K, can be separately specified for each company, all three companies use the same values initially.  All three companies, however, do not enter the market at the same time.  Company A enters the market at the start of the simulation, company B enters six months later, and company C enters six months after that.

Recall that the marketing spend is the trigger for a company to start gaining customers.  Thus, the staggered market entrance can be modeled with the following equation for marketing spend in \$K:

STEP(10, STARTTIME + (ARRAYIDX() – 1)*6)

The STEP function is used to start the marketing spend for each company at the desired time.  The ARRAYIDX function returns the integer index of the array element, so it will be 1 for company A, 2 for company B, and 3 for company C.  Thus, the offsets from the start of the simulation for the launch of each company’s marketing campaign are 0, 6, and 12, respectively.

This leads to the following behavior:

Note that under these circumstances, the first company to enter the market retains a leadership position.  However, companies B and C could anticipate this and market more strongly.  What if company B spent 50% more and company C spent 100% more than company A on marketing that is similarly effective?  This could be modeling by once again changing the equation for marketing spend in \$K, this time to:

STEP(10 + (ARRAYIDX() – 1)*5, STARTTIME + (ARRAYIDX() – 1)*6)

Categories: STELLA & iThink Tags:

## Developing a Market Using the Bass Diffusion Model

This is part two of a three part series on Limits to Growth.  Part one can be accessed here and part three can be accessed here.

In part one of this series, I explained the Limits to Growth archetype and gave examples in epidemiology and ecology. This part introduces the Bass diffusion model, an effective way to implement the capture of customers in a developing market. This is also used to implement what Kim Warren calls Type 1 rivalry in his book Strategy Management Dynamics, that is, rivalry between multiple companies in an emerging market.

The Bass Diffusion Model

The Bass diffusion model is very similar to the SIR model shown in part one. Since we do not usually track customers who have “recovered” from using our product, the model only has two stocks, corresponding loosely to the Susceptible and Infected stocks. New customers are acquired through contact with existing customers, just as an infection spreads, but in this context this is called word of mouth (wom). This is, however, not sufficient to spread the news of a good product, so the Bass diffusion model also includes a constant rate of customer acquisition through advertising. This is shown below (and can be downloaded by clicking here).

The feedback loops B1 and R are the same as the balancing and reinforcing loops between Susceptible and Infected in the SIR model. Instead of an infection rate, there is a wom multiplier which is the product of the Bass diffusion model’s contact rate and the adoption rate. If you are examining policies related to these variables, it would be important to separate them out in the model.

The additional feedback loop, B2, starts the ball rolling and helps a steady stream of customers come in the door. If you examine the SIR model closely, you will see that the initial value of Infected is one. If no one is infected, the disease cannot spread. Likewise, if no one is a customer, there is no one to tell others how great the product is so they want to become customers also. By advertising, awareness of the product is created in the market and some people will become customers without having encountered other customers who are happy with the product.

The behavior of this model is shown below. Note it is not different in character from the SIR model or the simple population model.

Categories: STELLA & iThink Tags:

## Limits to Growth

This is the first of a three-part series on the Limits to Growth Archetype.  The second part can be accessed here and the third part here.

The Limits to Growth Systems Archetype, also known as Limits to Success, combines growth with an exogenous or endogenous limit.  This Systems Archetype was formally identified in Appendix 2 of The Fifth Discipline by Peter Senge (1990), but made its first prominent appearance in World Dynamics by Jay Forrester (1971) and then The Limits to Growth by Meadows, Meadows, Randers, and Behrens (1972).  The Causal Loop Diagram (CLD) is shown below.

Real growth processes have inherent limits to growth.  Identifying these limits can help avoid problems in the future, whether the problem is overpopulation, increasing demand for a product that cannot be met, or growing a business in a mature market.  When growth is desired, but limited, it is always better to find ways to increase the limit before pushing for more growth.  Excessive growth in the face of a limit often leads to collapse.  Driving the system to the point of collapse can erode the ability to continue after the collapse, for example, by reducing the production capability of a piece of farmland or destroying the reputation of a company.

Classic examples of limits to growth include:

• The collapse of the deer population on the Kaibab plateau and on St. Matthew Island due to overpopulation and the attendant overgrazing of their habitat
• The overshoot and collapse of the human population on Easter Island
• Overgrazing in the Sahel region of Africa by cattle herders
• Overfishing of the oceans by fishermen
• The collapse of People Express due to sharp customer growth combined with slow personnel growth
• The sharp exodus of America Online subscribers after an intense marketing campaign increased the number of subscribers far beyond their capacity
• The contraction of the world economy in 2008 due to limiting oil supplies
• The productivity of staff deteriorating as a company grows, due to increased interactions and reporting overhead
• Business growth limited by the size of the potential market
• Yeast cells in the fermentation process, who suffer from both the loss of exogenously supplied sugar and the increase of endogenously produced pollution
Categories: STELLA & iThink Tags:

## Modeling Customers Switching Between Brands – The General Case

This is the last installment of a four-part series.  The first three parts can be accessed by clicking on the links below.
Methods for Using Arrays Effectively

Modeling a Watershed with Arrays
Modeling Customers Switching Between Brands

Generalizing the Model

When I showed Steve Peterson (at Lexidyne) my brand switching model, he told me there is a more general version that separates the customer loss fraction from the fraction won by another competitor.  This has been presented in Pharmaceutical Product Strategy by Mark Paich, Corey Peck, and Jason Valant.

In my original formulation, the switching probability matrix was the product of these two variables.  However, in many practical cases, the data available comes from two different places and reflects these two separate components.  The revised model structure is shown below.

Instead of one composite switching probability, this model uses a switching out probability that is distinct from the switching in probability.  The switching out probability is a one-dimensional array that, for each product, contains the fraction of customers lost to rivals every time unit (in our case, month).  A sample for the five brands A, B, C, D, and E appears below.

 Brand Fraction Lost A 0.091 B 0.170 C 0.046 D 0.026 E 0.071

switching out probability

We can see from this table that Brand B is losing 17% of its customers to rivals each and every month!  Whoever is managing that product had better do something quickly.

The other side of the story has to do with which brand the customers are switching to.  The switching in probability matrix contains, for each brand, the fraction of lost customers that migrate to a rival brand.  Thus, each row of this matrix must add up to one (100% of lost customers).  A sample appears below.

 From\To A B C D E A 0.00 0.11 0.33 0.55 0.01 B 0.18 0.00 0.29 0.41 0.12 C 0.22 0.02 0.00 0.44 0.32 D 0.04 0.00 0.77 0.00 0.19 E 0.02 0.07 0.28 0.63 0.00

switching in probability

Note the diagonal will always be zero.

We can determine a lot of things from this table.  For example, brand B offers no competition to brand D, brand D is the biggest rival of all the other brands, and brand C is brand D’s biggest rival.

Categories: Modeling Tips Tags:

## Running Mean and Standard Deviation

This is an update to post published on August 31, 2009.  The attached model was updated to find negative means and an alternate method was included at the end.

I am frequently asked which built-in function gives either the running mean or running standard deviation of a model variable.  Unfortunately, there is no such built-in at this time (no, that is not what MEAN() does).

Luckily, however, we can replicate the behavior we desire from built-in functions by creating a reusable module.  I can create a module that calculates a running average and a running standard deviation from any model variable.

When building a reusable module component, it is important to carefully define what the input to the module will be (i.e., what are the parameters to the built-in function) and what the output of the module will be (i.e., what is the result or return value of the built-in function).  In this particular case, the input will be the variable whose running average or running standard deviation we wish to find.  There are two outputs:  the running average and the running standard deviation.  Note we do not have to use both outputs all the time.

Thus, our new module can be used as shown below:

Note the name of the module was chosen to give a meaningful context to the running mean and standard deviation variables, which have fixed names defined inside the reusable module.  As in this example, it is always a good idea to give the module outputs general names that make sense when qualified by a context (the module name).

The reusable module itself was built and tested in iThink, and can also be used in STELLA.  The input parameter was given an equation to allow the model to be completely tested and debugged before being reused.  The model appears below and can be downloaded by clicking here.

Note the input to the module is named value.  After importing the module, this will need to be assigned to the variable in question, Cash in the above example.  This can be done from outside the module by right-clicking on Cash and choosing “Module->Assign to”, or right-clicking on value and choosing “Module->Assign Input to”.  The outputs can be assigned in a similar way, or the Ghost tool can be used.

This method, while relatively easy to understand, does accurately compute the standard deviation when the mean of the running sum of squares is close in magnitude to the running mean squared.  An alternate method that does not suffer this problem was developed by Welford in 1962 and is implemented in the model that can be downloaded by clicking here.

Finally, I am including a simple reusable module that finds the maximum value of a model variable across the entire run of a simulation.  It can be downloaded by clicking here.  It uses a stock to hold the maximum value seen so far, and takes advantage of the fact that uniflows cannot be negative.  It is used the same way as the running mean and standard deviation module, but only has one output called maximum.

For more information about modules, consult the iThink and STELLA help files.  These on-line resources are also available:

Using Modules Webinar

Module FAQs

Categories: Modeling Tips Tags:

## Modeling Customers Switching Between Brands

September 30th, 2009 1 comment

This is the third installment of a four-part series.  The other three parts can be accessed by clicking on the links below.
Methods for Using Arrays Effectively

Modeling a Watershed with Arrays
Modeling Customers Switching Between Brands – The General Case

In the second post of this series, I showed how to selectively pull information from an array in order to route water through a watershed.  In this post, I will use the exact same technique to move customers between different product brands.

Switching Customers between Different Products

Business models often need to model gaining customers from, and losing customers to, competing products in a relatively mature market (what Kim Warren, in his excellent book Strategy Management Dynamics, calls “Type 2 Rivalry”).  These are often driven with statistical models developed through market research.  For this application, we need a matrix describing the probability of switching from product A to product B each time unit.  A sample appears in the table below.

 From\To A B C D E A 0.000 0.010 0.030 0.050 0.001 B 0.030 0.000 0.050 0.070 0.020 C 0.010 0.001 0.000 0.020 0.015 D 0.001 0.000 0.020 0.000 0.005 E 0.001 0.005 0.020 0.045 0.000

switching probability (units: dimensionless)

To read this table, locate the product the customer is presently using in the left column (say, B).  Read across that row (the second row, in this case) until you find the product the customer is switching to (say, C).  The number in that cell (in this case, 0.05 or 5%) is the probability the customer will switch from the first product to the second (from B to C) in this time unit.  If the model is running in months, as ours is, this table indicates that 5% of customers using product B switch to product C every month.

Of course, the values in the table do not need to be constant.  Often each cell will contain a regression equation based on various product characteristics – including market share, marketing effort, product features, and product quality – that evolve over the course of the simulation.

Note the diagonal is zero.  This means customers do not switch from one product to the same product.

Note also that the sum in any row cannot exceed 1.0, which represents 100% of the customers using that product.  It is quite normal for it to be below 1.0 because we do not include people who are not switching.  Some modelers find it easier to always have each row add up to 1.0.  If you desire to do this, fill the diagonal with the difference between 1.0 and the sum of the other columns.  For example, to do this for product A, replace the top left cell with 1.0 – (0.01 + 0.03 + 0.05 + 0.001) = 0.909 [for you Beatles fans].

Categories: Modeling Tips Tags: