11
Tecnomatix Plant Simulation Worldwide User Conference 2016 Siemens Industry Software A short introduction to embedded optimization Tecnomatix Plant Simulation Worldwide User Conference June 22nd, 2016 Realize innovation. © Siemens AG 2016 © Siemens AG 2016 22.06.2016 Page 2 Siemens PLM Software A short introduction to embedded optimization Table of content 1. Simulation and Optimization 3 2. Genetic Algorithms 6 3. Basic Objects for Genetic Algorithms 9 4. Sequence Optimization 11 5. Optimization as an Integrated Component 16 6. Approximation Solutions for Stochastic Models 19

A short introduction to embedded optimization - Home - … · 2017-12-08 · A short introduction to embedded optimization ... Approximation Solutions for Stochastic Models 19

Embed Size (px)

Citation preview

Page 1: A short introduction to embedded optimization - Home - … · 2017-12-08 · A short introduction to embedded optimization ... Approximation Solutions for Stochastic Models 19

Tecnomatix Plant Simulation Worldwide User Conference 2016

Siemens Industry Software

A shortintroduction toembeddedoptimizationTecnomatix Plant SimulationWorldwide User ConferenceJune 22nd, 2016

Realize innovation.© Siemens AG 2016

© Siemens AG 2016

22.06.2016Page 2 Siemens PLM Software

A short introduction to embedded optimizationTable of content

• 1. Simulation and Optimization3

• 2. Genetic Algorithms6

• 3. Basic Objects for Genetic Algorithms9

• 4. Sequence Optimization11

• 5. Optimization as an Integrated Component16

• 6. Approximation Solutions for Stochastic Models19

Page 2: A short introduction to embedded optimization - Home - … · 2017-12-08 · A short introduction to embedded optimization ... Approximation Solutions for Stochastic Models 19

Tecnomatix Plant Simulation Worldwide User Conference 2016

Siemens Industry Software

© Siemens AG 2016

22.06.2016Page 3 Siemens PLM Software

1. Simulation and Optimization

Connections of Simulation and Optimization

1. The simulation is used as evaluation function ofoptimization

We are looking for optimal parameters for a model.By systematic changes of parameters we candetermine a satisfactory model configuration.

2. The optimization is an integrated component of asimulation.

A parent simulation is interrupted and an optimizationof the current state is performed.

A further structural connections is theuse of simulation results as starting values for anoptimization.Such optimization is possibly based on purecalculations.

Optimizer Model

Modification

Evaluation

Simulationtime

Optimizer

See Chapter 11: L. Iitzsche, P. Schmidt, S, Völker in Lothar März, Winfried Krug, Oliver Rose, Gerald Weigert (Hrsg.) Simulation und Optimierung in Produktion und Logistik

© Siemens AG 2016

22.06.2016Page 4 Siemens PLM Software

1. Simulation and Optimization

Characteristic properties of OptimizationProblemsIn most applications multiple targets are consideredwhich have opposite natureand must be described in a single numericalevaluation value.

Combination of several input parameter settings1. Determination of sequences2. Dimensioning of production resources.

We distinguish so called basic tasks1. Sequence tasks (find a numbering of a finite set)2. Allocation tasks (find a value of a finite range).

Solving of Trade-off

1. Reduce throughput timesby prevention of waiting time

2. Just-in-time delivery

3. Reduction of the warehouse stockand associated costs

Page 3: A short introduction to embedded optimization - Home - … · 2017-12-08 · A short introduction to embedded optimization ... Approximation Solutions for Stochastic Models 19

Tecnomatix Plant Simulation Worldwide User Conference 2016

Siemens Industry Software

© Siemens AG 2016

22.06.2016Page 5 Siemens PLM Software

1. Simulation and Optimization

Exact and Heuristic Methods for OptimizationProblems

Basic tasks are well examined in OperationsResearch.The algorithms Branch & Bound and DynamicProgramming for the Traveling Salesman Problem aredescribed in theExample Collection (open via the Start Page).

For basic tasks with practical important problem sizeand combined tasks there are no efficient algorithms,which find the optimal solution in reasonablecomputational time.

Therefore heuristic methods are used, like Hill-Climbing, Simulated Annealing, Tabu Search andGenetic Algorithms (shorted by GA).

© Siemens AG 2016

22.06.2016Page 6 Siemens PLM Software

2. Genetic Algorithms

Genetic Algorithms are iterative stochastic searchalgorithms based on natural mechanisms of thebiological evolution.

GA operate on a set of solutions of a combined basicproblems.

The notions Generation, Individuals andChromosomes

All solutions, which are currently under considerationin a certain optimization step, form a Generation.

A solution of the combined task is called anIndividual.

A solution of an basic task is considered asChromosome.

All properties of livingorganisms are coded in thebiologic material DNA in asequential manner.

Page 4: A short introduction to embedded optimization - Home - … · 2017-12-08 · A short introduction to embedded optimization ... Approximation Solutions for Stochastic Models 19

Tecnomatix Plant Simulation Worldwide User Conference 2016

Siemens Industry Software

© Siemens AG 2016

22.06.2016Page 7 Siemens PLM Software

2. Genetic Algorithms

The Ideas and the Structure of Genetic AlgorithmsGenetic Algorithms model natural processes of theevolution.

The Fitness of the individuals describes, how well it isadapted to the environment. This evaluation isdetermined by the combination of their elementaryproperties.The Fitness can be determined by simulation orcalculation.

1. Recombination: Use of properties of previousgeneration (Selection of 2 Parents according to thefitness)

2. Mutation: Generate 2 children per familyby random application of Genetic Operations,like Crossover, Mutation, Inversion

3. Selection: Select one offspring per family (child or

Terminationcondition

Evaluation

Initialization

Evaluation

Offspring selection

Parent selection

Genetic Operators

Stop

The Evolution Cycle

© Siemens AG 2016

22.06.2016Page 8 Siemens PLM Software

2. Genetic Algorithms

The number of resulting evaluations

Each new generated individual must be evaluated.The first generation has the Generation sizeindividuals.All following generations have Generation sizefamilies.Each family has 2 children, which must be evaluated.

Please note, that in a stochastic simulation study anevaluations needs more than 1 simulation runs(observations).

Number of evaluations = Generation size * (2 * Number ofGenerations - 1)

Page 5: A short introduction to embedded optimization - Home - … · 2017-12-08 · A short introduction to embedded optimization ... Approximation Solutions for Stochastic Models 19

Tecnomatix Plant Simulation Worldwide User Conference 2016

Siemens Industry Software

© Siemens AG 2016

22.06.2016Page 9 Siemens PLM Software

Five Basic Objects for the Optimization by GAThe controller GAOptimization• Number and size of generations,• Direction of the optimization (minimum or maximum)• Termination condition• Definition of the selection of parents and offspring• Controls, such as for the fitness calculation• Recording of generated individuals

The other four objects are GA tables for basic tasks and its GeneticOperators.

GASequence: Sequence task for a given number of itemsGASelection: Selection task of a certain number of elements a givennumber of itemsGARangeAllocation: Determine an item of a range between two boundsGASetAllocation: Determine an item of a set of elements

3. Basic Objects for Genetic Algorithms

© Siemens AG 2016

22.06.2016Page 10 Siemens PLM Software

3. Basic Objects for Genetic Algorithms

How do the Basic Objects workDetermine the maximum of Rastigrin´s Function:

GA are well suited for problems with multiple peaks with similarfitness.

In our examples we have four maxima (± 0.5, ± 0.5) with thesame value 21,5.

Fitness = 20 – u*u - cos(2*pi*u) – v*v - cos(2*pi*v) for-1 < u,v < 1

The picture is generated by:www.wolframalpha.com

Page 6: A short introduction to embedded optimization - Home - … · 2017-12-08 · A short introduction to embedded optimization ... Approximation Solutions for Stochastic Models 19

Tecnomatix Plant Simulation Worldwide User Conference 2016

Siemens Industry Software

© Siemens AG 2016

22.06.2016Page 11 Siemens PLM Software

4. Sequence Optimization

We will find the sequence of the Delivery table of thesource,such that the throughput time for the given orders isminimal.The throughput time is determined by the setupmatrix.

For this example the resulting throughput time is8 + 1 + 6 + 2 + 2 + 3 + 3 + 9 + 4 + 4 = 42.The optimal solution is obvious.

The Plant Simulation model for adeterministic studyin English class libraryis generated by executing a method

Start Plant Simulation with the shortcut option/UILanguage:ENU.

Create a model with model language English.Select the Menu File > Preferences > Tab General.

© Siemens AG 2016

22.06.2016Page 12 Siemens PLM Software

4. Sequence Optimization

The evaluation of a sequence is done by simulation.For the optimization we apply the GAwizard.

The fitness calculation can be definedas a weighted sum of multiple simulationresults in the table Fitness.Drag & Drop the Eventcontroller onto the GAwizard.

There are no general recommendations for theparameters of the Genetic Algorithm.For sequence tasks a generation size between 50 and 70 issuitable.

Page 7: A short introduction to embedded optimization - Home - … · 2017-12-08 · A short introduction to embedded optimization ... Approximation Solutions for Stochastic Models 19

Tecnomatix Plant Simulation Worldwide User Conference 2016

Siemens Industry Software

© Siemens AG 2016

22.06.2016Page 13 Siemens PLM Software

4. Sequence Optimization

Press the Shift-Key andDrag & Drop the Delivery tableof the source onto the GAwizard.

The optimization is startedon the second tab of the GAwizard.

The results of the optimizationcan be displayed on the third tab.

© Siemens AG 2016

22.06.2016Page 14 Siemens PLM Software

4. Sequence Optimization

After the optimization the best solution which wasfound is set in the model. You find the best differentsolutions on the third tab.

Page 8: A short introduction to embedded optimization - Home - … · 2017-12-08 · A short introduction to embedded optimization ... Approximation Solutions for Stochastic Models 19

Tecnomatix Plant Simulation Worldwide User Conference 2016

Siemens Industry Software

© Siemens AG 2016

22.06.2016Page 15 Siemens PLM Software

4. Sequence Optimization

Visualization the Optimization ProgressThe Performance Graph shows a typical appearanceofGenetic Algorithms. It is opened by the buttonEvolution.The worst individual in a generation also improvesif a better individual is found.

© Siemens AG 2016

22.06.2016Page 16 Siemens PLM Software

5. Optimization as an Integrated Component

Sequence Optimization during the simulation

Scenario and TargetIn a line of two types of products are produced.The arrival process of the products is at random.To achieve an uniform utilization of followingresourceslong partial sequences of single products type shouldnot occur.During the production process the sequence isoptimized.

IdeaIn a buffer (modeled by the basic object Sorter)multiple products are collected.For this purpose the entrance and the exit of thebuffer are controlled by an Observer method for thevalue numMU.

Page 9: A short introduction to embedded optimization - Home - … · 2017-12-08 · A short introduction to embedded optimization ... Approximation Solutions for Stochastic Models 19

Tecnomatix Plant Simulation Worldwide User Conference 2016

Siemens Industry Software

© Siemens AG 2016

22.06.2016Page 17 Siemens PLM Software

5. Optimization as an Integrated Component

Online-OptimizationIf at the beginning of a simulation not all data areavailablethen multiple sequencings are necessary.This leads to smaller number of items of the sequencecompared to the full size of the problem.

Evaluation by RulesUnwanted sequences are evaluated by a bad fitness.The evaluation of a sequence is done by one or morecriteria and is performed by rules.The result of a rule describes the penaltyfor the considered sequence:

See Chapter 17: C. Heib, S. Nickel in Lothar März, Winfried Krug, Oliver Rose, Gerald Weigert (Hrsg.) Simulation und Optimierung in Produktion und Logistik, Springer

for local j := 1 to sequence.yDim - 1 loopif sequence[1, j].name = sequence[1, j+1].name then result :=

result + 1 end;next;

© Siemens AG 2016

22.06.2016Page 18 Siemens PLM Software

5. Optimization as an Integrated Component

Result: The Line which succeed the Buffer shows short partial sequences of singleproducts.

Page 10: A short introduction to embedded optimization - Home - … · 2017-12-08 · A short introduction to embedded optimization ... Approximation Solutions for Stochastic Models 19

Tecnomatix Plant Simulation Worldwide User Conference 2016

Siemens Industry Software

© Siemens AG 2016

22.06.2016Page 19 Siemens PLM Software

6. Approximation Solutions for Stochastic Models

• By the model we consider a combinationof a sequence and parameter optimizationof a stochastic simulation study.

• It is impossible to solve an optimizationproblemfor a stochastic model.

• But in practice approximation suboptimalsolutions are frequently sufficient.

© Siemens AG 2016

22.06.2016Page 20 Siemens PLM Software

6. Approximation Solutions for Stochastic Models

The definition of the combined optimization problem.

Since we want to minimize the throughput timeand the buffer capacity we weight their values.

Since there are random components,we perform 5 observations per individual.

Page 11: A short introduction to embedded optimization - Home - … · 2017-12-08 · A short introduction to embedded optimization ... Approximation Solutions for Stochastic Models 19

Tecnomatix Plant Simulation Worldwide User Conference 2016

Siemens Industry Software

© Siemens AG 2016

22.06.2016Page 21 Siemens PLM Software

Thank you for your attention!

Dr. Peter-Michael SchmidtQA LeaderGroup Plant Simulation / Germany/ R&D

Weissacher Straße 1170499 Stuttgart

Phone: +49 711 13 89 266Fax: +49 711 13 89 299Mobile: +49 1577 1593699

E-mail:[email protected]

siemens.com