TKMM01 Manufacturing simulation …….…......…... Taylor ED

64
TKMM01 Manufacturing simulation

description

TKMM01 Manufacturing simulation …….…......…... Taylor ED. Starting up ED. Possible to download to your personal computers via the schools computers Works together with Windows 7 but without help files (run in compatibility mode with XP). Modeling in Taylor ED. - PowerPoint PPT Presentation

Transcript of TKMM01 Manufacturing simulation …….…......…... Taylor ED

Page 1: TKMM01 Manufacturing simulation …….…......…... Taylor ED

TKMM01

Manufacturing simulation

…….…......…...Taylor ED

Page 2: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Starting up ED

• Possible to download to your personal computers via the schools computers

• Works together with Windows 7 but without help files (run in compatibility mode with XP)

Page 3: TKMM01 Manufacturing simulation …….…......…... Taylor ED
Page 4: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Modeling in Taylor ED

• Objects queue up and are serviced by other objects

• Processing is modeled as a (stochastic) time step

• A model according to this principle is called a queuing network model

• The object or building block of Taylor ED:

ATOM

Page 5: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Atom Overview

• Everything is an Atom

• Resources and products are atoms

• Atoms can contain other atoms

• Atoms can be moved from atom to atom

• Atoms can be created and destroyed

• Atoms can inherit behavior from atoms

• 4 Dimensional

• x,y,z location

• time

Page 6: TKMM01 Manufacturing simulation …….…......…... Taylor ED
Page 7: TKMM01 Manufacturing simulation …….…......…... Taylor ED
Page 8: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Application Hierarchy

• Taylor ED

• Logistic suite application

• Library < model | create >

• modeling atoms

• functional atoms

• Model < model | edit >

• model atoms

• functional atoms

Contains mother atoms

Do not modify!!!

Page 9: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Building a Model

• <Model | Create> or

• drag atoms from library into the 2D model layout

• double and/or right click to edit atom parameters

• time always in seconds

• sizes always in meters

Page 10: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Moving around in a view

• Pan:

• press and hold left mouse button

• move around your mouse

• Zoom

• press and hold both left and right mouse button

• zoom in: move your mouse vertically up

• zoom out: move your mouse vertically down

• Change view angle (3D only)

• press and hold right mouse button

• move around your mouse: the center of the view window is your pivot point

Page 11: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Running a Model

• <model | run>, <Shift + F4> or to popup run control

• unlimited speed

• (synchro) real time

• slide control

• custom speed

• press reset and then run to start the simulation

Page 12: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Atom Channel Concept

• <View | Channels> to set the channel view Tip! Use Ctrl+R

• 0..n input/output channels

• Input and output channels are used to pass atoms or to reference to other atoms

• 1 central channel

• Central channel is used for referencing only

• Channels connect:

• one output is connected to one input channel

• multiple channels can be connected to the central channel

• connect to own central channel to delete the connection

Page 13: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Atom Channels

• <View | Channels> to

• connect by dragging mouse from dot to dot

• right click on channel dot: show current connections

• double click on channel dot: interactively change a connection

• create/delete channels by pressing the small plus “+” or minus “-” sign

• red: closed

• green: open

• Channels as arch or line

• <view | set | channels as arch>

• <file | preferences | visualization>

Page 14: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Atom Categories

• Baseclass (mother atoms) Do not change a mothers atom!

• “bare” atom, no functionality

• library atoms are created by adding functionality to a baseclass atom

• Daughter

• inherits functionality from it’s mother (original)

• when creating an atom by dragging, you create a daughter

• Duplicate

• direct copy

• there is no inheritance of functionality between the original and the copy

Page 15: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Library Tree <Shift + F2>

The treeview of the library, also the “Model Layout” window will pop up

• View:

• Atom Info: will display atom help

• VEG: will display Visual Editing Guide

• Tree

• refreshes, collapse or expand the treeview

• VEG

• visual editing guide: displays the active tree atom in a simple layout view

• autoscale, zoom in, zoom out

Page 16: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Model Layout Window

• Edit:

• cut, copy, paste and delete atoms

• set the rotation

• View:

• Channels and grid settings

• override display settings

• up <Ctrl+U> and down <Ctrl+D> in hierarchy (highest is the model level)

Page 17: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Library Contents

Page 18: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Part 1 Part 2 Part 3

Page 19: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Model Tree <Shift + F3>

The tree-view of the complete model

Menu is the same as the library tree plus

• Right or double click:

• atom specific: user interface

• general: standard parameters editing

• label: atom specific labels

• VEG is more useful here

Tip! Use Refresh (F5) to update the Model tree

Tip!

Use understandable names on your atoms

Page 20: TKMM01 Manufacturing simulation …….…......…... Taylor ED

2D/3D View

• 2D view

• Left mouse drag: pan through the view

• Both left and right mouse button drag:

• Up/down: zoom in/out

• 3D view Tip! Shift+F9

• Left mouse drag: pan through the view

• Right mouse drag:

• Left/right: rotate

• Up/Down : view angle

• Both left and right mouse button drag:

• Up/down: zoom in/out

Page 21: TKMM01 Manufacturing simulation …….…......…... Taylor ED

4DScript

Page 22: TKMM01 Manufacturing simulation …….…......…... Taylor ED

4DScript Overview

• 4DScript is a functional language:

• example: 1+2 is written +(2,1)

• 4DScript for everything

• model logic

• create atoms

• control Taylor ED from outside applications

• 4DScript is auto compiled during run-time

• In logistic suite mostly used to manipulate labels in triggers and conditional statements

Page 23: TKMM01 Manufacturing simulation …….…......…... Taylor ED

4DScript Syntax

• 4D Script words have 0..25 parameters

• Parameters between ( )

• Parameters separated by a comma: “ , ”

• Parameters can be:

• values

• strings

• expressions

• (4DScript) Strings always between square brackets “ [ .. ] ”

• Comments between { }

Page 24: TKMM01 Manufacturing simulation …….…......…... Taylor ED

4DScript Syntax

Quick example

setlabel(e1,e2,e3)

e1 – Name of the label, a string within [] brackets

e2 – Value, number -> plain text or string -> within [] brackets

e3 – Reference to location (c,i or reference functions e.g. in(1, c))

setlabel([testlabel], 44, i)

Page 25: TKMM01 Manufacturing simulation …….…......…... Taylor ED

4DScript Syntax

• Multiple lines and spaces

• NOT sensitive in 4DScript

• sensitive label or other naming

• Lower and/or upper case

• NOT sensitive in 4DScript

• sensitive label or other naming

• All brackets must match!

Tip!

Use tabs and new line when writing longer functions e.g.

do(

setlabel([blue], 1,i),

setlabel([green], label([blue],i), i),

setlabel([red],0,i)

)

Instead of writing

do(setlabel([blue],1,i),setlabel([green],label([blue],i),i),setlabel([red],0,i))

Page 26: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Atom Labels

• Also called dynamic database fields

• To read and write data on specific atoms:

• strings

• values

• Setting labels:

• setlabel(e1,e2,e3)

• Sets label e1 (string) of atom e3 (reference) to e2 (string or value)

• 4DScript “sddb” does the same

• Labels do not need to be declared

Page 27: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Atom Labels

• Query labels

• label(e1,e2,{e3})

• Returns label e1 of atom e2

• e3 is optional:

• e3=1 then always value is returned

• e3=2 then always string is returned

• 4DScript “ddb” does the same

• Name of the label is case sensitive

Page 28: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Atom Referencing

• About atom referencing

• In Entry and Exit triggers

• Direct referencing

• Relative referencing

Page 29: TKMM01 Manufacturing simulation …….…......…... Taylor ED

About atom referencing

• Referencing in Taylor ED is like using a pointer

• You need to reference other atoms to:

• get information or data from that atom

• send atoms or messages to other atoms

• To refer to an atom is in general always relative

• Relative referencing is used because:

• it is needed in an object oriented environment !!

• everything is an atom (model, product, machine…)

• it is fast

Page 30: TKMM01 Manufacturing simulation …….…......…... Taylor ED

In Entry/Exit Triggers

• Current “c” & Involved “i”

• ‘c’ is current atom or the atom where the statement is written on

• ‘i’ is the involved atom or the atom that triggered an eventhandler

i

c

Page 31: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Entry/Exit Triggers

Example Trigger on Creation in a Source ATOM

Page 32: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Direct Atom Referencing

• Sometimes Atoms can be referenced directly:

• library = library atom

• model = model atom

• treeatom = currently selected atom in treeview

• animatom = currently selected atom in 2D animation window

• atombyname([e1], e2) = atom with name e1 in container e2

• atombyID(e1, e2) = atom with ID-number in container e2 (e.g. model)

• if tables have aliases you can use the table name direct

Page 33: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Relative Atom Referencing

• All other referencing is relative: start from the atom where statement is written (=c):• first(e1) = first atom inside atom e1• last(e1) = last atom inside atom e1• next(e1) = the atom next of atom e1 in same

container• prev(e1) = the atom previous of atom e1 in same

container• up(e1) = container of atom e1• in(e1,e2) = atom connected to input channel e1 of

atom e2• out(e1,e2) = atom connected to output channel e1 of

atom e2• rank(e1,e2) = atom at position e1 in queue of atom

e2

Page 34: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Atom Statistics

Is available for every atom at any time:

• age - time from creation or reset

• content - current number of atoms contained in an atom

• avgcontent - average number of atoms contained in an atom since reset

• avgstay - average time (sec.) atoms have stayed in an atom since reset

• input - the number of atoms which have entered

• output - the number of atoms which have exited

• status - the state of an atom (see table of atom T029-Statuslist)

• entrytime - time (sec.) at which an atom has entered

Page 35: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Empirical Distribution Atom

• Maximum 50 records per distribution

• Use an alias name to assign the distribution direct

Page 36: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Table Atom

• Indirect referencing use:

• setcell(1,1,123,c)

• cell(1,1,c)

• Direct referencing use

• an alias name has been created eg: times

• settimes(1,1,123)

• times(1,1)

• Column and row 0 are the header columns and rows

• Index out of range will not give an error message, but results in the return of 0

Tip!If you need to create or use large

tables (larger then 100 rows or columns)

use local table instead of linking to excel table. This speeds up the

simulation.

Page 37: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Conditional Statements

• if(e1,e2,{e3})

• e1 = condition

• e2 = true logic

• e3 = false logic, not mandatory => 0 is returned

• and/or allowed in condition

Example: if(comparetext(label([ok],i),[yes]),

negexp(10),

negexp(50)

)

Page 38: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Multiple Statements

• “DO” - statement

• do(e1,do(e1..e25),..e25)

• maximum is 25 parameters

Example:do( setlabel([ok],[yes],i), setlabel([time],negexp(60),i))

Page 39: TKMM01 Manufacturing simulation …….…......…... Taylor ED

4DScript Editor Functionality

Tip!

Use check syntax (F10)

Page 40: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Repeat Statements

• loopuntil(e1,e2,e3)

• e1 = condition

• e2 = statements

• e3 = maximum repetitions

• use ‘count’ for the current number of loops made

• omitting e3 might result in endless loop

Page 41: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Repeat Statements

• repeat(e1,e2)

• e1 = number of repetitions

• e2 = statements

• use ‘count’ for the current number of loops made

repeat(

content(c),

stopatom(rank(count,c))

)

Page 42: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Statistical distributions

Use of statistics:

• Before simulation:

- determine the distributions

- goodness of fit

• During simulation:

- random numbers

- samples from a distribution

• After simulation:

- analysis of results

- reliability

Page 43: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Discrete Distributions

A discrete stochastic variable represents a countable number of possible values.

One particular value has a chance (greater than zero) of occurring.

0

5

10

15

20

25

30

35

40

1 2 3 4 5

chan

ce o

f x=

? i

n %

>

Page 44: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Bernoulli distribution

• Parameters in Taylor ED:

- probability in %

- result1

- result2

• A sample having result1 is equal

to probability,

result2 has a chance of

100% - probability.

Choice between two values: bernoulli(40,6,10)

0

10

20

30

40

50

60

70

6 10

Prob

abilit

y in

% >

Page 45: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Empirical distribution

Product mix, Route choices, Test passed,..

P(x) Value

15% 2

25% 7

20% 10

35% 12

5% 30

In Tayor ED you can use an alias name

0

5

10

15

20

25

30

35

40

2 7 10 12 30

chan

ce o

f x=?

in

%

>

Page 46: TKMM01 Manufacturing simulation …….…......…... Taylor ED

a b x>

dens

ity ƒ

(x)

Continuous Distributions

The chance of a sample, according to a certain distribution, results in a value between ‘a’ and ‘b’, is equal to the dark gray area.

The chance the sample will result in precisely ‘a’, is equal to zero.

Page 47: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Uniform Distribution

• Can be used if the information is global

• uniform(e1,e2)

a x > b

dens

ity ƒ

(x)

Page 48: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Normal Distribution

• Fluctuations around an average

• normal(e1,e2)

x >

dens

ity ƒ

(x)

>

Page 49: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Negative Exponential Distribution

• To model irregular (arrival) processes

• negexp(e1)

0 x >

dens

ity ƒ

(x)

Page 50: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Lognormal Distribution

• Asymmetrical “normal” distrubution

• Repair times and process times

• lognormal(e1,e2)

0 x >

dens

ity ƒ

(x) >

Page 51: TKMM01 Manufacturing simulation …….…......…... Taylor ED

More Distributions

• Continuous:

- Beta

- Gamma

- Triangular

- Weibull

• Discrete:

- Poisson

- Binomial

- Geometric

Page 52: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Typical Waiting Times

Waiting is :

• Time consuming

• Boring

• Expensive

Bottle neck process:

WaitingTime 90%

ProcessTime 10%

Page 53: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Influence Factors

• Fluctuations in arrivals

• Fluctuations in process times

• Priority rules

• Blocking

• Failures

• Availability

• Utilization

Page 54: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Theoretic Waiting Times

• Consider arrivals to be negative exponential distributed

• Define variance coefficient of processes:

• CV = standard deviation ÷ mean

• Two extremities:

• CV=0, constant distribution

• CV=1, chaos, negative exponential distribution

Page 55: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Average waiting time (Pollaczek-Kyntchin):

WT CV PT

12

211

( )( )

,

utilization

Waiting Time versus Utilization

0 10 20 30 40 50 60 70 80 90

Utilization in %

Wai

ting

time

>

low CV

high CV

Page 56: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Shortening Waiting Times

• Lower utilization

• More regular processes

• Parallel processes

• Controlled processing

• Less failures

• Smaller batches

Page 57: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Waiting

Waiting problems are actually waiting distributing problems.

Balance between:

- waiting of workstation

- waiting of products

- waiting of customers

Page 58: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Result Analysis• Shit in is Shit out

• Simulating more or longer, results in more reliable results

Page 59: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Analysis of Terminating Systems

• N different simulation runs => n independent values (new random seeds)

• Calculate confidence interval

Ask yourself if you have to simulate a system like a terminating system. It’s sometimes better to simulate a worst case scenario of the system.

Page 60: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Analysis of Steady State Systems

• When has a steady state been reached ?

• How long is the warm up period ?

Two formal methods:

• N different runs

• One long run divided into sub-runs

Page 61: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Warm-up Period

At the beginning of a simulation the system is normally empty.

0

50

100

150

200

250

300

350

400

0 20 40 60 80 100 120 140 160 180 200 220

Time >

Pro

duct

ion

per

hour

>

The production per hour will have the characteristics of this graph.

Page 62: TKMM01 Manufacturing simulation …….…......…... Taylor ED

N Different Runs

• Determine the warm up period.

• Simulate N different runs; every time the data from the warm-up period is disregarded.

The length of a run and the number of runs in total determine the confidence interval.

If the warm-up period is long, the sub-run method is preferred.

Page 63: TKMM01 Manufacturing simulation …….…......…... Taylor ED

Final Tip!

• Shit in is Shit out! - the result of the simulation is not better then the data you base your simulation on

• Test in small scale - When testing out new functions and atoms construct small systems and test the function there instead of import the new function or atom directly in to your “big” simulation system

• Use understandable names on atoms, labels etc.

• Use the help files or the 4DSkript Command list to understand functions and find new functions

• A simulation is a perfect model of the world, the world is not perfect!

Page 64: TKMM01 Manufacturing simulation …….…......…... Taylor ED

That is all!

Contact information: Kristofer Elo [email protected]