SIMUL8 Corp


 
support.SIMUL8.com
  Back Issues
Learning Zone
Cafe
Templates
Components
Training
Register
support.SIMUL8.com
 
What do you think of this issue?

Poor
Good
Great


Welcome to this month's newsletter! In this issue you'll find:


How Simulation Works by Mark Elder

You don't need to know how simulation software works to create and use a simulation. However, understanding a little about how something works usually gives the whole task more sense.

So I am going to tell you what's inside a simulation:

There are three important classes of data in a simulation and two important actions required by the computer for the simulation run.

In the past, building simulations depended on writing a program that described all of the items below. Until the mid-1960s simulation was actually done by hand, with dice for variability and game tokens for products. The Steel Company of Wales, in the UK, was the first to use it in a computerized form. There was no animated display, no interactive user interface, and you had to hard code all your simulation in a language like FORTRAN. Now most of what is below is hidden by simulation systems that make simulation easy.

The three classes of data:

1) Clock:

A time clock that represents 'simulated time'. For those of you who program, this is simply a variable in the computer's memory. This changes on the screen as events take place in the simulation. The time might be measured in seconds (quite common in a factory simulation where the length of jobs you are doing might be measured in minutes and parts of minutes), but could be weeks (if you were simulating a major construction project) or microseconds (if you were simulating the performance of some electronics).

2) A list of future events:

An 'event' in a simulation changes the state of some part of the simulation into a new state at a particular time (for example machine 21 in the factory will finish welding the side on a box 5 minutes after it starts). The list of future events contains those events that will happen at predetermined times and about which the simulation already knows. At any given time the simulation will only know about a small number of the events which will actually occur - for example it will not know about the machine finishing welding the box until it has started to weld the box. You can view this future list using SIMUL8's Step-by-Step Monitor.

3) Current state records:

A record of the current state of everything in the simulation that can ever change state. For example, "machine 21 is currently welding the side on a box and that this is the 7th box it has welded this morning" (we need to know this because it will need cleaning after welding 10 boxes).

That is all the data we need.

What are the actions?

The clock is set to zero at the start of each run of the simulation (this is often translated on the screen to a more meaningful real time like "8:00 am". Then the computer repeatedly takes the following two actions until the clock reaches a number that represents the length of time you want the simulation to run:

1) The computer looks at the list of future events (2 above) and decides which comes first (they all have a time label on them). The computer then changes the clock to read that time.

2) The computer then executes the corresponding event. This is simply a matter of adjusting the states (3 above) in whatever way is appropriate for the type of event (for example, the machine is now idle, having finished welding the box). The computer then adds to the list of future events any new events it now knows will happen (and perhaps also changes states too). For example, as there is another box waiting to be welded, the machine is set into a busy state again and another 'finish weld' event is added to the list of future events. During all this activity the time clock has been static.

Now the computer starts over again and looks at the list of future events to see what time to next set the clock to.

Although the above comes in many disguises, all simulation systems work this way.

Most simulation packages will actually contain rather more data classes than I listed above. An obvious category is statistical information collected as the simulation is running. (Remember that one of the reasons we are using a simulation is probably because we are looking at the potential performance of a new factory, or whatever we are simulating. So some statistics on how it is performing could be worthwhile).

Another important category of information contained in a simulation relates to the display. For example, where to display the machines and what they should look like and how their appearance should change when in different states (working, idle, broken down, being cleaned etc.).

Handling Variability

What the above omits to mention is that one of the main benefits of simulation is its ability to model things the way they happen (or don't happen) in real life. For example, a machine may be supposed to be able to weld one box every 5 minutes but in practice there will be some variability around this. More variability will be experienced in how often the customers call the factory to place orders for boxes.

Simulation handles this type of variability, or randomness, by generating 'random numbers' (or numbers that appear to be random: known as pseudo-random-numbers). Numbers that are really random could be generated with expensive add on computer cards that use radioactive sources as a method of collecting really random data. However, pseudo-random-numbers are much more convenient for the purposes of simulation.

Using pseudo-random-numbers means that if you set the time clock back to zero and rerun the simulation you will see exactly the same things happen as the last time that you ran the simulation. This is because pseudo random numbers are generated mathematically and simply appear to be random. Each time the mathematical algorithm is restarted, the same sequence of numbers will be generated. This is very useful because it means you can re-watch a simulation several times to understand exactly what is happening. All simulation packages allow you to change the random numbers so you can also see what happens when the random numbers are different. They do this by allowing you to set the 'stream' of random numbers that will be used. Most packages have many thousands of 'streams' of random numbers built into them so there is no limit on the number of different runs you can simulate of your business.

That is all you need for simulation!

This makes it all sound a bit easy - its not. There are lots of clever solutions that have to be invented for avoiding problems of detail in simulation engines. For example, computers create "rounding errors" when adding numbers together. It is very important that rounding errors don't impact simulation results. So lots of time goes into creating simulation engines that handle rounding errors in an appropriate way. This article wasn't intended to give you enough knowledge to build your own simulation tool (we don't want any more competitors!) but hopefully it should give you a little insight and make SIMUL8 seem a little less like a black box of magic.


Free Downloads

Our website is always being updated with new support resources. Here are details on some of the downloads that were added this month.

New Service Pack Build 612
A new service pack for SIMUL8 R10 has been released. SIMUL8 10.0.0 612 fixes a few issues including a problem that meant a crash could be caused if some breakdowns used resources and some didn't.
Download the Service Pack | Full Details of What's in the Service Pack

New Learning Zone Model - Limit what work is processed
This example simulation shows how to build a simulation where there are 2 types of work processed at the a work center. Each type is processed in specific batch sizes - 10 of Type A before starting work on 15 of Type B, then 10 of Type A, and so on.
Download the Example

New Learning Zone Model - Work entry point has shorter working day
This example simulation shows how to build a simulation where arrivals into the simulation stop after a certain time each day but the rest of the process continues working until later in the day. E.g. a bank closes it's doors at 5pm but continues to serve customers already in the bank until 5.30. It then opens it's doors again at 9am the next day
Download the Example


Hints and Tips

  • Did you know that you can add a variable from the Information Store to the Results summary by right clicking on it in the Information Store and selecting ADD TO RESULTS SUMMARY.

  • The MOD function in SIMUL8 is a little known feature but very useful. MOD returns the remainder when one number is divided by another. For example MOD(4,3) returns 1. This is really useful, for example, if you have some time check logic that you need to run every hour but some you need to only run every 15 minutes. The MOD function is accessed through the formula editor using the button with "\" on it.

If you any questions about these tips or anything else to do with SIMUL8 email support@SIMUL8.com we'd be happy to help you out. (Remember technical support is free!)


SIMUL8 R11 Released

Upgrade for:

SIMUL8 Standard- Overview Window, Calendars and and the ability to edit multiple Visual Logic Sections.
SIMUL8 Professional - Apply Changes, Debugger Toolkit including Value Tips and Spreadsheet Monitoring.

Special Offer: Upgrade from SIMUL8 Standard to SIMUL8 Professional, normally $2995, $1995 for May only.

Buy Now | Upgrade Pricing Guide | Feature Tour



Jobs at SIMUL8 in Europe

For our Glasgow based European HQ we are recruiting in the following departments. Get in touch if you are interested.

  • Experienced business development people with technical-new-business skills in selling high value consulting and software site and corporate licenses (not necessarily Glasgow based)
  • C++ and C# skilled simulation software engineers
  • Operational Research Consultants (preferably with experience in simulation) (not necessarily Glasgow based)

If you have any questions generated from, or comments about this newsletter then email Newsletter@SIMUL8.com

You are receiving this e-mail because you subscribed or are a registered SIMUL8 user. To unsubscribe click here.