195
Eindhoven University of Technology MASTER Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer This document contains a student thesis (bachelor's or master's), as authored by a student at Eindhoven University of Technology. Student theses are made available in the TU/e repository upon obtaining the required degree. The grade received is not published on the document as presented in the repository. The required complexity or quality of research of student theses may vary by program, and the required minimum study period may vary in duration. General rights Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners and it is a condition of accessing publications that users recognise and abide by the legal requirements associated with these rights. • Users may download and print one copy of any publication from the public portal for the purpose of private study or research. • You may not further distribute the material or use it for any profit-making activity or commercial gain

Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

  • Upload
    others

  • View
    9

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

Eindhoven University of Technology

MASTER

Structural design support of free forms

Linh, S.L.

Award date:2012

Link to publication

DisclaimerThis document contains a student thesis (bachelor's or master's), as authored by a student at Eindhoven University of Technology. Studenttheses are made available in the TU/e repository upon obtaining the required degree. The grade received is not published on the documentas presented in the repository. The required complexity or quality of research of student theses may vary by program, and the requiredminimum study period may vary in duration.

General rightsCopyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright ownersand it is a condition of accessing publications that users recognise and abide by the legal requirements associated with these rights.

• Users may download and print one copy of any publication from the public portal for the purpose of private study or research. • You may not further distribute the material or use it for any profit-making activity or commercial gain

Page 2: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

y 9

structural design

Where i nnovation starts

w

Structural Design Support of Free Forms

Linh Sa Le

A-20 12.07

TU I Technische Universiteit

e Eindhoven University of Technology

Page 3: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

EINDHOVEN UNIVERSITY OF TECHNOLOGY

DEPARTMENT OF ARCHITECTURE, BUILDING, AND PLANNIG

UNIT OF STRUCTURAL DESIGN AND CONSTRUCTION TECHNOLOGY

CHAIR GENERALAND INTEGRATION

Master's Thesis

Structural Design Support of Free Forms

name. Linh Sa Le student number. 0569417

graduation committee. dr. ir. S.P.G. Moonen TU je ir. G. Lindner TU je ir. B.M.M. Wijnheld ABT

Page 4: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer
Page 5: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

Summary

Nowadays, complex free forms have become a striking trend in contemporaryarchitecture. Nevertheless, not any free form is a structural form. When cre-ating free forms with CAD tools, the physical laws are completely ignored,and thus the designer lacks the feeling of a healthy, logical structures. Designswhich do not truly obey the physical laws, can always be built using muchmaterial. However, this rarely contributes to the architectural design, nor theeconomical aspect. The subject of this Master’s thesis was to develop a toolthat graphically informs the user how to improve the structural performance offree forms in order to give an understanding of the structural behavior. Thethesis is focused on form-finding using structural optimization, and is limited toshape optimization. The objective function is the sum of the beam strain energy.

The first part of the research is focused on choosing an adequate algorithmto solve shape optimization problems. Three algorithms have been written andthe results are compared to known, global optima. In general, the steepest de-scent hill climbing algorithm yields the most accurate results within the leastamount of time. Due to the performance of sensitivity analysis, the algorithmis well capable of finding the right direction, and therefore outweighs its time-consuming nature.The second part of the research consists of improving the steepest descent hillclimbing algorithm on speed and accuracy. Several improvements are proposed,which are related to the variables and the nature of the algorithm. If theseimprovements are applied, the greatest benefit is found in the speed. The al-gorithm is now capable of finding the global optimum for a concentrated load,while the accuracy is greatly increased for uniformly projected loads.When the algorithm is used to solve multiple loading cases, the objective func-tion requires a small modification, and is defined as the sum of the total strainenergy of all loading cases. The results show that the optimum structure sub-jected multiple loading cases is a compromise of the individual optima. More-over, the optimum structure is lower than each of the individual optima. Thisdifference in height is smaller if the individual optima resembles more.

The thesis shows that a relatively simple optimization algorithm is capable ofsolving a complex, multi-objective problem. However, the algorithm can be im-proved further, and is not suitable yet to implement in the design process, as itomits certain important aspects. Furthermore, the algorithm is time-consumingwhen many variables are involved. However, such optimization methods arepromising techniques to support the user in the design process, especially be-cause the user can maintain its central role in the design process.

iii

Page 6: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer
Page 7: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

Preface

Structural Design Support of Free Forms is the result of the Master’s thesis,inspired by the recent trend in free form architecture and the application ofstructural optimization.

The subject is chosen based on a personal interest in the integration of ar-chitecture and structure. Shell structures have been been built since centuries,as seen in the Roman and Byzantine architecture. The structures are capable ofspanning a large distance, relative to its thickness, while a strong architecturalappearance can be obtained, if designing correctly. In the last centuries, engi-neers as Antonio Gaudi and Frei Otto designed great arches and shells, usingform-finding methods. More recently, a new designing strategy has emerged.Structural optimization is a subject that is very known in the aerospace andautomotive industries. Although I was completely unfamiliar with the topic, aswell with programming, I was motivated to learn, because in my opinion, it is apromising technique to adopt in the design process of (free form) architecturalstructures. Algorithms as nonlinear programming caught my attention, as thesehad proven themselves to be very stable and strong. In addition, I found moreevolutionary algorithms also very interesting, as they are inspired by nature.Moreover, against my own expectation, I discovered that I was very interestedin programming. Although simple things as describing a curve became a chal-lenge to program, I had fun doing it, and am glad that I had the opportunityto learn and explore such a branch.

I would like to express my appreciation to my graduation committee, fromwhom I learned a lot. Without their comments and critics, I would not havebeen able to achieve the result as what it is. I would also like to thank ABT Velpfor giving me the opportunity to perform the graduation project at their office.Furthermore, I like to acknowledge my cousins for providing me accommodationin Arnhem. Many thanks go my fellow students for the inspiring conversationsand the coffee. I am grateful for the listening and the support of my familyand friends, especially during the last few months of the graduation project.Finally, I owe a great dept to Erik for his support and patience, as well as hiscommon-sense remarks!

Eindhoven, May 2012

Linh Sa Le

v

Page 8: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer
Page 9: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

Contents

Summary iii

Preface v

List of Figures xi

List of Tables xv

Introduction 1

1 Curves for Computer Graphics 51.1 Interpolating Curves . . . . . . . . . . . . . . . . . . . . . . . . . 5

1.1.1 Linear Interpolation . . . . . . . . . . . . . . . . . . . . . 51.1.2 Polynomial Interpolation . . . . . . . . . . . . . . . . . . 61.1.3 Hermite Interpolation . . . . . . . . . . . . . . . . . . . . 71.1.4 Spline Interpolation . . . . . . . . . . . . . . . . . . . . . 8

1.2 Approximating Curves . . . . . . . . . . . . . . . . . . . . . . . . 91.2.1 Bezier Approximation . . . . . . . . . . . . . . . . . . . . 10

1.2.1.1 Weighted Sum . . . . . . . . . . . . . . . . . . . 101.2.1.2 Linear Interpolation . . . . . . . . . . . . . . . . 11

1.2.2 B-Spline Approximation . . . . . . . . . . . . . . . . . . . 131.2.3 NURBS . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

1.3 Subdivision Curves . . . . . . . . . . . . . . . . . . . . . . . . . . 16

2 Structural Optimization 172.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172.2 Geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

2.2.1 Parametrization . . . . . . . . . . . . . . . . . . . . . . . 182.2.2 Classification . . . . . . . . . . . . . . . . . . . . . . . . . 19

2.3 Optimization Algorithms . . . . . . . . . . . . . . . . . . . . . . 202.3.1 Classification . . . . . . . . . . . . . . . . . . . . . . . . . 202.3.2 Multi-objective Optimization . . . . . . . . . . . . . . . . 212.3.3 Sensitivity Analysis . . . . . . . . . . . . . . . . . . . . . 222.3.4 Nonlinear Programming: Gradient-based Methods . . . . 232.3.5 Metaheuristics: Single-point-based Methods . . . . . . . . 23

2.3.5.1 Hill Climbing . . . . . . . . . . . . . . . . . . . . 232.3.5.2 Simulated Annealing . . . . . . . . . . . . . . . . 242.3.5.3 Tabu Search . . . . . . . . . . . . . . . . . . . . 252.3.5.4 Evolutionary Structural Optimization . . . . . . 25

vii

Page 10: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

2.3.6 Metaheuristics: Population-based methods . . . . . . . . 262.3.6.1 Genetic Algorithm . . . . . . . . . . . . . . . . . 262.3.6.2 Ant Colony Optimization . . . . . . . . . . . . . 262.3.6.3 Particle Swarm Optimization . . . . . . . . . . . 27

2.4 Objective Function . . . . . . . . . . . . . . . . . . . . . . . . . . 282.5 Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302.6 Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332.7 Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

3 Choosing an Algorithm for Shape Optimization 413.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413.2 Steepest Descent Hill Climbing . . . . . . . . . . . . . . . . . . . 42

3.2.1 Sensitivity Analysis . . . . . . . . . . . . . . . . . . . . . 433.2.2 Escape from local optima . . . . . . . . . . . . . . . . . . 45

3.3 Genetic Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . 473.3.1 Encoding of the individuals . . . . . . . . . . . . . . . . . 473.3.2 Initialization of the population . . . . . . . . . . . . . . . 483.3.3 Selection and reproduction operators . . . . . . . . . . . . 48

3.3.3.1 Cross Over . . . . . . . . . . . . . . . . . . . . . 493.3.3.2 Mutation . . . . . . . . . . . . . . . . . . . . . . 50

3.3.4 Termination . . . . . . . . . . . . . . . . . . . . . . . . . . 523.4 Hybrid algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . 523.5 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

3.5.1 Concentrated Load . . . . . . . . . . . . . . . . . . . . . . 543.5.2 Projected Uniformly Distributed Load . . . . . . . . . . . 563.5.3 Self Weight . . . . . . . . . . . . . . . . . . . . . . . . . . 57

3.6 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

4 Increase of Accuracy and Speed of the Algorithm 614.1 Optimum Number of Control Points . . . . . . . . . . . . . . . . 614.2 Position of Control Points . . . . . . . . . . . . . . . . . . . . . . 624.3 Required Number of Control Points . . . . . . . . . . . . . . . . 674.4 Refinement of the Algorithm . . . . . . . . . . . . . . . . . . . . 69

4.4.1 Sensitivity Analysis . . . . . . . . . . . . . . . . . . . . . 694.4.2 Scaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

4.5 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 744.5.1 Single Concentrated Loads . . . . . . . . . . . . . . . . . 744.5.2 Multiple Concentrated Loads . . . . . . . . . . . . . . . . 754.5.3 Uniformly Distributed Loads and Multiple Concentrated

Loads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 754.6 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77

5 Application to Multiple Loading Cases 795.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 795.2 Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 795.3 Concentrated Vertical Loads . . . . . . . . . . . . . . . . . . . . . 805.4 Uniformly Distributed Horizontal and Vertical Loads . . . . . . . 825.5 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

Conclusions and Recommendations 87

Page 11: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

A Steepest Descent Hill Climbing 91

B Genetic Algorithm 105

C Hybrid Algorithm 123

D Improved Steepest Descent Hill Climbing 145

Page 12: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer
Page 13: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

List of Figures

1 Torroja’s Zarzuela Hippodrome roof . . . . . . . . . . . . . . . . 2

2 Isler’s open air theater in Grotzinger: the shell is designed usinga hanging-membrane reversed method . . . . . . . . . . . . . . . 2

3 Sasaki’s crematorium in Gifu designed using structural optimization 2

5 Support conditions of an arch . . . . . . . . . . . . . . . . . . . . 3

4 Flowchart of the usage of the tool . . . . . . . . . . . . . . . . . 4

1.1 Hermite curve segments . . . . . . . . . . . . . . . . . . . . . . . 7

1.2 Blending functions of a cubic Hermite curve over t . . . . . . . . 8

1.3 Spline curve of two segments . . . . . . . . . . . . . . . . . . . . 9

1.4 Bezier curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

1.5 Blending functions of a cubic Bezier curve over t . . . . . . . . . 11

1.6 Scaffolding the polygon . . . . . . . . . . . . . . . . . . . . . . . 12

1.7 B-spline curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

1.8 Weight functions of cubic B-spline over t . . . . . . . . . . . . . . 15

1.9 Influence of the w2 on the NURBS curve . . . . . . . . . . . . . . 16

1.10 Chaikin’s algorithm for a control polygon . . . . . . . . . . . . . 16

2.1 Local optima and global optimum . . . . . . . . . . . . . . . . . 18

2.2 Geometry parametrization [1] . . . . . . . . . . . . . . . . . . . . 20

2.3 Shortest path found by an ant colony using a pheromone trail [2] 27

2.4 Particles are moving towards the optimum, denoted by the cross[3] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

2.5 The results when optimizing to stress or strain energy. The bluestructure should be infinitely high. . . . . . . . . . . . . . . . . . 30

2.6 The size of the design domain determines whether the goal isto find local or global optimum. The domain is defined by thediscontinuous lines. . . . . . . . . . . . . . . . . . . . . . . . . . . 32

2.7 Intersecting polygon can describe both intersecting and non-intersectingcurve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

2.8 Process of eliminating a loop . . . . . . . . . . . . . . . . . . . . 33

2.9 Linear interpolation of the thickness of intermediating points . . 34

2.10 Modification of a part of the B-spline curve without affecting theentire curve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

2.11 Description of the discontinuity of B-splines . . . . . . . . . . . . 35

2.12 Different approaches for structural optimization to form-refiningand form-finding . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

xi

Page 14: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

3.1 A structure with a span of 10m is considered and subjected toload cases for which the optimum solution is known . . . . . . . 42

3.2 The course of the strain energy over the height of a structurewith span of 10m for different load cases . . . . . . . . . . . . . . 43

3.3 The steepest descent hill climbing algorithm explores the directsurrounding of the solution . . . . . . . . . . . . . . . . . . . . . 44

3.4 The control point Pi can move over seven distances to enable thealgorithm to escape from local optima. . . . . . . . . . . . . . . . 45

3.5 Generating a new solution by either mutating one control point,or all . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

3.6 The graph shows the course of the strain energy during everyanalysis. In this example, the structure is defined by 9 controlpoints, and subjected to a uniformly distributed load. At somemoments, for example at solution 5, the solution has a largerstrain energy level than the previous solution. At this point,the algorithm encounters a local optimum, and would stop in anormal situation. However, when backtracking, the algorithmdoes not accept such a solution. Instead, the algorithm reversesthe mutation, and tries to adopt a smaller mutation, until a bettersolution is found. The algorithm is terminated if the smallestmutation possible has been analyzed and does not yield a bettersolution. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

3.7 The genetic code and the physical expression . . . . . . . . . . . 483.8 The cumulative improvement of the population for linear and

quadratic crossover relations . . . . . . . . . . . . . . . . . . . . . 493.9 Course of the mutation strength during the iterations . . . . . . 513.10 The cumulative improvement of the population when the uniform

mutation decreases for different criteria . . . . . . . . . . . . . . 513.11 The difference in course of the best fitness over the iterations for

a constant uniform mutation strength of 20% and a decrease instrength of 60 to 20% . . . . . . . . . . . . . . . . . . . . . . . . 52

3.12 The models used in the analysis for HC . . . . . . . . . . . . . . 533.13 The quality of the algorithms when optimizing a structure de-

scribed by 5 and 9 control points subjected to load case 1, aconcentrated load at midspan . . . . . . . . . . . . . . . . . . . . 55

3.14 The cost of the algorithms when optimizing a structure describedby 5 and 9 control points subjected to load case 1, a concentratedload at midspan . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

3.15 The quality of the algorithms when optimizing a structure de-scribed by 5 and 9 control points subjected to load case 1, aconcentrated load at midspan . . . . . . . . . . . . . . . . . . . . 56

3.16 The cost of the algorithms when optimizing a structure describedby 5 and 9 control points subjected to load case 1, a concentratedload at midspan . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

3.17 The quality of the algorithms when optimizing a structure de-scribed by 5 and 9 control points subjected to load case 1, aconcentrated load at midspan . . . . . . . . . . . . . . . . . . . . 57

3.18 The cost of the algorithms when optimizing a structure describedby 5 and 9 control points subjected to load case 1, a concentratedload at midspan . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

Page 15: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

4.1 Five control points is the minimum number required to achievea geometry with an acceptable quality and the least amount ofcomputational time. A quality or cost equal to one is optimal. . 62

4.2 The optimum structure is best described when using five controlpoints. The continuous lines denote the near-optimum solutions.These solutions are found within the set amount of iterations.The dashed lines are the solutions that are found after the themaximum number of iterations, and thus show large discrepancywith the optimum solution. The dotted line is the global optimum. 63

4.3 Relation continuity when described by three control points . . . 634.4 Relation continuity when described by two curves . . . . . . . . . 644.5 Relation continuity when described by one curve . . . . . . . . . 654.6 Difference when adding control points under a concentrated load 674.7 Example 3: Difference when disallowing added control points to

move away from the load . . . . . . . . . . . . . . . . . . . . . . 674.8 Number of required control points is determined based on the

structural model. The grey points are the phantom points, theblue points are the fixed points, and the black points are thevariables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

4.9 The original sensitivity analysis searches for the best mutation inevery direction and for every distance, while the new proposedanalysis finds the best direction first, whereafter it searches forthe best mutation distance. . . . . . . . . . . . . . . . . . . . . . 69

4.10 The solutions of Example 1, 2 and 3 when optimizing using amore efficient sensitivity analysis . . . . . . . . . . . . . . . . . . 70

4.11 Scaling can easily contribute to finding the global optimum . . . 714.12 The flowcharts of the HC algorithm refined with a scaling opti-

mization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 714.13 Scaling of the polygon can result in a loop in the curve . . . . . . 734.14 The optimum solutions for a concentrated load and a uniformly

distributed load . . . . . . . . . . . . . . . . . . . . . . . . . . . . 744.15 The minutes that are required to optimize a structure subjected

to different number of vertical concentrated loads . . . . . . . . . 754.16 The optimum solutions when subjected to concentrated loads of

100kN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 754.17 The minutes that are required to optimize a structure subjected

to a uniformly distributed load and different number of verticalconcentrated loads . . . . . . . . . . . . . . . . . . . . . . . . . . 76

4.18 The optimum solutions when subjected to both a uniformly dis-tributed load of -1kN/m and concentrated loads with a totalvalue of 20kN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76

5.1 The optimization course of two concentrated loads for four situ-ations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81

5.2 The optimum solutions when subjected to concentrated loads de-signed in different load cases . . . . . . . . . . . . . . . . . . . . . 81

5.3 The optimum solution when subjected to 9 loads in 9 differentloading cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82

5.4 The optimization course when subjected to 9 loads in 9 differentloading cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83

Page 16: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

5.5 Load combinations composed of vertical and horizontal load fromeither left or right . . . . . . . . . . . . . . . . . . . . . . . . . . 83

5.6 Situation 1: vertical load = 12.5 horizontal load - The optimumstructures when subjected to either load combination 1 or 2, orto both combinations. . . . . . . . . . . . . . . . . . . . . . . . . 83

5.7 Situation 1: vertical load = 12.5 horizontal load - The optimiza-tion course when considering a single or multiple load combinations 84

5.8 Situation 1: vertical load = 1.6 horizontal load - The optimumstructures when subjected to either load combination 1 or 2, orto both combinations. . . . . . . . . . . . . . . . . . . . . . . . . 84

5.9 Situation 1: vertical load = 1.6 horizontal load - The optimizationcourse when when considering a single or multiple load combina-tions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85

Page 17: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

List of Tables

3.1 The optimum height and corresponding strain energy for a struc-ture of 10m span, subjected to different load cases . . . . . . . . 42

3.2 The results of mutating one control point or all . . . . . . . . . . 45

4.1 Relation continuity and discontinuity when using n = 5 controlpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

4.2 C1: the control points of curve H and G . . . . . . . . . . . . . . 654.3 C2: the control points of curve H and G . . . . . . . . . . . . . . 654.4 Results adding control points under 1 concentrated load com-

pared to results obtained with original HC . . . . . . . . . . . . . 664.5 Results adding control points fixed in x-direction under 1 con-

centrated load compared to results obtained with original HC . . 664.6 Improvement results adding control points for a structure sub-

jected to 4 concentrated loads compared to a fixed position andno fixed position in x-direction . . . . . . . . . . . . . . . . . . . 67

4.7 Number of required control points based on the structural model 684.8 Results when performing an efficient sensitivity analysis com-

pared to results of the original sensitivity analysis . . . . . . . . 694.9 Comparison of two implementations of scaling into the HC. The

black line in the first column denote the solution found with theoriginal HC. The orange line represent M1, and the blue line M2. 73

4.10 Results of the improved algorithm . . . . . . . . . . . . . . . . . 74

xv

Page 18: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer
Page 19: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

Introduction

Nowadays, the society is dominated by electronic systems and devices. Thisrequires for a shift in the role of design, and traditional methods may be in-adequate or insufficient [4]. Generative systems offer a paradigm shift for theprocess of design and the expression of that process; designers need to recon-sider the static artifacts and the design process that is involved [5]. This leadsto new artifacts with the characteristic properties:

• The ability to generate complexity

• The complex and interconnected relationship between organism and envi-ronment

• The ability to self-maintain and self-repair

• The ability to generate novel structures, behavior, outcomes or relation-ships

Where traditional design methods exhibit a direct relationship between the de-signer and its artefact, generative systems involve an indirect relationship, wherethe designer controls the rules or systems that interact to generate the artifact.This in fact, implies that generative systems are a design tool. Hence, the roleof the designer remains central in the design process.

Computer-aided design tools were originally developed in 1960s for the aerospaceand automotive industries, but it did not find its application in the architectureuntil the eighties with F. Gehry as one of the first who exploited the digitaltechnologies to find new forms. Nowadays, complex free forms have become astriking trend in contemporary architecture. Nevertheless, not any free formis a structural form, for structural forms are not absolutely free; the laws ofmechanics must be fulfilled [6]. Moreover, when creating free forms with CADtools, the physical laws are ignored, and hence, the designer lacks the feelingof healthy, logical structures. Great engineers who have built remarkable shellsand arches have always stressed in the importancy of models, for instance, Ed-uard Torroja and Heinz Isler [7] (see Figures 1 and 2). Architectural designswhich are not limited by the physical laws, can always be built by adding muchmaterial. However, this rarely contributes to the architectural design, or theeconomical aspect. In the history of structural design, three design methodscan be distinguished which are capable of meeting the structural requirements:

• Analytical method

1

Page 20: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

• Structural method

• Digital method

Figure 1: Torroja’s Zarzuela Hippo-drome roof

Figure 2: Isler’s open air theater inGrotzinger: the shell is designed usinga hanging-membrane reversed method

Analytical methods are characterized by the mathematical representation of thegeometry and the numerical calculations. Structural methods are dominated bythe acting forces and can be divided into graphical statics and experimentalmethods. In the last decade, along with the major increase in computationalpower, digital methods to find optimum structures of free forms became morepopular (see Figure 2). This iterative method finds its origin in the aerospaceand is referred to as structural optimization. Although the method is a powerfultool to use, the user must be aware of the limitations. First of all, the methodis based on assumptions and simplification of the reality. Thus, when findingthe optimum, this solution will not behave as the real built model. In addition,the numerical calculations are merely simulations of the true behavior of thestructure, and hence, optimum solutions are only relative.

Figure 3: Sasaki’s crematorium in Gifu designed using structural optimization

Traditional design methods, as graphical statics and hanging methods, haveproven to be theoretically correct, however, do not provide enough information.The methods are merely capable of finding the optimal form for one loading case,while if other loading cases are involved, a different optimum exists. Further-more, most optimization programs have been specially written for the designproject, and hence are only applicable to the specific problem [8]. The aim ofStructural Design Support of Free Forms is therefore the design of a tool thatcontributes to the understanding of the relationship between free forms and theacting forces. The objective of the Master’s thesis is defined as

2

Page 21: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

The design of a tool that graphically informs the user how to improve the struc-tural performance, i.e. the stress and compliance due to the applied loads, offree forms by structural optimization, and thereby giving an understanding ofthe structural behavior.

The tool that is created, can be used as illustrated in Figure 4. A user inputis necessary, in which the structural geometry and boundary conditions are de-fined. If necessary, additional architectural boundary conditions can be definedin this stage. The input is then structurally optimized. Structural optimizationis performed in programming environment. This environment controls both theanalysis package and the package to write data to. The structural model isloaded in the programming environment once, in order to save the structuraldesign in its memory. During the optimization, the geometry and loading condi-tions are exported from the programming environment to the analysis package,whereafter it is analyzed. The results are read by the programming environ-ment, and exported to the package that saves the data. At the end of theoptimization, the output is generated. The output is the optimum result of theiterative optimization process. At this stage, the designer can decide whetherthe output meets the structural and architectural requirements. If so,then thedesign process is terminated, else the designer can modify the boundary condi-tions, and let the optimization run again. The software used is Microsoft VisualBasic 2008, Oasys GSA 8.5 and Microsoft Office Excel 2007.The thesis is divided in six chapters. Chapter 1 discusses how curves can begenerated for computer graphics. Chapter 2 is devoted to structural optimiza-tion. Chapter 3 treats three algorithms for solving shape optimization, followedby Chapter 4 in which the improvements of the chosen algorithms are proposed.Additional, in Chapter 5 the algorithm is extended to solve multiple loadingcases. In the final chapter a summary of the previous chapters is given, andsome recommendations for further research.

The thesis is limited to 2D roof structures. The structure is composed of con-tinuous beam elements. Arches can be classified in several ways. This thesisconsiders true arches, i.e. outward spreading is prevented. In such cases, majoraxial forces are introduced. As outward spreading is prevented, the end condi-tions can be hinged supported, fixed, or a combination, as shown in Figure 5.For practical reasons regarding the construction, the study is limited to pinnedsupport conditions. The thesis considers roof structures, and it is assumed thatthese are supported by columns and walls. Therefore, the orientation of thesupports is presented in accordance with the global axis.

(a) Simply supported (b) Fixed supported (c) Fixed and simply sup-ported

Figure 5: Support conditions of an arch

3

Page 22: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

Input

Boundaryconditions

Optimization

Stop

Structural & architecturalcriteria met?

Yes

No

Modify

Output

Figure 4: Flowchart of the usage of the tool

4

Page 23: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

Chapter 1

Curves for ComputerGraphics

With the rise of computer-aided design, it was necessary that smooth curves andsurfaces could be generated to display realistic-looking images. This chapter isdevoted to the computation of curves. It covers two important terms in thefield to obtain and control curves, i.e. interpolation and approximation. Themethods are based on a parametric description of the curves. Such an approachis required if the function to describe the curves is unknown. Both methodscan lead to similar, if not exact the same results, Section 1.1 is concerned withinterpolating curves, and Section 1.2 discusses interpolating curves. In addition,subdivision curves are explained in Section 1.3.

1.1 Interpolating Curves

Interpolating curves are obtained based on data points. The curves must passexactly through these points. With merely this input, it is difficult to foreseethe result and many possible curves can be generated. This problem is overcomeby involving the tangents of the curves at the data points.

1.1.1 Linear Interpolation

The most straightforward way to approximate a smooth curve is by using a setof straight segments. Consider two data points P0 and P2. The course of thesegment is obtained by connecting these two points by a linear function. Theexpression P0 + t(P2 − P0) is the sum of point P0 and vector t(P2 − P0), and isthus a point on the line connecting P0 and P2, which is referred to as P1. Theexpression can also be written as

P1 = P0 + t(P2 − P0)

= (1− t)P0 + tP2.(1.1)

(1.1) shows that P1 in fact a summation of two points, and is a linear com-bination of P0 and P2 with barycentric weights. The general expression for a

5

Page 24: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 1. CURVES FOR COMPUTER GRAPHICS

straight line between P0 and P2 can be written as

P (α) = (1− t)P0 + tP2

= P0 + t(P2 − P0)

= P0 + td, 0 < t < 1.

(1.2)

The method is quick and useful in many instances, but not very precise.

1.1.2 Polynomial Interpolation

Polynomial interpolation is a generalization of linear interpolation and useshigher-order polynomial functions in each interval. A polynomial of degree n inx is the function

Pn(x) =

n∑i=0

aixi

= a0 + a1x+ a2x2 + ...+ anx

n

(1.3)

of n+ 1 coefficients, represented by ai. The interpolation constructs a functionsin which all points are included.

Provided a set of four points in a two-dimensional space, e.g. Pi for i=1 to 4,a cubic polynomial function that describes a curve going through these pointshas the form

P (t) = a0 + a1(t) + a2(t)2 + a3(t)3

= (1, t, t2, t3)(a0, a1, a2, a3)T

= T (t)A for 0 ≤ t ≤ 1,

(1.4)

where each of the four coefficients an is a pair of x and z, T (t) is the row vectorof (t3, t2, t, 1) and A is the column vector (an)T . an is unknown. P1 and P4 areassumed to be the two endpoints P (0) and P (1) of the curve, and P2 and P3 theinterior points P (1/3) and P (2/3). This leads to the following set of equations

a0 + a1(0) + a2(0)2 + a3(0)3 = P1 (1.5a)

a0 + a1( 13 ) + a2( 1

3 )2 + a3( 13 )3 = P2 (1.5b)

a0 + a1( 23 ) + a2( 2

3 )2 + a3( 23 )3 = P3 (1.5c)

a0 + a1(1) + a2(1)2 + a3(1)3 = P4. (1.5d)

Substituting the obtained solutions in (1.4) yields

P (t) = (1− 5.5t+ 9t2 − 4.5t3)P1 + (9t− 22.5t2 + 13.5t3)P2

+ (−4.5t+ 18t2 − 13.5t3)P3 + (−4.5t− 4.5t2 + 4.5t3)P4

= G1(t)P1 +G2(t)P2 +G3(t)P3 +G4(t)P4

= G(t)P,

(1.6)

6

Page 25: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

1.1. INTERPOLATING CURVES

where the four functions Gi are cubic polynomials in t, and are called the blend-ing functions, as they represent any point on the curve as a blend of the fourpoints.

The main advantage of this method is its simplicity. On the other hand, givenfour points, only one cubic polynomial function exists that passes through eachpoint. Therefore, the method is not interactive. Moreover, using high-degreepolynomials may oscillate and the final form may not satisfy the user [9].

1.1.3 Hermite Interpolation

The Hermite interpolation approach uses an interactive algorithm, that pro-vides user-controlled parameters. Rather than a set of data points to obtain acurve, like in the polynomial interpolation, this method is based on two direc-tion points, in addition to the associated data points. If the shape needs to bemodified, the direction points, related to the tangent of the curve at the controlpoints, can be adjusted. The direction point defines a vector, i.e. a directionand a length. For example, if the magnitude of the vector is small, the curvetowards the other control point changes its direction fast, resulting in a tightcurve.

P t1

P2P1

P t2

Figure 1.1: Hermite curve segments

Again, the curve segment is a polynomial curve of degree k=3, with four co-efficients as given by (1.4). The coefficients can be expressed in the knownquantities, i.e. the two data points and direction points. The tangent vector isthe derivative of P (t) in t, which is denoted by P t(t) as

P t(t) = a1 + 2a2 + 3a3(t)2. (1.7)

Let P (0) = P1, P (1) = P2, P t(0) = P t1 and P t(1) = P t2 . The geometricrepresentation of the Hermite curve is obtained if the solutions of the followingequations

a0 + a1(0) + a2(0)2 + a3(0)3 = P0 (1.8a)

a0 + a1(1) + a2(1)2 + a3(1)3 = P1 (1.8b)

a1 + 2a2(0) + 3a3(0)2 = P t0 (1.8c)

a1 + 2a2(1) + 3a3(1)2 = P t1 (1.8d)

are substituted in (1.4) as

7

Page 26: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 1. CURVES FOR COMPUTER GRAPHICS

P (t) = (1 + 3t2 + 2t3)P1 + (3t2 − 2t3)P2 + (t− 2t2 + t3)P t1 + (−t2 + t3)P t2

= F1(t)P1 + F2(t)P2 + F3(t)P t1 + F4(t)P t2

= F (t)B,

(1.9)

in which F (t) are called the Hermite blending functions and are illustrated inFigure 1.5.

f(t)

F1 F2

F3

F4

1

1t

Figure 1.2: Blending functions of a cubic Hermite curve over t

Note that the value of the blending function of the tangent vectors are relativelysmall, compared to the blending functions associated with the data points thatvary between zero and one.

In general, the shape is controlled by editing the magnitude of the directionpoints, rather than the control points or even the direction.

1.1.4 Spline Interpolation

Another way to overcome the problems associated with polynomial interpola-tion, is the execution of spline interpolations. A spline is a piecewise polyno-mial curve. The partition of a curve into several segments, each described bylow-degree polynomials allows the curve to be well controlled. Usually, onlyquadratic or cubic spline curves are applied. A popular spline type that is usedto describe free forms is called B-Spline. Due to its popularity, this spline willdiscussed separately in Section 1.2.2.Splines are defined as a set of polynomials functions with degree k, that aresmoothly connected at certain data points. Given a set of n control points,the generated curve consists of n − 1 individual Hermite segments. In orderto provide smooth continuity between two connecting polynomials, their firstderivatives are equal in that certain data point. It follows that all the derivativesup to the (k − 1) must be the same in this point. The method is interactive,because it requires the user to determine the extreme tangents vectors. For

8

Page 27: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

1.2. APPROXIMATING CURVES

practical reasons, this is usually done for the first and last control point. More-over, this feature is necessary for the solvation of the equations, as is shownbelow.

Pk

Pk(t)Pk+1

Pk+1(t)

Pk+2

Figure 1.3: Spline curve of two segments

Consider the sequence of three adjacent points, Pk, Pk+1, and Pk+2. The firstHermite segment is denoted by Pk(t), implying Pk(0) = Pk and Pk(1) = Pk+1.The tangent vectors of Pk(t) are unknown and are denoted by P tk and P tk+1.Applying (1.9) to each of the segments results in

Pk(t) = Pk + P tkt+ [3(Pk+1 − Pk)− 2P tk − P tk+1]t2

+ [2(Pk − Pk+1) + P tk − P tk+1]t3(1.10)

Pk+1(t) = Pk+1 + P tk+1t+ [3(Pk+2 − Pk+1)− 2P tk+1 − P tk+1]t2

+ [2(Pk+1 − Pk+2) + P tk+1 − P tk+2]t3.(1.11)

Next, the second derivatives of the interior point is set equal as

P ttk (1) = P ttk+1(0) (1.12)

Rewriting this equation yields

P tk + 4P tk+1 + P tk+2 = 3(Pk+2 − Pk), (1.13)

in which the quantities on the left side are unknown, and on the right side known.

For a curve with n control points, (1.13) can be written for n − 2 times foreach interior points to obtain a system of n− 2 equations with n unknown tan-gents P tn. To obtain a system that is easier to solve, the tangents of the firstand last point need to be specified by the user. The solutions are then used tocalculate the coefficients of the original equation as given by (1.4).

Control over this curve is, however, only possible for the entire curve, omit-ting the possibility for local control. Furthermore, as the number of equationsto be solved is equal to n, the generation of curves defined by many controlpoints may consume much time.

1.2 Approximating Curves

Before the advent of CAD software, long curves were drawn using mechanicaltools that guided the hand of the drawer. These so called splines usually consistof thin, bendable wooden or metal rods. The rods were fixed at a few points to

9

Page 28: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 1. CURVES FOR COMPUTER GRAPHICS

control the shape. Computer graphic approximation curves are based on thistechnique. The points describe a polygon, which is approached by the curve.The so called control points give an extra pull to the shape, and in essence,define the curve.

1.2.1 Bezier Approximation

The Bezier curves is a curve that is a polynomial function of the parametert, in which the order depends on the number of control points. The curveapproximates the control polygon, that is defined by control points, rather thanpassing exactly through them, with the exception of the two endpoints. Theextent of the approximation is larger if the curve is near the point.

P0

P1P2

P3 P0

P1 P2

P3 P0

P1P2

P3

Figure 1.4: Bezier curves

Characteristic for such curves is their allowance to move the control points,providing an easier modification of the curve. Moreover, the number of controlpoints can be modified throughout the design process. In addition to the de-pendence of the degree on the number of control points, Bezier curves have thedisadvantage that it is limited to global control only. Another drawback is thedifficulty to obtain C2 continuity, i.e. connected functions with equal first andsecond derivatives. Two approaches are used to generate the curve, leading tothe same result.

1.2.1.1 Weighted Sum

The weighted sum approach to the Bezier curve is a summation of the multipli-cation of the control points and weight factors, expressed as

P (t) =

n∑i=0

PiBi, for 0 ≤ t ≤ 1. (1.14)

As the control points are defined by the user, only Bi depends on the parametert. The approach also depends on the number of control points. The weightfactors are described using the Bernstein theory as

Bn,i(t) =

(ni

)ti(1− t)n−1, (1.15)

where

(ni

)= n!

i!(n−1)! are the binomial coefficients. When the curve is edited,

most change is exhibit at the vicinity of the control points, due to the non-zero

10

Page 29: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

1.2. APPROXIMATING CURVES

value of the weight functions for all values of t except for t = 0 and t = 1. Theweight function are also known as blending functions, blending the contributionof each of the points.

For a cubic Bezier curve, the weight functions are given as follows

B3,0(t) =

(30

)t0(1− t)3−0 = (1− t)3 (1.16a)

B3,1(t) =

(31

)t1(1− t)3−1 = 3t(1− t)2 (1.16b)

B3,2(t) =

(32

)t2(1− t)3−23t2(1− t) (1.16c)

B3,3(t) =

(33

)t3(1− t)3−3 = t3 (1.16d)

and illustrated as

1

B30(t)

B31(t) B32(t)

B33(t)

t

Figure 1.5: Blending functions of a cubic Bezier curve over t

resulting in the definition of the curve as

P (t) = (t3, t2, t, 1)

−1 3 −3 13 −6 3 0−3 0 3 01 4 1 0

P0

P1

P2

P3

= (1− t3)P0 + 3t(1− t)2Pi + 3t3(1− t)P2 + t3P3.

(1.17)

1.2.1.2 Linear Interpolation

Originally, the Bezier curve was developed by Casteljau, and is based on a totallydifferent approach. The curve is generated by moving a straight line along twoconnected base lines, defined by three points. The result is a multi-linear curve,or a set of intersecting straight lines, described by the mediation operator

t[P0, ..., Pn

]= t[t[P0, ..., Pn−1

], t[P0, ..., Pn

]]. (1.18)

11

Page 30: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 1. CURVES FOR COMPUTER GRAPHICS

Basically, this is only a way to denote multiple polynomial functions of a straightline, as given by (1.1). Therefore, it has the advantage of a simple mathematicalbasis, and of producing interpolation curves whose shape can easily be predicted.

P0

P01

P012

P1

P2

P3

P12

P23

P123

P0123L012

L01

L12 L23L123

L0123

(a) Bezier curve: linear interpolation

P01

P012

P12 P23

P123

P0123

(b) Pascal triangle

Figure 1.6: Scaffolding the polygon

Consider a simple case consisting of a cubic curve between four control pointsP0, P1, P2, and P3 as shown in Figure 1.6a. The procedure can be explained inthree steps.

1. The straight line connecting the points are denoted as L01, L12 and L23,which are equivalent to respectively

P11(t) = L01 = (1− t)P0 + tP1

= t[P0, P1]

P12(t) = L12 = (1− t)P1 + tP2

= t[P1, P2]

P13(t) = L23 = (1− t)P2 + tP3

= t[P2, P3].

2. Two straight lines L012 and L123 connect these base lines. The formerstart at P01 = t0[P0, P1] and ends at P12 = t0[P1, P2], and the latter startat P12 = t0[P1, P2] and end at P23 = t0[P2, P3]. The interpolation yield

P21(t) = L012 = (1− t)P01(t) + tP12(t)

= t[P0, P1, P2] = t[P01, P12]

P22(t) = L123 = (1− t)P12(t)tP23(t)

= t[P1, P2, P3] = t[P12, P23].

3. The final linear interpolation is executed between the points P012 = t[P01, P12

and P123 = t[P12, P23 and yields

P31(t) = L0123 = (1− t)P012(t) + tP123(t)

= t[P0, P1, P2, P3] = t[P012, P123.

12

Page 31: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

1.2. APPROXIMATING CURVES

4. Select point P0123 = t[P012, P123] on L0123.

5. The curve is obtained by repeating these interpolations for 0≤t≤1.

The points between the interpolation can be given in a Pascal triangle as shownin Figure 1.6b. The triangle shows that 10 points are selected in total . Thenumber of points constructed during the process is n(n+ 1)/2.

1.2.2 B-Spline Approximation

Basis spline, or more commonly known as simply B-spline, overcomes the maindisadvantages of the Bezier curve. The spline features local control, and anydegree of continuity is possible to obtain. The latter requires the spline segmentsto be polynomials of the same degree, implying the use of low order polynomials.Unlike the normal spline, it uses individual Bezier, rather than Hermite curves.The curve is defined by n+ 1 control points, in addition to the degree n of theBezier curve, which is equal for every segment. Besides the determination ofcontrol points, the user also has to specify values of the so-called knots in orderto obtain more control over the shape of the curve. Several types of B-splinesexist, of which the NURBS is the most versatile. This will be discussed inSection 1.2.3.

P0

P1

P2

P3

P4K1

K2

K3

P1(t) P

2 (t)

Figure 1.7: B-spline curves

Uniform B-splines include knots that are uniformly distributed. All the weightfunctions have the same shape and are shifted with respect to each other. Innonuniform B-splines, the user specifies the knots and the weight functions gen-erally differ from one another. Open uniform B-spline include nonuniform knots,but they are specified in a simple way. In a rational B-spline, the weight func-tions are described by a ratio of two polynomials, and in a nonrational B-splineby polynomials in t.

Local control is obtained by omitting the requirement for the curve to passthrough the end control points. Each segment then begins with point Ki andends with Ki+1, the knots. If these are integer numbers, the knots are uni-formly distributed, and the curve is called uniform. The curve is approached asa weighted sum of the control points with unknown weight functions, similar tothe weighted sum approach of Bezier curves, as given by (1.14). The followingequations describes one segments and the associating knots.

13

Page 32: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 1. CURVES FOR COMPUTER GRAPHICS

Pi(t) =1

6(t3, t2, t, 1)

−1 3 −3 13 −6 3 0−3 0 3 01 4 1 0

Pi−1

PiPi+1

Pi+2

=

1

6(−t3 + 3t2 − 3t+ 1)Pi−1 +

1

6(3t3 − 6t2 + 4)Pi

1

6(−3t3 + 3t2 + 3t+ 1)Pi+1 +

t3

6Pi+2.

(1.19)

Ki = (1

6Pi−1 +

5

6Pi) +

1

6(Pi+1 − Pi) (1.20a)

Ki+1 = (1

6Pi +

5

6Pi+1) +

1

6(Pi+2 − Pi+1). (1.20b)

Each weight function should be a polynomial function of degree k, with themaximum at the vicinity of its control point and drops to zero when awayfrom this point. Consider a B-spline of two cubic polynomial segments that iscontrolled by five points, as shown in Figure 1.7. Each segment is constructedfor t from zero to one, so t is released over an interval [0,2]. To obtain each ofthe four weight functions B(t), it is divided in four parts, denoted as b(t), whichneeds to comply to the following conditions

• barycentricity

• C2 continuity at the three points where they join

• b0(t) and its first derivative should be zero at the start point b0(0)

• b3(t) and its first derivative should be zero at the end point b3(1).

These conditions yield 16 equations, of which the solutions are the partial weightfunctions, expressed as

b0(t) =1

6t3 b1(t) =

1

6(1 + 3t+ 3t2 − 3t3)

b2(t) =1

6(4− 6t2 + 3t3) b3(t) =

1

6(1− 3t+ 3t2 − t3).

Figure 1.8 shows that the weight functions never reach value 1, unlike in theBezier curves, as can be seen in Figure 1.5. Figure 1.8b shows the course of thefour weights over interval [0,2] for t.

1.2.3 NURBS

Nonuniform Rational B-Splines (NURBS) have an additional feature that pro-vides even more flexibility than the previous described curves, a set of n + 1parameters wi, called weights. This type is most practical, because it can beeasily reduced to simpler forms. The weight is expressed by introducing an ad-ditional dimension to the points. Every node is associated to its specific weight.

14

Page 33: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

1.2. APPROXIMATING CURVES

b3 b0

b2 b1

t

2/3

1/3

(a) Partial weight

B4,0(t) B4,2(t)

t

2/3

1/6

B4,4(t)B4,3(t)

−2 −1 1 2 3 4

(b) Total weight

Figure 1.8: Weight functions of cubic B-spline over t

After this feature is taken into account, the points are transformed back to theoriginal number of dimension to obtain a rational function Pr(t), by dividingthe nonrational function Pnr(t) by that particular part of itself that depends onthe additional coordinate wi as follows

Pr(t) =

∑ni=0 PiwiNik(t)∑ni=0 wiNik(t)

=

n∑i=0

PiRik(t).

(1.21)

Thus, the new rational blending function is given by

Rik(t) =wiNik(t)∑ni=0 wiNik(t)

. (1.22)

By introducing this step, both rational and unrational curves can be expressed,the latter if all the weight wi are equal to 1.Another important feature that provides the NURBS its flexibility, is the spec-ification of the weights, such that modification of the shape of the curve occursin a predictable way. Such properties are called nonuniform. Figure 1.9 showthe influence of varying one weight factor, e.g. w2 on the curve, while keepingthe others constant. The figure shows that the associated point P2 is excludedif its weight factor is equal to zero.

15

Page 34: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 1. CURVES FOR COMPUTER GRAPHICS

P1

P0 P4

P3

P2

w2 = 5

w2 = 1

w2 = 0.5

w2 = 0

0.2

0.4

0.6

0.8

1

0.5 1 1.5 2

Figure 1.9: Influence of the w2 on the NURBS curve

1.3 Subdivision Curves

Another way to describe smooth curves is by subdivision. These curves aredefined by the control points and the associated polygon, and the subdivisionlevel. Basically, subdivision curves are obtained by refining a control polygon,allowing the approximation of Bezier and B-spline curves. The main advantageis the simple adoption to surfaces. Given a set of points Pi, iterative compu-tation yields new points P ki , resulting in a smooth curve. k denotes the levelof subdivision. The new points are the weighted sum of the points obtainedin the previous iteration. The original algorithm proposed by Chaikin is basedon linear interpolation between points on adjacent segments of the polygon, att = 1

4 and t = 34 , for 0≤t≤1. If this is applied to an open polygon of n control

points Pi and n − 1 sides, 2n new points are constructed, two points on eachside, denoted as Q and R, as shown in Figure 1.10. Interpolation yields a newpolygon of 2n−1 sides. This procedure is repeated, and the polygon in the nextiteration becomes smoother. Note that the midpoint of the obtained sides area point on the final curve, also known as the Chaikin curve.

P1

P0 P3Step 1

P2

P4

Step 2

Q0

R0

Q1 R1

Q2

R2

Q3

R3

Step 3 Step 4

Figure 1.10: Chaikin’s algorithm for a control polygon

16

Page 35: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

Chapter 2

Structural Optimization

Considering the subject of this thesis, structural optimization should be ad-dressed in more detail. First, an introduction to the subject is given, followedby a classification of structural optimization. Section 2.3 gives a non-exhaustiveoverview of optimization algorithms. Sections 2.4 to 2.6 discuss the basic termsof the algorithm. In addition, it explains the chosen terms with regard to thisthesis. The chapter concludes with the adopted methodology to structural op-timization.

2.1 Introduction

Optimization implies the improvement of the performance. It does, however,not mean the best solution is obtained. In fact, more often optimization is acompromise to meet the requirements of the object, e.g. aesthetics, structuralperformance, serviceability, and economic aspects. In this thesis, an optimumdesign is therefore defined as being ’the best feasible design according to a pres-elected quantitative measure of effectiveness’ [10]. Even with this information, adistinction can be made in local and global optima, as illustrated in Figure 2.1.The definition of a structure is given as ”any assemblage of materials which isintended to sustain loads” [11]. With relevance to structural optimization, it isthe subject of making an assemblage of materials to sustain loads in the bestway.

17

Page 36: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 2. STRUCTURAL OPTIMIZATION

Global optimumLocal optimum

x

y

Figure 2.1: Local optima and global optimum

Historically, structural optimization is considered to be a mathematical problemin which the lowest or highest value of the function f(x) is sought. As mostoptimization problems are non-linear problems, it can be expressed as a non-linear programming (NLP) problem, which in general form needs to satisfy thefollowing conditions:

minimize f(x) x ∈ Rn

subject to g1(x) = 0 i ∈ Eg1(x) ≥ 0 i ∈ I

xLi ≤ xi ≤ xU1

(2.1)

The given equations express that f(x) is the objective function of n design vari-ables, and subject to equality constraints (E) and inequality constraints (I) onthe variables to define a solution for the optimization process. Depending onthe number of objective functions, the optimization is single or multi-objective.

Much research has been conducted to structural optimization during the last30 years. The area of optimization algorithms has been illuminated, as wellas the integration of structural optimization with non-structural issues. Theformer include algorithms based on mathematics and metaheuristics and thelatter imply the relevance of costs, manufacturing and assembly, and productplatform design [1]. Following the possible types of geometry changes, threemain categories of structural optimization exist:

• Size optimization

• Shape optimization

• Topology optimization

2.2 Geometry

2.2.1 Parametrization

In a three dimensional space the type of geometry change is classified in threecategories. The changes are parameterized by design variable x that movesin a design space, representing a geometric feature of the structure. Sizingparametrization describes a type of structural thickness, i.e. for continuous

18

Page 37: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

2.2. GEOMETRY

structures the thickness distribution and for discrete structures the cross-sectionalarea. It is the most straightforward handling, as the adjustments are relativelysimple and restricted. Moreover, the design domain is usually known a prioriand is fixed. In shape parametrization the design variable represents the nodecoordinates of the model. Movements of the design variables indicate shape ad-justments of the inner holes, in addition to the boundaries of the outer circum-ference. For continuous structures, the shape is determined by its mid-surface orcenterline. Topology parametrization is regarded as the most advanced adjust-ment of geometries. It represents the connection of structural elements. Changeof topology affects the shape as well. However, the topology remains the samewhen the shape is affected as new boundaries are not formed.

2.2.2 Classification

The geometry parametrization is used to define the structural optimizationproblem that needs to be solved. Consequently, the geometry is optimized interms of sizing, shape, and topology as shown in Figure 2.2. Sizing optimizationseeks for the optimal dimensions of the thickness and is in general applied toimprove the local behavior, such as the strength, stiffness, and buckling capacityof structural elements. For large scale problems this requires great computa-tional time, hence, metaheuristic methods are usually applied for solving. Asmentioned before, the design domain can remain constant, and therefore, insuch cases no re-meshing of the model is required for structural analyses. Forshells, sizing optimization is sometimes used in combination with topology op-timization in which the thickness is reduced to zero to create inner holes [12].Shape optimization changes the shape in order to obtain the optimal structuralperformance. In addition to the structural constraints, shape optimization isusually also restricted to aesthetic constraints and needs to stay within a certaindesign domain. In continuum structures the topology optimization is usuallyreduced to a material distribution. It basically determines the number and lo-cations of holes by allowing for the existence or non-existence of material in thedesign space. With relevance to sizing optimization, the topology is changed ifthe thickness of a structure has become zero. Shape optimization is consideredas a subclass of topology optimization; topology optimization is also known asgeneralized shape optimization.

In general, the structural optimization methodologies are based on materialdistribution problems and on parametric geometry problems. The material dis-tribution problem tries to find the optimal location of material within a fixeddesign domain. These problems are primarily used in topology optimization.Parametric geometry based techniques are concerned with shape and size op-timization. Although the former is promising for a large potential increasein structural performance, often shape refinement techniques are also requiredwhen local constraints need to be considered during the optimization. However,a difficulty that can arise is the need to re-mesh the design domain in order tomaintain an accurate finite element model.

19

Page 38: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 2. STRUCTURAL OPTIMIZATION

(a) Sizing (b) Shape (c) Topology

Figure 2.2: Geometry parametrization [1]

2.3 Optimization Algorithms

2.3.1 Classification

In search of the optimum solution for nonlinear problems with several variables,mathematical programming (MP) is a useful technique. The following sectiondiscusses three branches of MP.

Nonlinear programming (NLP) methods require a continuous objective func-tion of x, in which x has a ”continuous”character. As mentioned in Section 2.1,usually criteria as weight or stiffness is set as the objective function, neglectingthe discrete nature of the available member sizes and thickness. Nonlinear pro-gramming can be divided into gradient- and nongradient-based methods. Theformer explicitly includes the design variable of the optimization problem in theobjective function. The gradient information can then be derived and proves tobe a very efficient in the optimization process. However, real-world optimizationproblems often require numerically calculation of the objective function, makingit very difficult to compute its derivatives. The major drawback of nonlinearprogramming is that the global optimum is only guaranteed for convex problems[13].

Heuristic methods have been introduced to solve problems with a discrete na-ture. However, the majority were conceived specifically for a given problem.Heuristic is stated by Polya [14] as the study of the methods and rules of dis-covery and invention. It obtains structural optima using simple local rules.Compared to NLP, it is capable of finding the global optimum and providesvery similar solutions, even within less computational time with certain tech-niques. In bad cases, the method has a very low convergence rate and degenerateto a exhaustive search method.

With the arrival of metaheuristics, problems of both nature can be handled[15]. The method originally treats discrete problems, but can also be adaptedto problems of the other class. It is defined as a set of concepts that can beused to define heuristic methods which is applicable to a wide set of different

20

Page 39: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

2.3. OPTIMIZATION ALGORITHMS

problems. In other words, it is a general framework that provides rules whichneeds only few modifications before it can be applied to specific optimizationproblems, hence the resulting algorithm is different for every problem. The goalis to efficiently and effectively explore the search space. Metaheuristics havebeen applied to complex, large scale problems that are unable to be solved us-ing NLP. Characteristic for these methods are, to some extent, their stochasticbehavior. Due to their discrete nature, they do not resort to often problematiccalculations of the gradients of the objective function. Another advantage isthat metaheuristics lend themselves to all kind of extensions. Moreover, theyare inspired by analogies, as physics, biology and ethology. Drawbacks are thedifficult adjustment of the parameters and the large computational time.

Disadvantages of each of these methods led to the emergence of research tohybrid methods, which endeavor to benefit from the specific positive features ofthe different approaches by combining them [15, 16].

In order to provide a general classification, the above presented methods aredivided into (meta)heuristic and NLP methods. Furthermore, (meta)heuristicis distinguished in single-point and population methods, and NLP methods ingradient and gradient-based methods. Metaheuristic methods based on the sin-gle point search are also known as the trajectory methods. Population-basedmethods use a set of solutions at every iteration of the optimization. The finalsolution strongly depends on the way the population is manipulated.

2.3.2 Multi-objective Optimization

In most structural optimization problems, multiple objectives are involved. Inaddition to the minimization of the weight, it could also be desirable to minimizeother criteria at the same time, e.g. the stress. Handling multiple objective func-tion is complicated and is usually avoided. Intuitively, it can be accomplished inseveral ways. A more systematic concept is called the Pareto optimum solution[13].

• Weighted function method

• Bounded objective function method

• Lexicographic method

• Pareto optimum solution

The first way is to replace the individual objective functions by a general onethat deals with all objectives, in which weighting coefficients are selected toreflect the relative importance of the objectives. This is called the weightingfunction method. Another manner is to select the most important objectivefunction and set constraints to the other functions. This method is knownas the bounded objective function method. In the lexicographic method, theobjectives are ranked in order of importancy. The objective function that ismost important, is minimized first. The following function to be minimized isthen subject to the obtained solution in the previous iteration. In the paretooptimum solution, a feasible solution is called pareto optimal if there is no other

21

Page 40: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 2. STRUCTURAL OPTIMIZATION

feasible solution Y such that fi(Y)≤ fi(X) for i = 1, 2, ..., k, with fj(Y)¡fj(X)for at least one j.

2.3.3 Sensitivity Analysis

Sensitivity analysis determines how the response the model is affected by thechange in parameters. Four common categories sensitivity analysis that are usedin structural optimization can be distinguished [17]:

(i) Overall finite differences

(ii) Discrete derivatives

(iii) Continuum derivatives

(iv) Computational or automatic differentiation

The first approach is one of the most popular methods and is considered tobe a reference method for linear elastic problems. Due to its simplicity, thismethod can be applied to any search techniques, as basically, it defines thedirection in which the search should be conducted. Overall finite differenceconsists of the repeated execution of the analysis code and the use of a finitedifference formula to obtain the derivative as stated in [17]. The derivatives arecalculated by introducing a relatively small perturbation in each design variable.In most cases it performs well, however, it has serious limitations related withtruncation and large step sizes and errors with small step sizes. These errorscan be minimized by applying an appropriate perturbation step to each designvariable. Another disadvantage is related to the computational time. The designsensitivities for an objective function f and constraint g can be written as:

δf

δxi=f(x+ ∆xi)− f(x)

∆xi(2.2a)

δgiδxi

=g(x+ ∆Si)− g(x)

∆xi(2.2b)

where ∆xi is a small perturbation on the variable xi.

The discrete derivatives are computed based on a model that uses finite ele-ments, and the sensitivities are obtained by differentiating the matrix equationswith respect to the design variables. As the structural analysis consists of solv-ing the following equilibrium equation:[

K] {U}

={F}

(2.3)

the derivatives of the matrix equations with respect to the mth design variablexm is: [

K] {

δUδxm

}+{δKδxm

}{U} =

{δFδxm

}(2.4)

The third category is a more general approach than the others. Usually thesederivatives consist of partial integration equations or an integral form. Thedifferentiation leads to a set of continuum sensitivity equations. This is solved

22

Page 41: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

2.3. OPTIMIZATION ALGORITHMS

numerically with the same discretization, but not necessarily, as the one usedfor the structural analysis. The sensitivity can be defined as

δf

δxi= lim

∆xi→0

{f(x+ ∆xi)− f(x)

∆xi

}=

δf

δxi

∣∣∣∆xi

τ=0(2.5)

The last approach refers to a differentiation of the computer code itself, whichexists of many complicated subroutines and functions, or basically just a col-lection of elementary functions. The computational method defines the partialderivatives of the elementary functions, and then the derivatives of the subrou-tines using propagation and chain rule of differentiation. Hence, no approxima-tion is introduced. The derivative of an elementary function a = felem(zi, zj)can be defined as

δa

δs=felemδzi

δziδs

+δfelemδzj

δzjδz. (2.6)

2.3.4 Nonlinear Programming: Gradient-based Methods

Among the many available nonlinear programming algorithms, sequential lin-ear programming (SLP) and sequential quadratic programming (SQP) are verypopular due to their speed and accuracy. Both methods approximate the nonlin-ear programming problem by a linear and quadratic programming, respectively,with the use of Taylor expansions, whereafter it is solved using a gradient-basedsolver. In computational mathematics, nonlinear functions are usually difficultto solve. It often involves the necessity of iterative algorithms to produce asequence converging to the true solution. In general, the sequential algorithmhas the form of the following scheme.

xk+1 = xk + αkdk, (2.7)

where xk is the starting point, dk is the step direction, αk is the step length,and xk+1 is the updated solution.

A drawback of the SQP algorithm is the need for a large amount of mem-ory to store the approximation of the Hessian, i.e. the second order partialderivative of the Lagrangian function. This causes the algorithm to performonly well if the problem does not involve too many design variables. Charac-teristically, SQP works well for smaller design problems with many constraints.SLP is slightly slower in convergence speed and accuracy, but is much simplierand therefore requires far less computer memory. This allows the algorithmto handle much more design variables, however, it is unattractive to use forproblems that must satisfy many nonlinear constraints. As mentioned earlier,nonlinear programming methods typically converge to a local optimum solution,unless the problem is globally convex. SLP and SQP were incorporated due totheir ability to handle large scale problems.

2.3.5 Metaheuristics: Single-point-based Methods

2.3.5.1 Hill Climbing

Hill climbing is a very simple method to search for better solutions. The basicidea is that the next solution is always accepted if it is better than the previous,

23

Page 42: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 2. STRUCTURAL OPTIMIZATION

in spite of the present of any other better solution in the direct neighborhood.A more advanced variant of hill climbing is the steepest ascent hill climbing, inwhich all the points in the neighborhood are evaluated and compared, ratherthan solely a random point. In practice, the number of points is reduced to arealistic value, for example eight.

The best of all candidate solutions is chosen. The initial point is chosen atrandom, and small changes are applied to a single element of the solution. Theprocess stops when no further improvement occurs. The largest drawback ofthe method is the disability to find the global optimum. Furthermore, due toits nature to solely search in the direct surrounding, it is prone to be trappedin local optima.

2.3.5.2 Simulated Annealing

This method is derived from the simulation of thermal annealing of criticallyheated solids. Slow and controlled cooling of the material enables proper solidi-fication with a well rearranged crystalline state, which implies a lowest internalenergy.

At a given point in the optimization process, the algorithm perturbs a randomatom and evaluates the change of the objective function ∆f . The new candidatedesign vector can be accepted in two ways:

1. ∆f ≤ 0

2. ∆f ≥ 0

The first condition assures the new solution is accepted. However, the secondcondition shows that if the new solutions is worse, acceptation is still possible.This is done based on a random probabilistic decision as

P (∆f) = e∆f

KBT , (2.8)

where kB is the Boltzmann’s constant and T is a parameter called temperature.For a high temperature, the order of e approaches zero, and the probability ofacceptance is close to one. Vice versa, if T is low, the candidate solution isrejected. Because the temperature is related to the time, the algorithm is morelikely to accept a bad solution early in the process. The algorithm convergesto an optimum, as it is likely to reject a bad solution in the later stages of theprocess.

The condition described above enables the algorithm to find the global opti-mum, as it accepts a bad solution early in the optimization process, in order tofind another, better optimum. Although the convergence rate can be quite slow,it is very likely to find the global optimum, even for ill-conditioned functionswith many local optima. Moreover, the initial starting point does not affect thequality of the solution, but merely increases the required computational timefor bad cases. For problems subject to constraints, an equivalent unconstrainedfunction needs to be formulated.

24

Page 43: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

2.3. OPTIMIZATION ALGORITHMS

2.3.5.3 Tabu Search

The addition of tabu search methods to the methods discussed earlier is theability to memorize the steps previously taken. Glover describes the method as”a metaheuristic superimposed on another heuristic” [18]. In other words, themethod helps heuristic search methods, in this case a local search or any otherneighborhood search technique, to efficiently explore the design space. Basically,the method prevents the procedure to search in a design space that has beenexplored in an earlier iteration already, unless if it helps to avoid the path thathas already been investigated, hence the term tabu. This memorization enablesthe method to escape from local optimum.

2.3.5.4 Evolutionary Structural Optimization

The primary concept of evolutionary structural optimization is the gradual re-moval of inefficient material from the structure, leading to a more or less fullystressed structure. The method was first proposed by Steven and Xie [19]. Be-fore each removal, a finite element analysis is conducted. The removal is basedon very simple rules observed from nature and conducted by assigning a certainlevel to an element. The stress level is determined by the ratio of the stress ofelement i and the maximum element stress in the structure.

The structural optimization problem can be written as

minimize fC =1

2uTKu (2.9a)

subject to V ∗ −N∑i=1

Vixi = 0 (2.9b)

xi = xmin ∨ 1 (2.9c)

in which K and u are the global stiffness matrix of the structure and the dis-placement vector, and V ∗ and Vi the prescribed total volume and the volumeof an individual element, respectively.

The removal or addition of elements can be written respectively as

σe ≤ RRσmax 0 ≤ RR (2.10)

in which σe is the stress in element e, σmax is the maximum stress of the struc-ture, and RR is the rejection and addition ratio.

The ESO approach is a very simple, but effective way to solve optimizationproblems. Due to this simplicity, drawbacks are also recognized. Fundamentalis the strong dependence of the solution on the sequence of elements removal.The previous removal influences the new structural behavior. Multiple optimalsolutions thus exist, and convergence to a global optimum is absent. However,in many cases the ESO approach resulted in solutions with equal or betterperformance than obtained by more sophisticated methods[20]. The intuitiveapproach also leads to the disability to handle more complex problems. More-over, removals are restricted to the predetermined area or volume of the finiteelement mesh. A major advantage is that ESO is capable of handling multipleloading cases.

25

Page 44: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 2. STRUCTURAL OPTIMIZATION

2.3.6 Metaheuristics: Population-based methods

2.3.6.1 Genetic Algorithm

Evolutionary Computation is a modern search technique that has its roots datedin 1970s. The term, however, exists only since 1991 and represents the tech-niques involved with Darwinian evolution of survival of the fittest and naturalselection. These evolutionary algorithms have in common that they exhibit thefollowing procedure: reproduction, random variation, competition, and selec-tion. One of these evolutionary algorithms is genetic algorithm (GA).

GA consists of a population, made up of individuals. From this population,the fittest parents are selected to make a child.a new solution evolutes.The canonical GA can be distinguished from other evolutionary algorithms bythe following three features:

• Representation by bitstrings

• Proportional selection

• Primary method of producing variations by crossover,

of which the latter is most characteristic for the GA. The reproduction operatordetermines on which individuals the genetic operator should be applied to createa child. For this reason, each individual is ranked based on their fitness value.Individuals with a higher fitness have a greater chance of being selected forreproduction, and thus survival of the fittest hold.A mutation operation is the random alternation of some of the genes in a string.This operation is conducted independently of the crossover operation, and canbe applied to ensure the diversity of the population.

It should be noted that GAs should only be used when no other traditionalmethods are available, due to the related increase of computational time, whilethe same results are obtained. Although the method is capable of solving com-plex problems that are unable to be solved with traditional methods, for bothmethods hold that the use of higher order polynomial objective functions re-sults in more computational time. One should weight up the linearization ofthe problem in order to make nonlinear programming applicable against theapproximation of the real problem by GAs. Another advantage is the capabil-ity of escaping from local optima, although this is not guaranteed and is oftenrelated to a high computational time. The best advantage of GAs are that theyprovide a methodological framework that is easy to be applied, and that it iseither usable as a black-box method or as a tool that can be easily adapted tohandle new problems or existing problems better. This means that the methodis very robust to a wide set of applications. However, their ability to providefairly good solutions in extremely ill conditioned problems may be consideredas a disadvantage as well, because in some cases the ill condition is due to theuse of wrong parameters [21].

2.3.6.2 Ant Colony Optimization

Ant colony optimization (ACO) is inspired by the pheromone trail laying andfollowing behavior of some ant species.

26

Page 45: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

2.3. OPTIMIZATION ALGORITHMS

F

N

a

b

1

F

N

2

F

N

3

Figure 2.3: Shortest path found by an ant colony using a pheromone trail [2]

ACO algorithms are characterized by the way the pheromone update is imple-mented and lead to different update rules for each algorithm. Two mechanismsexist to achieve this goal: deposit and trail evaporation. Depositing increasesthe level of pheromone of solution components associated with a chosen setof good solutions. The second mechanism decreases the pheromone spread byprevious ants. A too fast convergency rate to a suboptimal region is herebyprevented, motivating new search space to be explored.

The presence of a stochastic component allows ACO to explore a wide vari-ety of solutions, while the use of heuristic information can guide towards themost promising solutions. Acquired experience is used to influence the solutionconstruction in future iterations. ACO show their greatest advance when ap-plying to ”ill-structured” problems for which it is not clear how to apply localsearch, or to highly dynamic domains where only local information is available[22]. Final, the algorithms can said to be robust and is capable of finding theglobal optimum.

2.3.6.3 Particle Swarm Optimization

Particle swarm optimization (PSO) mimics the behavior of organisms in a so-cial system, e.g. bird flocks or fish schools. These methods rely heavily onthe manipulation of the velocity by which the distance between two particlescan be bridged. Fundamental to the development of PSO is the observation offish schools as stated by sociobiologist Wilson [23]:”In theory at least, individualmembers of the school can profit from the discoveries and previous experience ofall other members of the school during the search for food. This advantage canbecome decisive, outweighing the disadvantages of competition for food items,whenever the resource is unpredictably distributed in patches.” Important isthe movement of the group as a whole towards the optimum solution.

Some versions of PSO are capable of finding the global optimum, although thisphenomenon is not guaranteed. Furthermore, the convergency rate towards theoptimum and of the velocity is strongly dependent on parameters. The methodis extremely simple and is applicable to a wide range of problems.

27

Page 46: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 2. STRUCTURAL OPTIMIZATION

Figure 2.4: Particles are moving towards the optimum, denoted by the cross [3]

2.4 Objective Function

Traditionally, minimizing the weight has been the major drive behind the struc-tural optimization. However, other non-structural criteria can play an importantrole as well. Regarding the total costs, the building weight is less relevant if thematerial costs is small compared to other costs, e.g. manufacturing or assemblycosts [1]. With reference to the structural performance, a slight change in thegeometry of the shell or arch can lead to a huge improvement. In addition tothe weight, other objective functions, such as buckling load, compliance (verti-cal displacements) and maximal stresses, can be chosen to satisfy the structuralrequirement of strength, stiffness and stability.

A first approach to determine the stability involves an eigenvalue buckling anal-ysis. A more realistic and accurate value is obtained by conducting a nonlinearbuckling analysis. Simply said, this method employs a nonlinear static analysiswith gradually increasing loads to seek the load level at which the structurebecomes unstable. As the stiffness changes during the deformation process, thestiffness matrix must be updated in every iteration, increasing the amount oftime to obtain accurate results. For this reason, the analysis of stability of thestructures are beyond the scope of the thesis.

In general, free form structures exhibit bending moments, resulting in highstresses and a large compliance. Moreover, shells are usually designed as thinstructures, which are prone to sagging. Therefore, it is necessary to minimizethe stress and compliance, in order to meet the strength and stiffness require-ments.

Over the years, several suitable objective functions to optimize the shape havebeen proposed [24]. One can minimize the highest principal stress in order tofind a state of uniform membrane stresses, such that bending is minimal. Thebending moment can be addressed when a structures is sought that is governedby axial forces, to find a minimal amount of material. By minimizing the strain

28

Page 47: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

2.4. OBJECTIVE FUNCTION

energy, the bending moment can also be reduced indirectly. The compliancecan be related to the maximum displacement, if insight in the local behavior isdesired. Insight in the global behavior of the structural stiffness can be revealedby minimizing the strain energy.It is possible to minimize both the compliance and stress by performing amultiobjective optimization, according to one of the methods discussed in Sec-tion 2.3.2. However, above has been indirectly described already how the re-duction of both stress and compliance can be met by using only one criterion.Therefore, in order to decrease the stress and compliance the main objective ofthe structural optimization is to minimize the strain energy, as given by (2.11).

Es =

∫ l

0

(N2x

2(EA)x+ η

V 2x

2(GA)x+

M2x

2(EI)x+

T 2x

2(GIt)x

)dx. (2.11)

The contribution of the shear force to the internal forces is very small, andhence neglected. Torsion is not taken into account. The optimization problemcan therefore be written as

min Fshape(x) =1

2

∫ l

0

(EAε(x)2 + EIκ(x)2dx). (2.12)

A general accepted method to design arches is the statical analysis. The methodfinds structures that exhibit pure axial forces and no bending moments. In otherwords, the objective is to minimize the stresses. Optimizing to the strain en-ergy, involves minimizing the strain, in addition to the stresses. As a result,both objective functions lead to different solutions as seen in Figure 2.5. Notethat the blue structure should be infitinely high. Because the method of staticalanalysis neglects the strain, the height of the structure keeps rising, as this leadsto smaller axial forces and thus, stresses.

When performing size optimization, there are also several possible objectivefunctions. Regarding the main objective of the structural optimization, sizeoptimization should contribute to the reduction of the strain energy. How-ever, if the definition of the strain energy is better examined, it is clear thata larger thickness leads to smaller stresses and strains, and hence a decreasein the strain energy. For this reason, it might be worth to consider the totalvolume of the structure as well. The process of increasing size is terminated ifall the stresses have met the requirements. Another option is to redistribute apredefined volume of material over the structure. Material at locations that areover-dimensioned, is moved to locations at which the stress exceeds the maxi-mum allowable value. In this way, the total volume remains constant. However,the final solution does not necessarily satisfy the required strength. The opti-mization process can also start with a very large thickness. The thickness isthen reduced for locations that have minimum stress levels, until further reduc-tion exceeds the allowable stresses. However, this process is conflicting with themain objective, as it increases the strain energy, instead of decreases. Applyingthis method would then require a different formulation of the objective function,or the size optimization should be independent of the shape optimization. Fur-thermore, because the process starts with an over-dimensioned structure, theresulting weight is more likely to be larger than when optimized by increasing

29

Page 48: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 2. STRUCTURAL OPTIMIZATION

Hei

ght

[m]

F (x)= stress

F (x)= strain energy

Span [m]

Figure 2.5: The results when optimizing to stress or strain energy. The blue structureshould be infinitely high.

the weight.

Concluding, the specific goal of the size optimization is to minimize the vol-ume of the structure. The objective function is defined as

min Fsize(x) =

nElem∑i=1

V olumei, (2.13)

in which nElem is the number of elements, and the V olumei is the length ofthe element i times the average thickness of the element.

2.5 Constraints

Optimization algorithms can be divided into constrained and unconstrainedproblems. The approach to both problems is different, because in the former,the goal is not to find the global optimum.

In structural optimization, constraints can be structural or geometrical of na-ture. Geometrical constraints are usually the result of architectural or construc-

30

Page 49: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

2.5. CONSTRAINTS

tive requirements. Structural constraints are related to the material properties,e.g. the yield stress, own weight, amongst others.

Constrained optimization is obtained by introducing a penalty into the objec-tive function, or by using the barrier method. In case of the barrier method,a term is added that favors the search to be performed in the feasible regionover the regions near the boundary. It is also possible to define the feasiblegeometrical boundary, in which the search is forced to be performed. By doingso, it is possible to find good solutions near the boundary. For this reason, thelatter form has been applied in the thesis.The other method is based on the concept of penalty functions, which penalizesunfeasible solutions. A penalty is added to the objective function. If no viola-tion occurs, the penalty is equal to zero. In general, rejection of the unfeasiblesolution is done based on the degree of violation. The most simplistic form isthe death penalty, i.e. the solution is rejected immediately. In the minimizationproblem of this thesis, an unfeasible solution is set equal to the worst feasiblesolution, and is penalized in that way. It is also possible to backtrack to the pre-vious feasible solution, and find new solutions by reducing the mutation value.This process is repeated until a feasible solution is found, or until the minimalvalue has been applied. If in the latter case, the solution is still unfeasible, itwill be rejected.

The geometrical constraints are determined as follows. The user defines a socalled envelope of the geometry, by setting the value in which the control pointscan vary, as shown in Figure 2.6. If a solution falls outside the envelope, the vi-olating control points are replaced by its upper or lower bound. This constraintdetermines the size of the design domain. If the domain is very small, it impliesthat the optimized solution cannot alter much from the original model. On theother hand, an enormous design domain allows a true form finding, because theoptimization algorithm is free to search in all possible directions, and can finda solution which was unforeseen and is the global optimum.

31

Page 50: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 2. STRUCTURAL OPTIMIZATION

(a) In a small design domain, the goal is tofind the local optimum. The optimum formcan be found within the thin continuous lines.

(b) In a large design domain, the goal is tofind the global optimum. It is not straightfor-ward to predict what the optimum form willbe like.

Figure 2.6: The size of the design domain determines whether the goal is to findlocal or global optimum. The domain is defined by the discontinuous lines.

Another constraint is defined by the presence of loops in the geometry. In a 2Dstructural model, loops describe an unrealistic situation. At an intersection, anode is not modeled, hence, the elements go through each other. The algorithmcould perhaps escape from a loop, but as this is not guaranteed, such solutionsare rejected immediately.The use of B-splines allows the sides of the polygons to intersect each other,without necessarily describing loops in the geometry, as illustrated in Figure 2.7.

(a) No intersecting curve (b) Intersecting curve

Figure 2.7: Intersecting polygon can describe both intersecting and non-intersectingcurve

Therefore, the curve itself must be checked for loops. This can be done asfollows. For a new segment on the curve, the intersection with each of theearlier described segments is determined. In Figure 2.8a the intersection (thegreen marker) of the blue and purple segment is determined, and falls outsidethe range of both segments. On the contrary, an intersection that lies on bothsegments means that a loop is detected, as is the case for the intersection ofthe purple and red segment. The first point on the loop is then moved to theintersection to maintain the specific geometry. Segments that are described by

32

Page 51: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

2.6. VARIABLES

points that lie on the loop are disregarded. The result is a curve in which anyexisting loops are eliminated, as illustrated in Figure 2.8d.

(a) Determining an intersection (b) Determining the loop and first point onthe loop

(c) Replacing the first point on the loop (d) Curve without loop

Figure 2.8: Process of eliminating a loop

Finally, the structural constraints depend on the minimum and maximum al-lowable stress of the considered material. This is defined as

σmin < σi < σmax (2.14)

where σi denotes the stress in the ith element.

2.6 Variables

First must be acknowledged that the range of variables, i.e. the size of thedesign domain, strongly determines the morphogenetic process [25]. The sameholds for the number of parameters. Both control the size of the design space.A smaller design space leads to a solution that is close to the initial model andthe objective function is optimized without incredibly changing the global ge-ometric model. A wider design space enables a true morphogenesis, enlargingthe odd that the global optimum solution is found. The consequence is that

33

Page 52: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 2. STRUCTURAL OPTIMIZATION

the final solution might be completely different from the initial model. From anaesthetic point of view, the result could be uninteresting. On the other hand,solutions can be found that were unforeseen by the designer. Moreover, it showsthe optimal geometry for the given design criteria.

Relatively regular shapes can be described using explicit functions of two para-metric variables. If free forms are involved, B-splines offer better control overthe desired geometries, as discussed in Section 1.2.2. This type of curve allowsa high degree of geometrical complexity with a low order polynomial function,in addition to local control. The design variables are represented by the con-trol points of the shape and its associated thickness parameter. Changes in thecurve are automatically obtained by modification of the control points, withoutsacrificing the smoothness and complexity of the geometry. Some research mod-ify the control points only in the height [25]. Although this greatly reduces thecomplexity, the question is whether this enables a true morphogenesis. There-fore, the variables are allowed to move in all directions. The thickness t couldbe defined explicitly for only the knots, which in Figure 2.9 is represented bythe continuous arrows. Intermediating points are assigned a thickness by linearinterpolation of the thickness of the neighboring knots. The number of variablesthus can be kept relatively low, which is beneficial in structural optimizationproblems.

k1 k2 k3 k4Explicitely defined thickness Linear interpolated thickness

t1

t2

t3 t4

Figure 2.9: Linear interpolation of the thickness of intermediating points

Another advantageous feature of B-splines concerns the design aspect. Thecurve allows local control, i.e. change in one part of the geometry does not af-fect another part. This provides the possibility for the designer to decide whichparts may be subject to optimization.

Finally can be said that B-splines are advantageous due to their ability to de-scribe both continuous and discontinuous curves. In some cases, the optimumstructure must exhibit a kink, e.g. when subject to a central load. The optimiza-tion algorithm will tend to find discontinuous curves. One way to describe thesecurves with B-splines is by placing three control points on the same position. Ifsuch solutions are undesired because of for example, architectural reasons, dis-continuities can be avoided by placing these three control points further awayfrom each other, as shown in Figure 2.11.

34

Page 53: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

2.7. METHODOLOGY

(a) Initial curve (b) Curve with modified part

Figure 2.10: Modification of a part of the B-spline curve without affecting the entirecurve

B-spline

Control points

(a) Soft edge

B-spline

Control points

(b) Hard edge

Figure 2.11: Description of the discontinuity of B-splines

2.7 Methodology

This Master’s thesis considers 2D free forms, hence, it is limited to size andshape optimization. As already mentioned in Section 2.5, in this thesis a dis-tinction is made between form-refining and form-finding. The former implies aslight change of the geometry in order to find a solution which better satisfiesthe criteria. If the mutation is allowed to be larger, the nature of the changingthe process moves from improving the form to finding a new form. Hence, thedesign space determines whether the problem is to find the form, or to refinethe form. It is therefore necessary to discuss the differences in the process ofform-refining and form-finding.

Form-refiningIn a traditional design process, the architect makes a complex design that hasemerged from a concept, after which it is handed over to the engineer to designthe structure or to improve the structural design. In addition to the set of design

35

Page 54: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 2. STRUCTURAL OPTIMIZATION

requirements, the final geometry should stay close to the preconceived design.In essence, the problem is to find the local optimum. Consequently, it is likelythat the final design exhibits relatively large bending moments, in addition toaxial forces.

Form-findingOn the other hand, if a true morphogenesis is possible, the problem shifts tofinding the global optimum. The final structure should be governed by axialforces, with no or acceptable bending moments [24].

Many research has been conducted to the shape optimization of shells [25],[24].Size optimization is sometimes included, although, it is acknowledged that thestructural behavior is essentially due to the configuration. In some cases, thesize optimization is omitted due to architectural reasons [25]. However, in gen-eral, it is unknown whether a change in size or shape results in a better solution.Therefore, another question that remains is, how does size and shape optimiza-tion contribute to form-improving or form-finding?

Contribution shapeAs defined earlier, the goal of shape optimization is to reduce the total strain en-ergy. This implies the decrease of the global stiffness and the average stress level.

• to form-refiningIf the geometrical boundaries are relatively small, and the initial designexhibits large bending moments, the bending moment in the structure re-mains large after shape optimization. If the initial design exhibits smallbending moments already, form-improving can greatly reduce the axialforces.

• to form-findingIn form-finding, the minimal strain energy level is inherent to minimumbending moment. Thus, when optimizing the shape to find lowest level ofstrain energy, the shape is dominated by axial forces. No other configura-tion yields a lower strain energy.

Contribution sizeThe main effect of size optimization is the reduction of local stresses and com-pliance. Furthermore, the weight must be minimized as well.

• to form-refiningIf the geometrical boundaries are relatively small, and the initial design ex-hibits large bending moments, the solution exhibits relatively large bend-ing moments as well. The thickness must transmit bending moments, inaddition to the axial forces. If the initial solution exhibits small bendingmoments, the size is mainly mutated to find a fully stressed design.

• to form-findingThe final solution exhibits minimum bending. Increase of size affects the

36

Page 55: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

2.7. METHODOLOGY

structural behavior insignificantly. Therefore, size is mainly necessary toreduce the local stresses and compliance in order to meet the maximumallowable stress and compliance.

This distinction determines at which stage in the global optimization process thesize and shape optimization should take place. Three methodologies are givenfor solving the structural optimization problem. A first approach is to decidewhich change must be applied (Figure 2.12a). In each iteration, a mutation ofsize, shape, and both size and shape are compared. The mutation that gainsmost, is chosen. A second approach is to alter the size and shape optimizationduring each iteration(Figure 2.12b). The best size and shape mutations areadopted. The final approach is to optimize the shape first, whereafter the sizein improved (Figure 2.12c). Optional is to repeat the steps until both size andshape mutations yield no further improvement.

When form-refining, the shape is constrained, and hence the size should increaseto contribute to transmitting the existing bending forces. Nonetheless, a smallmodification of the shape can lead to huge improvements. It is therefore inter-esting to know, which mutation should be adopted, hence, a sensitivity analysisis performed first. Approach A would be suitable in this situation. For goodshells and arches, the structural behavior depends mainly on their form. In thiscase, the structural behavior is dependent on both the size and shape. Suchan inherent coupling means that size and shape should not be optimized sepa-rately. Moreover, if the size is increased to meet the strength requirement, thestructural behavior changes. Approach B is therefore also appropriate, becausethe optimum shape depends on the distribution of the size, and vice versa. Amutation in the one leads to a different, better initial structural behavior forthe other and so on.

When the initial geometry in the form-finding process exhibits large bendingmoments, optimizing the size in an early stage would be useless, or even wrong.If the structure is assigned a size during one of the early iterations, the size isvery large, because the structure still exhibits large bending moments. However,in form-finding, the goal is to find the global optimum. Hence, the final solu-tion is governed by axial forces, with relatively small or no bending moments.The size thus can remain small. Therefore, it is useless to let the thicknessincrease first, whereafter it should decrease. More interesting would be to opti-mize the shape, whereafter the size is optimized as illustrated in Figure 2.12c.The optimization is started with a minimum thickness, because it is unknownwhether the size is able to decrease from a very large value to an optimumthickness. Also, the axial forces are highest at the supports and smallest at themid-span, thus the weight is positioned largely at the supports. An increaseat such location influences the mechanical behavior only slightly. In situationswhere the structure is not completely free of bending moments, the increaseof the thickness leads to an worsening of the structural behavior, because thisusually occurs half way the span. However, because the bending moments arerelatively small, this is assumed to be negligible small as well. Additionally, ifthe form of structures with initially relatively small bending moments is refined,

37

Page 56: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 2. STRUCTURAL OPTIMIZATION

Siz

eShape

Weig

ht

Strain

energy

Crit

erio

nm

et?

Yes

ST

OP

ST

AR

T

No

Shape

Siz

e&

Weig

ht

&

Strain

energy

analy

sis

Sensit

ivit

y

(a)

Ap

pro

ach

A:

Form

refin

ing

with

un

defi

ned

sequ

ence

top

er-fo

rmsh

ap

ean

dsize

op

timiza

tion

ST

AR

T

Shape

Strain

energy

Siz

e

Weig

ht

Crit

erio

nm

et?

Yes

ST

OP

No

(b)

Ap

pro

ach

B:

Form

refin

ing

with

pred

efin

edseq

uen

ceto

per-

form

shap

ean

dsize

op

timiza

tion

ST

AR

T

Shape

Strain

energy

Siz

e

Weig

ht

Crit

erio

nm

et?

Yes

ST

OP

Crit

eriu

mm

et?

Yes

No

No

Converged?

Yes

No

(c)

Ap

pro

ach

C:

Form

refin

ing

with

pred

efin

edse-

qu

ence

top

erform

shap

ean

dsize

op

timiza

tion

Figure

2.12:

Diff

erent

appro

ach

esfo

rstru

ctura

loptim

izatio

nto

form

-refinin

gand

form

-findin

g

38

Page 57: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

2.7. METHODOLOGY

a state that is comparable to the later stages in the form-finding process, simul-taneously performing size and shape optimization is valid, as has been done in[24]. The size optimization is started with an minimum value as well.As discussed above, form-refining and form-finding require a different approach.The focus of this thesis is put on the form-finding, and hence the goal is tofind the global optimum. This provides the user a good understanding of howthe forces acting on the structure, are related to the form. Hence, the chosenmethodology is approach C. Moreover, because size and shape optimization aredifferent problems, the thesis is limited to shape optimization.

39

Page 58: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer
Page 59: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

Chapter 3

Choosing an Algorithm forShape Optimization

This chapter presents the considered algorithms to be further used in the thesis.The chapter explains the adaptation of the algorithms to the thesis’ problem,and discusses their ability to solve structural optimization of free forms. Sec-tion 3.2 elaborates on the steepest descent hill climbing algorithm (HC). Becausethe algorithm performs a simple sensitivity analysis, the method is very effectiveand straightforward. In Section 3.3 the implementation of the genetic algorithm(GA) is illuminated. The main advantage of the genetic algorithm (GA) is theability to adapt its simple methodology to new problems. Moreover, the GAdoes not require a polynomial function representation of the objective functionin order to obtain better solutions, but measures the fitness values. In Sec-tion 3.4 the features of both GA and HC are combined. Due to the GA, thehybrid algorithm should be capable of finding the global optimum, while theHC provides an effective search. Section 3.6 compares the algorithm based ontheir ability to find the global optimum, and the conducted number of finiteelement analyses.

3.1 Introduction

The thesis considers three load cases, i.e. a concentrated load positioned at thecrown of the structure, a projected uniformly distributed load over the full span,and a uniformly distributed load that is comparable to self weight. For each ofthese load cases, a global optimum solution can be given. These solutions areused to measure the accuracy of the considered algorithms.

A structure with a span of 10m is analyzed. For these analyses, the choiceof section properties is irrelevant. The structures are simply supported at bothends, hence, the structural behavior remains constant for different beam sec-tions. Moreover, the goal is to reduce the average level of stress and strain to aminimum, rather than obtaining a certain value. The section used is thereforechosen at random, and is an HE100A. The material is steel S235. For a con-centrated load, it is known that the local optima is a triangle with its vertexpositioned under the load. The load is imposed halfway the span, and is referred

41

Page 60: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 3. CHOOSING AN ALGORITHM FOR SHAPEOPTIMIZATION

to as LC 1. The optimum height is found by varying the height of the structure,and is around 7.1m for an imposed load of 100kN . The corresponding strainenergy is 7.46e−2kJ . When a projected uniformly distributed load is imposed,a parabola structure is described using

y(x) = ax2, (3.1)

where a varies from 0.05 to 0.08. This is equivalent to a height varying from1.25m to 20m. This load case is referred to as LC 2. For an imposed load of1kN/m2 the optimum height is found around 5.6m and the corresponding strainenergy is 2.79e−4kJ . A catenary is the optimal form when the structure mustcarry merely self weight. The catenary is defined by

y(x) =H

q0cosh

(−q0x

H

)+H

q0, (3.2)

where H denotes the horizontal reaction force and q0 is the self weight, referredto as LC 3. For a load of 1kN/m2, the optimum height lies around 3.7m with astrain energy of 4.45e−4kJ . The course of the strain energy for heights varyingfrom 1 to 20m is shown in Figure 3.2, and the optimum solution is given inTable 3.1.

P

10m

(a) Subjected to a concentrated load = LC 1

q

10m

(b) Subjected to a uniformly projected load:projected = LC 2 or self weight = LC 3

Figure 3.1: A structure with a span of 10m is considered and subjected to load casesfor which the optimum solution is known

Table 3.1: The optimum height and corresponding strain energy for a structure of10m span, subjected to different load cases

Load case Height Strain energy[m] [kJ]

LC 1 7.1 7.46e−2

LC 2 5.6 2.79e−4

LC 3 3.7 4.45e−4

3.2 Steepest Descent Hill Climbing

The structure of a steepest descent hill climbing is as follows.

1. Evaluate the current solution

For each variable:

42

Page 61: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

3.2. STEEPEST DESCENT HILL CLIMBINGStrain

energy

[kJ]

0.35

0.2

0.25

0.15

0.1

2

0.05

0

0.4

0.45

0.5

4 6 8 10 12 14 16 18 20

Height [m]

0.3

(a) Triangle subjected to a concentrated loadhalfway the span

Strain

energy

[10e

−2

kJ]

7.485

7.475

7.48

7.47

7.465

6.6

7.46

7.455

7.49

7.495

7.5

6.8 7 7.2 7.4 7.6

Height [m]

(b) Close up around 7m

Strain

energy

[10e

−2

kJ]

0.1

0.06

0.08

0.04

2

0.02

0

0.12

0.14

4 6 8 10 12 14 16 18 20

Height [m]

(c) Parabola subjected to a projected uni-formly distributed load

Strain

energy

[kJ] 0.006

0.003

0.004

0.002

2

0.001

0

0.007

0.008

4 6 8 10 12 14 16 18 20

Height [m]

0.005

(d) Catenary subjected to self weight

Figure 3.2: The course of the strain energy over the height of a structure with spanof 10m for different load cases

2. Perform a SA while the other variables are fixed

3. Define the best mutation direction and value

Next

4. Mutate all variables in their best direction and to their best value

5. Evaluate the new solution

6. Replace the solution if better than the previous solution

If the new solution is better than the current solution, repeat step 2 to 5. If thenew solution is worse, repeat step 3 to 5 to find another path to the optimum.Else, stop the process.

Characteristic of the hill climbing algorithm is the performance of the sensi-tivity analysis (SA) in order to find the path to the optimum. This will beexplained in the following section, as well as the methods to help the algorithmescape from local optima.

3.2.1 Sensitivity Analysis

The steepest descent hill climbing algorithm explores the direct surrounding ofthe solution. This surrounding can be found by moving the control points in asmall area. If this is done for each control point, the direct surrounding of the

43

Page 62: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 3. CHOOSING AN ALGORITHM FOR SHAPEOPTIMIZATION

initial model is illustrated in Figure 3.3a. The sensitivity analysis is performedto determine how the control points should be moved to maximal minimize theobjective function. Rather than moving the control points in every direction,it is more efficient to consider only a few directions. In this case, eight fixeddirections are chosen (See Figure 3.3b).

(a) The direct surrounding of the geometry is defined bythe direct surrounding of the control points

Pi

(b) The direct surrounding ofthe control point is reduced toeight directions

Figure 3.3: The steepest descent hill climbing algorithm explores the direct sur-rounding of the solution

The size of the movement should be as large as possible to obtain a maximumreduction in the objective function, while it should be small enough to staywithin the direct neighborhood. Moreover, a large size enables the algorithmto jump over a local optimum. For geometrical reasons, the minimum size is0.0125m. The largest size is set to 0.8m. The direct surrounding is divided intoseven zones, where the next zone size is twice the size of the current zone, asillustrated in Figure 3.4.The sensitivity analyses is performed as follows. The first and last control pointsare fixed, thus start with P2. First, the variable is moved in direction 1, overdval for val= 1 to 7 (see Figure 3.4). Every mutation results in a new solution,and a corresponding strain energy. The sensitivity value of this mutation isdenoted by

αi,dir,d = Es,i,dir,d.

After the first direction, the other directions are analyzed. After P1 is analyzed,move the control point back to its original position, and perform the sameanalysis for P2. By returning each control point to its position, the influenceof moving one control point on the current solution can be measured. If allvariables have been analyzed, the best mutation of each variable is determined.The best mutation is the one with the lowest sensitivity number.

44

Page 63: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

3.2. STEEPEST DESCENT HILL CLIMBING

0.0125m

0.025m

0.05m

0.1m

0.2m

0.4m

0.8m

Pi

d1

d2

d3

d4

d5

d6

d7

Figure 3.4: The control point Pi can move over seven distances to enable the algo-rithm to escape from local optima.

3.2.2 Escape from local optima

The new solution of iteration t can then be obtained in two ways. The first isto mutate the control point with the lowest sensitivity number. The other wayis to mutate every control point. The latter enables the algorithm to escapefrom local optima. The resulting solution is a new solution, derived from thebest mutations of the control points. The method requires less iterations, andfinds a better optimum than when mutating only one control point each time,and is therefore adopted to use in further analysis. Figure 3.5 illustrates theprincipe of both methods. The red vector represent the best sensitivity value ofthe corresponding control point. The blue vectors denote the mutation that isactually adopted. At the bottom left, it can be seen that only the control pointwith the smallest sensitivity value is moved, while in the right figure, all thecontrol points undergo their best mutation. The results are given in Table 3.2.

Table 3.2: The results of mutating one control point or all

1 control point All control pointsno. iterations 138 56Es [kJ ] 0.205 0.166

If Es,t < Es,t−1, then the solution is accepted. Else, then the algorithm is ter-minated. However, despite this technique to help the algorithm avoiding a localoptimum, the algorithm is still prone to encounter such a optimum. In a worstcase scenario, the algorithm terminates after conducting several iterations, whilethe the solution has not converged yet, as shown in Figure 3.6. The algorithmfinds a worse solution after five iterations. Another method to escape from suchlocal optima, is backtracking. Backtracking is a refinement of the line searchingof the steepest descent hill climbing algorithm. If the path to the optimum,plotted by the algorithm, encounters a dead end, backtracking removes the lastpart of the path, and finds a new, better path. The position on the path wherebacktracking returns to, is the previous solution. Figure 3.6 shows the path

45

Page 64: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 3. CHOOSING AN ALGORITHM FOR SHAPEOPTIMIZATION

SensitivityDisplacement

The control point with thelargest sensitivity is mutated

Every control point is mutatedP1

P2

P3

P4

P5

Figure 3.5: Generating a new solution by either mutating one control point, or all

plotted by the algorithm for a structure subjected to a uniformly distributedload. The object is to minimize the strain energy. Thus, when a solution is foundwith a strain energy level that is higher than the previous solution, backtrackingis invoked. The solution is deleted, and a different mutation is applied to theprevious solution. The mutation is determined by choosing the best mutationfor each variable again, but now ignoring the previous largest mutation. Thisguarantees that another mutation is adopted. Thus, if the backtracking is usedfor the first time, the control points cannot be moved over d1 (see Figure 3.4).Backtracking is repeated until a better solution is found. For the next iteration,the maximum distance where over the control points can be moved, is set backto d1.

Another way for backtracking to define a new path, is by applying the bestmutation of each control point in ratio of its rank. In Figure 3.5, P3 is ranked3, and P2 and P4 are ranked 1 and 2, respectively, based on their sensitivityvalue. The associated distance to move the control points are 0.8m for P2 andP3, and 0.4m for P4. The new distance to move the control points is defined by

di,t = ranki ∗ rankhighest ∗ di,t. (3.3)

The disadvantage is that the solutions converge slower, because the method iscomparable to mutating only one control point per iteration. Therefore, thisway of backtracking is only invoked if the other method cannot find a better

46

Page 65: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

3.3. GENETIC ALGORITHM

path.

Str

ain

ener

gy[1

0e3

kJ]

30

20

25

15

10

120Solutions [-]

5

0

35

45

40

50

10080604020

Backtracking isinvoked

Figure 3.6: The graph shows the course of the strain energy during every analysis. Inthis example, the structure is defined by 9 control points, and subjected to a uniformlydistributed load. At some moments, for example at solution 5, the solution has a largerstrain energy level than the previous solution. At this point, the algorithm encountersa local optimum, and would stop in a normal situation. However, when backtracking,the algorithm does not accept such a solution. Instead, the algorithm reverses themutation, and tries to adopt a smaller mutation, until a better solution is found. Thealgorithm is terminated if the smallest mutation possible has been analyzed and doesnot yield a better solution.

3.3 Genetic Algorithm

In a GA, the general structure is as follows

1. Initialize the population

2. Evaluate the population

3. Select individuals for reproduction

4. Apply operators

5. Evaluate newborn offspring

6. Replace worst parent by offspring if offspring is more fit

If the solution satisfies the criterion, the process is stopped. Else, repeat step2 to 6. Each of these steps are discussed in the following paragraphs and theircharacteristics are highlighted.

3.3.1 Encoding of the individuals

Before a GA is started, the problem must be translated such that a parent issuitable for reproduction and selection. In the canonical GA, individuals arereferred to as chromosomes, which are composed of genes. The genotype is the

47

Page 66: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 3. CHOOSING AN ALGORITHM FOR SHAPEOPTIMIZATION

genetic code of the chromosome, and its genes are manipulated. The individualis called the phenotype, i.e. the physical expression, the organism itself. Thephenotype is decoded by the genotype. The GA manipulates the genotypes,and evaluate the phenotype.

In this thesis, an individual is the free form. The genetic code is composedof the control points n that describe the form: Pi for i = 0 to n + 1. In otherwords, the GA manipulates the control points, and the free form is analyzedto obtain the fitness, i.e. the strain energy of the form. In Figure 3.7 the con-tinuous curve represent the phenotype, and the markers denote the genotype,composed of an x- and y-parameter.

P1(x1, y1)

P2(x2, y2)

P4(x4, y4)

P3(x3, y3)

P5(x5, y5)

Figure 3.7: The genetic code and the physical expression

3.3.2 Initialization of the population

A population size that is too small, would not provide enough variation to ex-plore the search space effectively. On the other hand, a too large population sizeprobably will not find an optimal solution in a reasonable time. In this thesis,asize of ten is chosen.

The initial population is defined randomly. In a very small population size,it has been demonstrated that it is preferable to choose each individual inde-pendently. The GA does not require a uniformly distributed population, neitheris it necessary to have known good solutions in the initial population to performwell [22]. Although the latter can lead to good solutions more quickly, there isalso the chance of premature convergence.

The search space is defined by the user. Although the thesis considers form-finding, in which the search space should be infinitely large, this impairs theefficiency of the method. Many iterations are then required before a good solu-tion is found. Therefore, user intervention can help the process evolve gradually,by decreasing the search space to an acceptable size.

3.3.3 Selection and reproduction operators

In the traditional GA, reproduction is mainly determined by cross over. Latervariants put emphasis on the mutation as well, following the strategy of evolu-

48

Page 67: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

3.3. GENETIC ALGORITHM

tionary strategies. The GA described in this section therefore uses mutation, inaddition to crossover.

3.3.3.1 Cross Over

Selection is be done based on the fitness of the individual. Three popular meth-ods are discussed. The original scheme is known as the roulette wheel. Theodds that an individual is chosen, is the ratio between its fitness and the sumof the fitness of all individuals. If the difference in fitness of the best individ-ual and other individuals is large, then the GA is likely to be taken over bythe good individual. Another popular method is tournament selection. Thebest individual of a random chosen small subset of the population is selected.When selecting based on ranking, the fitness of each individual is ranked. Thecrossover strength of each individual is the ratio between the rank and the pop-ulation size. Both ranking and tournament selection are less dominated by thefitness value of the best individuals, and are therefore preferred. Ranking ischosen and will be further elaborated on.

The crossover strength is defined as

pc,i =rankrpi∑sPopi=1 ranki

(3.4)

where rp denotes the relation of the crossover strengths, and sPop the popu-lation size. A linear and quadratic relation have been examined. The resultsare shown in Figure 3.8. The continuous lines have a linear relation and thedotted lines have a quadratic relation. The quadratic relation yields a smootherconvergence, and is therefore applied in the GA.

Cu

mu

lati

veim

pro

vem

ent

[%]

-500

-100

-300

-600

-800

Iterations [10e3]

-700

-400

-200

0162 124 6 8 10 14

rp= 1

rp= 2

rp= 1

rp= 2

0

Figure 3.8: The cumulative improvement of the population for linear and quadraticcrossover relations

Furthermore, the GA uses multi-parents for crossover, although this is onlyslightly better than when using two parents [21]. The number of parents isunknown in advance. A gene of the offspring is assigned a value by selecting aparent. Because this is done independently for each gene, it is possible that aparent is picked multiple times, and that more than two parents are involved.

49

Page 68: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 3. CHOOSING AN ALGORITHM FOR SHAPEOPTIMIZATION

3.3.3.2 Mutation

The best way to produce variations is by making mutations to the genes [21].In this section, three mutations are considered, i.e. the Gaussian mutation, andthe non-uniform and uniform mutation. Guassian and non-uniform mutationare somewhat equivalent in nature. Both lead to a small mutation of the gene.The non-uniform mutation rate is defined as

MNU,i =(1− t

T

)Bu, B < 0, u ∼ U(0, 1), (3.5)

where t is the current iteration number, T is the maximum number of iterations,and B is a tuning parameter. The non-uniform mutation rate decreases over theiterations. The mutation strength can be, for instance, 0.5. As the maximumnumber of iterations is unknown, it is difficult to use a non-uniform mutation.The gaussian mutation consists of adding a random value to each gene. Themutation value may depend on the time as in the non-uniform mutation, butcan also be kept constant, in this case 0.1m. Here, the mutation strength isalways 1. The value is defined as

MG,o = N(0, 0, 1). (3.6)

The uniform mutation chooses a random value for the gene, selected from thesearch space as

xi ∼ U(Xi,low, Xi,up), setXi = xi (3.7)

where xi is the current value of Xi, and X = [X1, ...Xn] is the vector of nparameters Xi. The search space of xi is bounded by Xi,low and Xi,up. Thisintroduces a greater variety in the population, and thus the search is conductedin a wider space, increasing the possibility to find the global optimum. However,this is inefficient for the convergence, hence the strength should decrease overthe number of iterations (see Figure 3.9). Several constant uniform mutationstrengths have been compared, in addition to an decreasing uniform mutationstrength. The decrease can be done based on the following.

• The difference with the global optimum (see Table 3.1)

• The number of improvement of the fitness range

• Cumulative improvement of the fitness range

Because it is not guaranteed that the global optimum is found, decreasing thestrength based on the first method might not yield a decrease at all. Thesecond method means that even a small, insignificant improvement leads to areduction, while the last method overcomes this drawback. However, if theinitial population is very bad, it is relatively easy to improve the fitness range,and the strength is decreased fast immediately. On the contrary, if the fitnessof the population range is good, the decrease goes slow. This should not be aproblem, as the existing genes of the individuals are good enough to be givento the offspring whenever they are selected for reproduction.The decrease is determined if the following criterion has been met:∑

t=1

F (x)avrg,pop,t − F (x)avrg,pop,t−1

F (x)avrg,pop,t−1∗ 100 > Z +

Z

2n. (3.8)

50

Page 69: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

3.3. GENETIC ALGORITHM

Iterations [-]

pm=10pm=20pm=30pm=40pm ∼ (60, 20)p

m[%

]

Figure 3.9: Course of the mutation strength during the iterations

The value Z is a randomly chosen value, and is done intuitively. Figure 3.10shows the results for Z=75 and Z=100. Although both criteria converge, Z=75yield a more gradual convergence, and hence is used in the further analyses.

Cu

mu

lati

veim

pro

vem

ent

[%]

-500

-100

-300

-600

-800

Iterations [10e3]

-700

-400

-200

0162 124 6 8 10 140

Z= 75Z= 100

Figure 3.10: The cumulative improvement of the population when the uniform mu-tation decreases for different criteria

Furthermore, the constant uniform mutation strengths varying from 20 to 60per cent have been analyzed as well. When the strength is too high, the GAdoes not converge. The strengths are measured in terms of difference with theglobal optimum for a structure subjected to a concentrated load at the crown.The most stable strength is 20 with an average difference of 35.5 per cent withthe global optimum. This strength is compared to when the strength decreasesfrom 60 to 20 per cent. In Figure 3.11 can be seen that both find the sameaccuracy after 15.000 iterations. Nonetheless, it is believed that a high uniformmutation strength is more able to help a GA to find the global optimum, thisstrength is used for further analyses.

51

Page 70: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 3. CHOOSING AN ALGORITHM FOR SHAPEOPTIMIZATION

Str

ain

ener

gy[k

J]

4

10

8

0

Iterations [10e3]

2

6

12

162 124 6 8 10 140

pm=20%pm=60-20%

Figure 3.11: The difference in course of the best fitness over the iterations for aconstant uniform mutation strength of 20% and a decrease in strength of 60 to 20%

3.3.4 Termination

The simplest stopping criterion is based on the number of iterations. However,sometimes the GA can stop earlier, for example, when the near-global optimumis found. It is useless to let the algorithm run further, because a GA has greatdifficulty to find the exact global optimum. Moreover, even if the stoppingcriterion is defined as fitness = global optimum, then no further iterations arenecessary, and the algorithm can be stopped. The near-optimum is defined as0.9*global optimum.

3.4 Hybrid algorithm

The hybrid algorithm combines the previous discussed algorithms. The sameoperators have been used. The underlying idea is to take advantage of the goodfeatures of the GA and HC.

The steps taken in the algorithm are the following.

1. Initialize the population

2. Evaluate the population

3. Select individuals for reproduction

4. Apply operators

(a) Evaluate the newborn offspring

For each variable:

(b) Perform a SA while the other variables are fixed

(c) Define the best mutation direction and value

Next

(d) Mutate all variables in their best direction and to their best value

(e) Evaluate the new solution

(f) Replace the solution if better than the previous solution

52

Page 71: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

3.5. RESULTS

(a) Described by 5 control points (b) Described by 9 control points

Figure 3.12: The models used in the analysis for HC

If the solution is better, repeat steps 4.a to 4.f.

5. Evaluate offspring

6. Replace worst parent by offspring of offspring is more fit

If the solution satisfies the criterion, the process is stopped. Else, repeat step2 to 6. Because the algorithm uses a sensitivity analysis in each iteration, it isexpected that the process is time-consuming. Hence, different termination cri-teria are used than in the original algorithms. For the internal HC optimization,the process stops when the improvement is less than 5 per cent, or when thesolution is worse. For the external optimization, the process is stopped whenan improvement smaller than 10 per cent has been found.

3.5 Results

The analyses that have been conducted can be distinguished in the imposedloads, and the number of control points that describes the model. The imposedloads are discussed in Section 3.1. The models are described using five and ninecontrol points. The model properties are the same as used in Section 3.1. Forthe HC, an initial solution must be defined, from where the algorithm performsthe search. These are shown in Figure 3.12. The design domain is undefined,because the HC starts the search from the initial model, and slowly moves awayto the optimum solution. No design domain is necessary, as the algorithm mustbe free to search anywhere.The same holds for the GA. However, GA has the property to generate a newgene for the offspring, independently of its parents by using the uniform mu-tation operator as given by (3.7). Moreover, the structure of the GA is set upsuch, that generating a new individual requires multiple parents. Thus wheninitializing the population, the uniform mutation operator must be invoked.For this operator, the design domain is important. A domain that is too small,does not contribute to finding the global optimum, because the individuals areclose to the original solution. On the other hand, if it is too large, the GA

53

Page 72: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 3. CHOOSING AN ALGORITHM FOR SHAPEOPTIMIZATION

has difficulty to find the global optimum. Besides, convergence is slow and notguaranteed, hence, the process is time-consuming. In order to avoid this, thedetermination of the design domain has been done based on the known globaloptimum, defined as

Xi,low = 0

Xi,up = 10

Zi,low = 0

Zi,up = 20 and 7,

for respectively a concentrated and uniformly distributed load.

Finally, the termination criteria must be defined. The HC is stopped, when thenew solution is worse than the previous solution. The obtained solution can thusbe 100 per cent accurate. For the GA, the optimization stops if 15.000 iterationshave been conducted, or if the near-optimum, i.e. a solution with less than 10 percent difference with the global optimum, has been found. The obtained solutionsis highly unlikely 100 per cent accurate, and is only by coincident much morethan 90 per cent accurate. The HA is terminated when the improvement of thenext iteration is less than 10 per cent.

3.5.1 Concentrated Load

Figure 3.13 shows the relation of the number of control points and the accuracyto describe the optimum shape. The quality of each analysis is compared tothe global optimum, and is defined as 1 minus the difference with the optimumsolution. The difference is measured by the strain energy levels of the analyses.Hence, a value equal to one implies the solution is 100 per cent accurate. Themore the quality deviates from one, the worse the quality is. The quality iscalculated as

Quality = 1− Es − Es,optEs,opt

. (3.9)

In overall, it can be seen that for five control points, the quality of the algo-rithms is much better than when nine control points must be handled. The lineof HC is constant, while the line of both the GA and HA show a decrease. Forfive control points, both the HC and HA perform well and the quality is more orless equal. The HC obtains a solution with a quality of 0.9, while the HA is ableto find a quality of 0.89. The quality of the GA is only 0.74. For nine controlpoints, the discrepancy in the solutions is larger. Again, the HC performs best,and finds a solution with a quality of even 0.93. The quality of the HA is 50per cent lower and is 0.43. The GA performs poor, and finds a quality of only-3.36.

54

Page 73: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

3.5. RESULTSQ

ual

ity

[-] -0.5

-1.5-1

-2

No. control points [-]

-2.5-3

00.5

1

10987654Steepest descenthill climbingGenetic algorithmHybrid algorithm

-3.5-4

Figure 3.13: The quality of the algorithms when optimizing a structure describedby 5 and 9 control points subjected to load case 1, a concentrated load at midspan

If the cost is taken into account as well, the following observations can be madefrom Figure 3.14. The cost is measured in the number of calculations conductedfor one optimization process. The number of calculations are compared to thelowest number of calculations. It follows that the costs is defined as 1 minus thedifference of the number of calculations with the lowest number of calculations.Thus a cost of 1 represents the fastest optimization process. The cost is definedas

Cost = 1− nCalc− nCalcminnCalcmin

(3.10)

where nCalc is the number of calculations conducted for one optimization pro-cess. In general, the performance of the HC and GA is constant for five and ninecontrol points, while a decrease in performance is noticed for the HA. It can beseen that the cost of HC is low, and is 1 for five control points, and 0.44 for ninecontrol points. For GA, the costs are -3.9 for both five and nine control points.This implies that the maximum number of iterations was needed. Obviously,the GA has difficulty to find the near-optimum solution. The cost of the HAare the worst. This can be accounted to the bad features of the algorithms thatcompose the HA. Indeed, the GA requires many iterations, as seen before. Inaddition, in each iteration a HC optimizes the newborn offspring. Therefore, ineach iteration a sensitivity analysis is conducted, which is the slowest part ofthe HC. Hence, the resulting number of analyses conducted in the HA, is farabove the number of analyses when only using one optimization algorithm. Thecosts are -12.87 and -70.64 for respectively five and nine control points.

55

Page 74: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 3. CHOOSING AN ALGORITHM FOR SHAPEOPTIMIZATION

Cos

t[-

]

-31

-51

-41

No. control points [-]

-61

-71

-21

-11

-11

10987654

Steepest descenthill climbingGenetic algorithmHybrid algorithm

Figure 3.14: The cost of the algorithms when optimizing a structure described by 5and 9 control points subjected to load case 1, a concentrated load at midspan

3.5.2 Projected Uniformly Distributed Load

Figure 3.15 shows the relation between the number of control points and the ac-curacy to describe the optimum shape, when subjected to a projected uniformlydistributed load. In overall, the algorithms find better results when handlingfive control points than nine control points. It can be seen that for five controlpoints, the discrepancy in quality of the algorithms is small. The HC performsthe worst, and has a quality of 0.79. For nine control points, the quality of HCremains constant and is 0.72, while the quality of the GA decrease from 0.89 to0.16. The difference in quality of the HA between five and nine control pointsis even larger. The quality decreases from 0.84 to -0.23.

Qu

alit

y[-

]

0

-0.5

No. control points [-]

-1

0.5

1

10987654

Steepest descenthill climbingGenetic algorithmHybrid algorithm

Figure 3.15: The quality of the algorithms when optimizing a structure describedby 5 and 9 control points subjected to load case 1, a concentrated load at midspan

When taken into account the cost, the HC performs best, as illustrated in Fig-ure 3.16. The quality for five control points is 0.87 and 1 for nine control points.The cost of the GA remains constant at 0.63. This is equal to 15.000 analyses,hence, the near-optimum was not found. The cost of the HA increases from -1.26 to 0.86. For nine control points, the difference in quality is small compared

56

Page 75: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

3.5. RESULTS

to the HC, and is even similar to the quality of oh the HC for five control points.

Cos

t[-

]

-0.5

-1

No. control points [-]

-1.5

-2

0

0.5

1

10987654Steepest descenthill climbingGenetic algorithmHybrid algorithm

Figure 3.16: The cost of the algorithms when optimizing a structure described by 5and 9 control points subjected to load case 1, a concentrated load at midspan

3.5.3 Self Weight

When subjected to self weight, there is no clear consensus in favorable numberof control points. Figure 3.17 shows the relation between the number of controlpoints and the accuracy. Both the HC and GA show a decrease in quality whenhandling more control points, from 0.54 to 0.02 and from 0.82 to -0.09 respec-tively, while the quality of the HA improves from 0.47 to 0.70. In contrary toprevious results, for five control points the GA is much more accurate than theother algorithms. For more control points, the difference is small compared toHC. The HA is slightly less accurate than the other algorithms for five controlpoints, but performs significantly better for nine control points.

Qu

alit

y[-

]

0

No. control points [-]

-0.5

-1

0.5

1

10987654

Steepest descenthill climbingGenetic algorithmHybrid algorithm

Figure 3.17: The quality of the algorithms when optimizing a structure describedby 5 and 9 control points subjected to load case 1, a concentrated load at midspan

When taking into account the cost, it can be seen that the HA requires theleast number of analyses for nine control points, while the largest number isobtained by the same algorithm for five control points. Again, the GA reached

57

Page 76: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 3. CHOOSING AN ALGORITHM FOR SHAPEOPTIMIZATION

the maximum number of iterations. The cost of the HC increases for morecontrol points. For five control points, it is only 4 per cent slower than the HA.For nine control points, the HC is 30 per cent faster than the GA, and even uptp 300 per cent faster than the HA.

Cost

[-]

-2

-3

No. control points [-]

-4

-5

-1

0

1

10987654

Steepest descenthill climbingGenetic algorithmHybrid algorithm

Figure 3.18: The cost of the algorithms when optimizing a structure described by 5and 9 control points subjected to load case 1, a concentrated load at midspan

3.6 Conclusions

In general, the obtained accuracy of the algorithms is higher when dealing withfive control points, than when nine control points are involved. For five con-trol points, the difference between the algorithms is small, if not more or lessequal. The discrepancy grows for a larger number of control points, where theHC performs best for a concentrated load and the quality is higher than 0.9.For a projected uniformly distributed load, the quality of the GA is highestfor five control points (0.89), but decreases significantly to 0.16 for nine controlpoints. The HC, on the other hand, performs slightly worse for five controlpoints (0.79), but its performance shows only a slight decrease for nine controlpoints (0.72). Regarding the self weight, the GA performs significantly bet-ter for a small number of control points (0.80), while the HA performs bestif nine control points are involved (0.68). For the latter, many analyses wererequired to obtain this quality. Moreover, a quality of 0.68 is not extremely high.

For the HC, the number of conducted analyses decreases slightly for a highernumber of control points. This proves that the method is very effective. TheGA requires the maximum number of iterations, due to its inability to find thenear-optimum solution. Despite this, it was able to find the highest quality foruniformly distributed loads. However, it should be pointed out that the searchdomain in Z was only 7m, while it was 20m for the concentrated load. For theself weight, the GA found a significantly better solution than other algorithms,but it was extremely slow. Furthermore, the results are also dependent on thevalues used for the crossover and mutation strength. Even if more appropriatevalues for the crossover and mutation strength would be used, it is expectedthat the algorithm still requires many iteration before a good solution mightbe found, due to its trial-and-error nature. For this reason, it is inefficient touse the GA. Regarding the shape optimization problem, the search space is

58

Page 77: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

3.6. CONCLUSIONS

extremely large, and many solutions are available. A slightly different struc-tural shape can lead to a huge difference in performance. If a relatively goodsolution is found, the algorithm does not know how to modify the solution inorder to obtain a better performance, and randomly tries different mutations,with a large chance that only worse solutions are found. The HC, on the otherhand, is effective due to the sensitivity analysis. The drawback is the decreaseof speed when more variables are involved. However, this is a common problemfor optimization algorithms. Moreover, the obtained quality is not outstandingfor uniformly distributed loads, especially for the self weight. Although the HAuses a time-consuming sensitivity analysis and GA, the good feature of the sen-sitivity analysis is more apparent, and makes the HA more effective than a GA.When measuring only the speed, the HA performs worst.

Nonetheless, the final conclusion is that the HC is in general most accurateand effective, especially concerning the use of a larger number of variables. Thisalgorithm is most promising to solve shape optimization with the best ratio ofrequired time and obtained accuracy and therefore will be further improved tosolve shape optimization problems with single and multiple loading cases.

59

Page 78: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer
Page 79: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

Chapter 4

Increase of Accuracy andSpeed of the Algorithm

In Chapter 3, three algorithms to solve shape optimization have been discussed.In this chapter, several proposals are given to further improve the steepest de-scent hill climbing algorithm. The proposed improvements are related to thesensitivity analysis and the variables. First, the optimum number of controlpoints is defined in Section 4.1. Sections 4.2 and 4.3 illuminates how the vari-ables are controlled. Further, refinements of the algorithm are discussed inSection 4.4. Section 4.5 gives the results obtained with the improved algorithm.

4.1 Optimum Number of Control Points

In Chapter 3, it was shown that the performance of the HC is lower for a highernumber of variables. Moreover, it was also stated that the algorithm is slow,because it performs an expensive sensitivity analysis for each of the variables. Itfollows that a minimum number of variables contributes to a faster optimizationprocess and a higher quality.Figure 4.1a shows the relation between the number of control points and thequality of the described geometry. The quality is calculated using (3.9). Whenoptimizing a structure subjected to either a central load (continuous line), or auniformly distributed load (dashed line), and the polygon sides are disallowed tointersect, a minimum of five control points is necessary. Figure 4.2 shows that adiscontinuity cannot be described using less than five control points, and hence,the near-optimum structure cannot be obtained. Using more control pointsshould allow the description of such structures. However, for a concentratedload, the optimum structure must be a perfect triangle, which is a relativelysimple geometry. Small distortions of this geometry result in a large decreasein structural behavior. Thus when more control points are used, they must allbe placed on the same straight line. Therefore, it is much easier to describe atriangle with as few control points as possible. Figure 4.2a can be seen thatwhen more than six control points are involved, a triangle with a sharp edgecan be found, but the structures are a local optimum. The blue dotted linedenotes the global optimum structure. The continuous lines are near-optimumsolutions, while the dashed lines represent the solutions that differ more than 10

61

Page 80: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 4. INCREASE OF ACCURACY AND SPEED OF THEALGORITHM

-20

-15

-10

-5

00 1 2 3 4 5 6 7 8 9 10

Quality

[-]

Number of control points [-]

Quality concentrated load

Quality projected uniformlydistributed load

Quality uniformly distributedload

(a) Relation between the number of control pointsand the obtained quality

-200

-180

-160

-140

-120

-100

-80

-60

-40

-20

00 1 2 3 4 5 6 7 8 9 10

Cost

[-]

Number of control points [-]

Cost concentrated load

Cost projected uniformlydistributed loadCost uniformly distributedload

(b) Relation between the number of control pointsand the conducted number of calculations

Figure 4.1: Five control points is the minimum number required to achieve a geome-try with an acceptable quality and the least amount of computational time. A qualityor cost equal to one is optimal.

per cent with the global optimum. The same holds for structures subjected to aprojected uniformly distributed load. The optimum structure apparently cannotbe described with less than five control points. In contrary to the description ofa triangle, the near optimum structure can be found relatively easy when usingmore control points than strictly necessary, (See Figure 4.2b). Moreover, theoptimum form is a parabola with its vertex at midspan, and the control pointsare mirrored about the vertical symmetry axis at midspan. If an odd number ofcontrol points is used, a control point is positioned right at midspan, and henceit is easier to obtain the desired curvature, as can be seen in Figure 4.1b. For auniformly distributed load, the optimums structure can best be described using5 till 8 control points. Concluding, the use of five control points allows boththe description of the optimum structures subjected to a concentrated load ora uniformly distributed load, while the least computational time is required.

4.2 Position of Control Points

Figure 4.2a shows that a discontinuity must be described in order to obtain anear-optimum structure. It has been seen that at least five control points arerequired, where three control points are used to describe the kink. This can bedone by placing these control points on the same position, as seen in Figure 4.3a.The discontinuity can easily be modified to a continuous curve by moving thecontrol points a bit further away from this position (see Figure 4.3b).

62

Page 81: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

4.2. POSITION OF CONTROL POINTS

0

3

6

9

12

15

0 3 6 9 12 15

Heig

ht

[m]

Span [m]

Global optimum

3 control points

4 control points

5 control points

6 control points

7 control points

8 control points

9 control points

(a) Subjected to a concentrated load

0

3

6

9

12

15

0 3 6 9 12 15

Heig

ht

[m]

Span [m]

Global optimum

3 control points

4 control points

5 control points

6 control points

7 control points

8 control points

9 control points

(b) Subjected to a projected uniformly dis-tributed load

0

3

6

9

12

15

0 3 6 9 12 15

Heig

ht

[m]

Span [m]

Global optimum

3 control points

4 control points

5 control points

6 control points

7 control points

8 control points

9 control points

(c) Subjected to a projected uniformly dis-tributed load

Figure 4.2: The optimum structure is best described when using five control points.The continuous lines denote the near-optimum solutions. These solutions are foundwithin the set amount of iterations. The dashed lines are the solutions that are foundafter the the maximum number of iterations, and thus show large discrepancy withthe optimum solution. The dotted line is the global optimum.

Heig

ht

[m]

-2

Span [m]

-4

-6

4

2

10 150 5-5

6

P0

P1

P2P3 P4

P5

P6

(a) Discontinuous curve

Heig

ht

[m]

-2

Span [m]

-4

-6

4

2

10 150 5-5

6

P0

P1

P2P3

P4

P5

P6

(b) Continuous curve

Figure 4.3: Relation continuity when described by three control points

63

Page 82: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 4. INCREASE OF ACCURACY AND SPEED OF THEALGORITHM

To maintain a vertex, it is required that the points are positioned near eachother. The two outer points can be made dependent of the middle controlpoints, and are called phantom points. This reduces the number of variables toone, instead of three. The positions of the control points are given in Table 4.1,where the bold numbers denote the coordinates of the kink.

Table 4.1: Relation continuity and discontinuity when using n = 5 control points

PC1 PC2

i x z x z0 -5 -5 -4 -51 0 0 0 02 5 5 4 53 5 5 5 54 5 5 6 55 10 0 10 06 15 -5 14 -5

In addition, B-splines can describe discontinuities by using two individuallycurves, where the end positions are coincidental. Let H(t) =

∑4i=0Ni(t)Pi be

the first curve, and G(t) =∑4i=0Ni(t)Qi the second curve. The control points

are given in Table 4.2. The bold numbers define the position of the discontinuity.Both curves only require one mutual control point, i.e. P3 = Q1. The advantageis the precise control over the position of the discontinuity.

Heig

ht

[m]

-2

Span [m]

-4

-6

4

2

10 150 5-5

6

P0

P1

P2

P3Q3

Q3

Q4

Q0Q1

P4

(a) Discontinuous curve

Heig

ht

[m]

-2

Span [m]

-4

-6

4

2

10 150 5-5

6

P0

P1

P2P3

P4

Q3

Q4

Q0Q1

Q2

(b) Continuous curve

Figure 4.4: Relation continuity when described by two curves

64

Page 83: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

4.2. POSITION OF CONTROL POINTS

Heig

ht

[m]

-2

Span [m]

-4

-6

4

2

10 150 5-5

6

P0

P1

P2

P3

P4

P5

P6

C=

0

C=

1

C=

0

C=

1

Figure 4.5: Relation continuity when described by one curve

Table 4.2: C1: the control points of curve H and G

P Qi x z i x z0 -4 -41 0 02 4 4 0 4 63 5 5 1 5 54 6 6 2 6 4

3 10 04 14 -4

When it is desirable to describe continuity, two other conditions are required,i.e. P4 = Q2, and the coincident control points must lie on the same line. IfP2 is made dependent of P3, the number of variables reduces to one, instead oftwo.

Table 4.3: C2: the control points of curve H and G

P Qi x z i x z0 -4 -41 0 02 4 5 0 4 53 5 5 1 5 54 6 5 2 6 5

3 10 04 14 -4

The disadvantage is that in order to describe discontinuities, the curve must besubdivided, while the same result can be obtained using three control points withno subdivision of the curve. Hence, it is preferred to use three control points.To improve the control over the discontinuity, the positions of the control pointsP2 and P4 are made dependent of its neighboring control points, provided these

65

Page 84: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 4. INCREASE OF ACCURACY AND SPEED OF THEALGORITHM

are no phantom points. Let the middle control point of these three be Pi, thenthe relation with the phantom points is defined as

Pi−1 = Pi + (1− C) ∗ 12 (Pi−2 − Pi) (4.1a)

Pi+1 = Pi + (1− C) ∗ 12 (Pi+2 − Pi), (4.1b)

where C ∼ (0, 1). C = 1 and C = 0 represent the discontinuity and the maxi-mum allowable continuity respectively. This is illustrated in Figure 4.5.

Table 4.4 gives the results for a structure described by 5 and 18 control points,and for a structure subjected to multiple concentrated loads, respectively re-ferred to as Example 1, 2 and 3. It can be seen that adding more controlledvariables only slows down the optimization process, while the quality decreasein one case, and increase in the other. A slow process is especially apparentwhen 18 control points are involved.

Table 4.4: Results adding control points under 1 concentrated load compared toresults obtained with original HC

Improvement [%] Example 1 Example 2Quality -7 6Cost -33 -37

When four concentrated loads are imposed on the structure, and the requiredcontrol points are positioned underneath, the algorithm is still not capable offinding a solution close to the optimum. Figure 4.7a shows that the extra con-trol points have moved away from the load, and are piled up around the samelocation. Hence, the advantage of predefining the positions of the control pointsunder concentrated loads have been undone.

This drawback can be overcome by disallowing the kink to move away fromthe load. The load is fixed in x-direction, thus, so are the associated controlpoints. By doing so, the search space is reduced, and much better results areobtained, as illustrated in Figure 4.7b. Again, the algorithm has difficulty totreat many control points when one concentrated load is imposed on the struc-ture. Table 4.5 show the results for structures subjected to one load comparedto the original HC. Table 4.6 shows the difference between a structure subjectedto four loads with the results obtained with an algorithm that did not fix theinserted control points in x-direction.

Table 4.5: Results adding control points fixed in x-direction under 1 concentratedload compared to results obtained with original HC

Improvement [%] Example 1 Example 2Quality 8 -12Cost -30 -74

66

Page 85: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

4.3. REQUIRED NUMBER OF CONTROL POINTSH

eig

ht

[m]

4

Span [m]

2

0

10

8

10 140 5

12

6

14

Global optimum

Orignal HC

Adding controlpointsAdding controlpoints fixedin x-direction

Original model

(a) Example 1: 5 control pointsH

eig

ht

[m]

4

Span [m]

2

0

10

8

10 140 5

12

6

14

Global optimum

Orignal HC

Adding controlpointsAdding controlpoints fixedin x-direction

Original model

(b) Example 2: 18 control points

Figure 4.6: Difference when adding control points under a concentrated load

Table 4.6: Improvement results adding control points for a structure subjected to 4concentrated loads compared to a fixed position and no fixed position in x-direction

Improvement [%] Example 3Quality 49Cost 69

Heig

ht

[m]

4

Span [m]

2

0

10

8

1080 2

6

64

(a) Added control points are free to move inx- and z-direction

Heig

ht

[m]

4

Span [m]

2

0

10

8

1080 2

6

64

(b) Added control points are fixed in x-direction

Figure 4.7: Example 3: Difference when disallowing added control points to moveaway from the load

4.3 Required Number of Control Points

As seen in the previous section, the process is slowed down if more control pointsare used than strictly necessary. This holds especially for structures subjectedto concentrated loads, where an edge must be described. The control points allmove to that location, but are not capable of finding the exact correct positions(see Figures 4.6b and 4.7b.) Therefore, the following concept is introduced to

67

Page 86: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 4. INCREASE OF ACCURACY AND SPEED OF THEALGORITHM

reduce the number of variables, based on imposed loads on the structure. Thenumbers must be chosen such, that the desired geometry can be described.Further, because form-finding is considered, it is valid to neglect the controlpoints that describe the original geometry. First, one variable is positioned atboth ends of the structure. It is known already that for structures subjectedto concentrated loads, three variables are required for each load. Supportscan be modeled as concentrated loads, and hence, require three variables aswell, provided they are not positioned at the end of the structure. Structuressubjected to a uniformly distributed load require 3 variables. Although it isunknown what the optimum solution should be if both a concentrated load and auniformly distributed load are imposed on the structure, Figure 4.1 showed thatthree variables are required to describe the optimum structure when subjectedto merely a uniformly distributed load. Moreover, structures that have morethan two supports and subjected to self weight, consist of multiple adjacentcatenaries, which require three variables to be described. Therefore, this numberis adopted as the number required to describe the segments on which uniformlydistributed loads are imposed. The total number depends on the number ofsegments, i.e. the sum of the number of concentrated loads and supports minusone. The total number of variables required for the distributed load is thenumber of segments multiplied by three. An overview of the required numberof control points is given in Table 4.7. An example is given in Figure 4.8.

segment1

segment2

segment3

(a) Original structural model

P1

P2

P3

P4

P5P6P7

P8 P9P10

P11P12P13

P14

P15

P15

P16

segment1

segment2

segment3

(b) Structural model with the required num-ber of control points

Figure 4.8: Number of required control points is determined based on the structuralmodel. The grey points are the phantom points, the blue points are the fixed points,and the black points are the variables.

Table 4.7: Number of required control points based on the structural model

Situation no. variablesEnds structure 2Concentrated load 3Intermediated support 3Uniformly distributed load no. segments * 3

no. segments = no. concentrated load + no. supports - 1

68

Page 87: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

4.4. REFINEMENT OF THE ALGORITHM

4.4 Refinement of the Algorithm

4.4.1 Sensitivity Analysis

The most time-consuming part of the HC is due to the sensitivity analysis.As discussed in Section 3.2.1, this is done for each variable. Any additionalvariable thus introduces 8(directions)∗7(distances) calculations per iteration,and 2(directions)∗7(distances) if the variable is only free in the z-direction. Ifthis number can be reduced, the algorithm should perform faster. Therefore,it is proposed to conduct a more efficient search by determining first in whichdirection the mutation should be performed. After the direction is known, thedistance where over the control point should be moved is defined. Any extravariable now only introduces 8(directions)+6(distances) additional calculationsper iteration, and 2(directions)+6(distances) if the variable is only free to movein the z-direction. This is illustrated in Figure 4.9.

(a) Original sensitivity analysis (b) More efficient sensitivity analysis

Figure 4.9: The original sensitivity analysis searches for the best mutation in ev-ery direction and for every distance, while the new proposed analysis finds the bestdirection first, whereafter it searches for the best mutation distance.

The results are given in Table 4.8, and it can be stated that the number ofcalculation is reduced drastically. Furthermore, the quality is reduced slightlyfor only example 1, while for example 2, the quality is improved substantially.The solutions are illustrated in Figure 4.10.

Table 4.8: Results when performing an efficient sensitivity analysis compared toresults of the original sensitivity analysis

Improvement [%] Example 1 Example 2 Example 3Quality -3 100 5Cost 89 65 50

69

Page 88: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 4. INCREASE OF ACCURACY AND SPEED OF THEALGORITHM

Heig

ht

[m]

4

Span [m]

2

0

10

8

10 140 5

12

6

14

Global optimum

Improvedsensitivity analysis

Original model

(a) Example 1: 5 control points

Heig

ht

[m]

4

Span [m]

2

0

10

8

10 140 5

12

6

14

Global optimum

Improvedsensitivity analysis

Original model

(b) Example 2: 18 control points

Heig

ht

[m]

4

Span [m]

2

0

10

8

1080 2

6

64

(c) Example 3: 4 concentrated loads

Figure 4.10: The solutions of Example 1, 2 and 3 when optimizing using a moreefficient sensitivity analysis

4.4.2 Scaling

When the proposed improvements are applied, the optimization process is insome cases still prone to be trapped in a local optimum. In Section 4.4.2 can beseen that the original structural geometry is simplified based on the set of act-ing loads. Four horizontal concentrated loads with fixed positions in x-directionare imposed on the structure. The expected optimal structure is a flat beam.The optimized structure is denoted by the dashed-dotted line. It can be seenthat the solution is far from the global optimum. This problem can be easilyovercome by scaling the geometry. One way to achieve this is by multiplyingthe control variables, however, only in the height. Any imposed discontinuitiesmust be positioned under the associated loads, moreover, the scaling is a merelya refinement tool to help the algorithm escape from the local optimum. Hence,if the geometry can be slightly modified in the right direction, the algorithmmight be closer to the path to the global optimum. Consequently, the scalefactor β is chosen small and is only 0.05. The solution after scaling is given bythe dotted line.

70

Page 89: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

4.4. REFINEMENT OF THE ALGORITHM

After optimizing with HC

After scaling

Simplified model

Original model

Figure 4.11: Scaling can easily contribute to finding the global optimum

START

Hill climbing

Scale

Criterion met?

Yes

Criterium met?

Yes

No

No

No

Yes

STOP

Criterion met?

(a) M1: Optimization with HCand scaling consecutively

START

Hill climbing

Scale

Criterion met?

Yes

STOP

No

(b) M2: Optimization with HCand scaling simultaneously

Figure 4.12: The flowcharts of the HC algorithm refined with a scaling optimization

First, a sensitivity analysis is conducted to define the right direction of thescaling. This new z-coordinates is calculated as

Zi = (1± β)Zi−1. (4.2)

The drawback of this refinement is the decrease of speed. After optimizing withthe HC, additional iterations are required to scale the solution. Therefore, it isproposed to implement the scaling in the HC algorithm. Instead of optimizingthe solution with the HC until no further improvement is found, followed by

71

Page 90: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 4. INCREASE OF ACCURACY AND SPEED OF THEALGORITHM

scaling until no further improvement is found (M1), the algorithm optimizes inone iteration using HC, followed by scaling (M2). This process continuous untilboth the HC and scaling yield no further improvement. The flowchart of bothmethods is given in Figure 4.12.The results of both methods is given in Table 4.9. In the left column theobtained solutions are illustrated. The black line is the solution found withthe original HC, and the orange and blue dotted line are the solutions foundwith method 1 and 2, respectively. The second column gives the number ofcalculations that were conducted by the original HC, and the following twocolumns give the improvement in the conducted number of calculations. Thefifth column gives the fitness of the solution found with the original HC, and thefollowing two columns give the improvement in the fitness. Four load cases areconsidered, i.e. nine concentrated horizontal loads, nine concentrated verticalloads, nine concentrated horizontal and vertical loads, where the horizontalload = vertical load and nine concentrated horizontal and vertical loads, wherethe horizontal load = 10∗ vertical load. M1 is much more efficient when onlyhorizontal loads are imposed, and slightly faster than M2 if only vertical loadsare imposed. For both load cases, additional iterations are required when scalingis implemented with a maximum increase of 120 per cent for M2 when subjectedto horizontal loads. For the two other load cases, M2 is much more efficient thanM1, moreover, the number of iterations is reduced with 62 per cent. Regardingthe fitness of the solutions, this is improved for both M1 and M2 when imposingonly horizontal or vertical loads. For the other load cases, using M1 does notachieve any gain, while using M2 a decrease is found in one case, and an increasein the other case. Concluding, M2 is adopted, because in overall, the gain inspeed is higher than the lost in accuracy.

In essence, scaling is very straightforward. When scaling a geometry, the topol-ogy always remains constant. However, in this section, scaling is applied tothe control points of the geometry. If the geometry itself would be scaled, theassociated control points can be found based on the knots of the B-spline [26].This process is insufficient accurate, and hence the geometry that is describedby the newly derived control points, show discrepancy with the original scaledgeometry. In other words, the new geometry is no scaled version of the orig-inal. On the other hand, if the control points are no longer necessary in theoptimization process, scaling of the geometry itself is justified. Nonetheless, thecontrol points are the variables used in the optimization, hence, they cannot beomitted. The drawback of scaling the control points is the change in relationof the sides of the polygon. Where no topology mutation occurs when scalingthe polygon, this is not guaranteed for the associated B-spline. If amongst aset of control points, some control points describe an intersecting polygon, andthese control points are positioned near other, scaling the polygon can resultin a loop in the B-spline. Even though if this loop would be infinitely small,and hence not even noticeable in real-world problems , the algorithm does notmake a distinction in the error size of a loop, and disregards such solutions. Anexample is shown in Figure 4.13.

72

Page 91: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

4.4. REFINEMENT OF THE ALGORITHM

Table 4.9: Comparison of two implementations of scaling into the HC. The blackline in the first column denote the solution found with the original HC. The orangeline represent M1, and the blue line M2.

Structural model nCalc Impr F Impr[-] [%] [kJ] [%]HC M1 M2 HC M1 M2

1244 -16 -120 5.6 49 49

803 -20 -23 11.8 23 23

803 0 62 24.1 0 -12

1971 0 62 7.9 0 9

Scale polygon

no loop loop

Figure 4.13: Scaling of the polygon can result in a loop in the curve

This situation can be avoided if the polygon is prohibited to intersect. Never-theless, this introduces other difficulties. Each control point should be assigneda certain priority. The control point with the highest priority is allowed to movefree, and the control points with a lower priority should follow. Firstly, it is dif-ficult to determine which control points should have the highest priority. Evenif the set of control points can be divided into subgroups with each assigned apriority, the control points within the same subgroup have an equal importancy,and thus still can intersect. Also, assigning a predefined priority influences thesearch process, while it should only be influenced by the structural behavior.

73

Page 92: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 4. INCREASE OF ACCURACY AND SPEED OF THEALGORITHM

4.5 Results

4.5.1 Single Concentrated Loads

If these refinements are applied to the algorithm, the following results are ob-tained. These are compared to the optimum solutions found with the originalHC, described by five control points. For both a concentrated load and a uni-formly distributed load can be seen that the speed of the algorithm has sig-nificantly improved: 98 and 83 per cent respectively. Furthermore, the globaloptimum can be found for structures subjected to a concentrated load, whilethe difference to the optimum has decreased from 46 to only 14 per cent forstructures subjected to a uniformly distributed load.

Table 4.10: Results of the improved algorithm

Original HC Improved HCconcentrated loadno. calculations 2520 98%Difference with optimum 16% 0%Uniformly distributed loadno. calculations 7728 83%Difference with optimum 46% 14%

However, as seen in Figure 4.2c, a structure that deviates less than 10 per centfrom the global optimum can be described using five control points. This impliesthat difference of 14 per cent is due to the quality of the algorithm, rather thanthe inability to describe the optimum with the set amount of control points. Thisshortcoming could be attributed to the to the fact that the algorithm alwaysadopt multiple mutations in one iteration, as described in Section 3.2.2. Hence,the algorithm is not capable of fine-tuning solution, if these each mutationindependently improves the solution.

0

2

4

6

8

10

0 2 4 6 8 10

Heig

ht

[m]

Span [m]

Global optimum

Original HC

Improved HC

(a) Concentrated load

0

2

4

6

8

10

0 2 4 6 8 10

Heig

ht

[m]

Span [m]

Global optimum

Original HC

Improved HC

(b) Uniformly distributed load

Figure 4.14: The optimum solutions for a concentrated load and a uniformly dis-tributed load

74

Page 93: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

4.5. RESULTS

4.5.2 Multiple Concentrated Loads

In this example, nine structures are analyzed, each subjected to a differentnumber of vertical concentrated loads. Each structure spans 30m, and eachload is 100kN . Any additional concentrated load introduces one extra variable.The relation between the time it takes to find the optimum and the number ofloads is given in Figure 4.15. It can be seen that the growth of the requiredtime slowly increases. The optimum solutions are given in Figure 4.16.

0

5

10

15

20

25

30

35

0 5 10 15 20

Tim

e[m

in]

Number point loads [-]

0 5 10 15 20

Number variables [-]

Figure 4.15: The minutes that are required to optimize a structure subjected todifferent number of vertical concentrated loads

Heig

ht

[m]

10

Span [m]0

20

300

30

(a) 1 load

Heig

ht

[m]

10

Span [m]0

20

300

30

(b) 2 loads

Heig

ht

[m]

10

Span [m]0

20

300

30

(c) 4 loads

Heig

ht

[m]

10

Span [m]0

20

300

30

(d) 9 loads

Heig

ht

[m]

10

Span [m]0

20

300

30

(e) 19 loads

Figure 4.16: The optimum solutions when subjected to concentrated loads of 100kN

4.5.3 Uniformly Distributed Loads and Multiple Concen-trated Loads

This section shows the required time to optimize for multiple loads. As de-scribed in Section 4.3 the number of variables depends on the number of con-centrated loads. If uniformly distributed loads are involved, any additionalconcentrated load introduces three extra variables. These variables are free tomove both in plane and height, thus the number of calculations increases with

75

Page 94: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 4. INCREASE OF ACCURACY AND SPEED OF THEALGORITHM

(no.Variables(no.Directions+no.Positions)=)42. Moreover, the variable due tothe extra concentrated load require an additional (no.Directions+no.Positions=)8calculations, resulting in a total of 50 extra calculations per iteration. Thestructure has a span of 30m and is subjected to a uniformly distributed load of-1kN/m. The total value of concentrated loads is 20kN . The necessary time tofind the optimum solutions is given in Figure 4.17. It can be seen that for nineconcentrated loads, the number of variables is 39. Such a number requires overtwo hours of analyzing. On the other hand, the optimum structures as shownin Figure 4.18 are subjected to the same amount of load, and the height of thestructure is more or less equal. Although no global optimum is available tocompare the obtained results, it can be concluded that the algorithm is capableof finding a optimum with a relatively high accuracy.

0

50

100

150

200

250

0 2 4 6 8 10

Tim

e[m

in]

Number point loads [-]

7 19 39

Number variables [-]

Figure 4.17: The minutes that are required to optimize a structure subjected to auniformly distributed load and different number of vertical concentrated loads

0

2

4

6

8

10

0 30

Heig

ht

[m]

Span [m]

(a) Uniformly distributed load and 1 concen-trated load

0

2

4

6

8

10

0 30

Heig

ht

[m]

Span [m]

(b) Uniformly distributed load and 4 concen-trated loads

0

2

4

6

8

10

0 30

Heig

ht

[m]

Span [m]

(c) Uniformly distributed load and 9 concen-trated loads

Figure 4.18: The optimum solutions when subjected to both a uniformly distributedload of -1kN/m and concentrated loads with a total value of 20kN

76

Page 95: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

4.6. CONCLUSIONS

4.6 Conclusions

In this chapter several methods are proposed to improve the HC on speed andaccuracy. This is done with regard to the variables and the nature of the al-gorithm. To describe the optimum structure subjected to concentrated loads,the kinks required underneath the loads can be described by placing three con-trol points relative to each other, hereby reducing the number of variables fromthree to one. By positioning the control points underneath concentrated loadsand fixing its positions, it is avoided that the kinks move away from the con-centrated loads. This greatly benefits the speed of the algorithm. Further, thealgorithm is refined by increasing the efficiency of the sensitivity analysis. Bydetermining the optimum direction first, followed by the optimum distance tomove the control points over, the speed of the algorithm greatly improves, whilethe quality only decrease for simple cases. Furthermore, scaling of the controlpoints in height is implemented to help the algorithm to find the global opti-mum. Although the adopted method requires significantly more calculations forstructures that are only subjected to horizontal loads, the gain in speed is inoverall higher than the lost in accuracy. The drawback of scaling the controlpoints is that it can result in loops in the structure, which could terminate theoptimization process. This could have been overcome by scaling the curve it-self, however, the associated control points would be lost. Another option is todisallow the control polygon to intersect, by assigning a priority to each controlpoint. The difficulty is the rank of priority.

If these improvements are applied, it can be noticed that the speed of the algo-rithm is greatly increased. Furthermore, the algorithm is capable of finding theglobal optimum for concentrated loads, and the difference with the global opti-mum for structures subjected to uniformly distributed loads decreased to only14 per cent. When multiple concentrated loads are imposed, the speed decreasesslightly along with the increase of number of variables, while an accurate resultcan be obtained. The number of control points, and number of variables, to de-scribe optimum structures subjected to uniformly distributed loads are definedbased on the number of imposed concentrated loads. Due to the larger numberof variables with a higher degree of freedom, it takes more time to handle anequivalent number of concentrated loads. This problem can be overcome bymodeling the multiple concentrated loads as uniformly distributed loads. Onthe other hand, the methods is capable of finding accurate results.

77

Page 96: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer
Page 97: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

Chapter 5

Application to MultipleLoading Cases

This chapter describes the extension of the algorithm to multiple loading cases.A methodology is proposed in Section 5.2, leading to only a slight modificationin the objective function. Sections 5.3 and 5.4 discuss the results when solvingmultiple loading case problems.

5.1 Introduction

In real world situations, structural designs are required to perform in more thanone situation. Multiple loading cases are in this sense the load combinationsthat each act independently on the structure, leading to an own structuralresponse. It is difficult to determine which loading case is most critical, andshould be designed for. On the other hand, the structural design should becapable of sustaining all the possible loading cases. Moreover, it is desired thatthe structure is optimum for each loading combination. However, because theoptimum solution for one loading case might not be the optimum structure forthe other case, and vice versa, the result is often a compromise of both optima.

5.2 Methodology

Generally speaking, there are two ways to take multiple loading cases into ac-count. A popular method is designing for the worst-case scenario. This methodfinds the optimum structure for the most critical loading case, while the stresses,compliance etc. due to other loading cases must be within the set criteria. Thisis, however, a somewhat conservative approach [27]. The influence of otherloading cases are neglected, and therefore, the optimum is not optimal for thesecases. The second method concerns the optimization of the objective functionrelated to all loading cases, and can be seen as a multi-objective optimizationproblem. For such problems, it is difficult at some stage, to improve one objec-tive function without increasing other functions. Therefore, it can be necessaryto let one objective increase, in favor of other objectives. The simplest methodto achieve this is by analyzing the sum of the improvements of each load case.

79

Page 98: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 5. APPLICATION TO MULTIPLE LOADING CASES

This is considered as the overall improvement. The same results can be ob-tained by minimizing the sum of the strain energy of the loading cases [28].This requires only a small modification in the objective function, and is definedas

Fshape(x) =

NLC∑q=1

Es,q (5.1)

where NLC is the number of load cases. Consequently, the sensitivity numberis defined as

αi,dir,d =

NLC∑q=1

Es,q,i,dir,d. (5.2)

The original objective function as proposed by [27], considers a weight coeffi-cient to each loading case. This coefficient is implemented to emphasize theimportance of the specific loading case. For instance, it provides the opportu-nity to take into account how often a loading case occurs during the life span ofthe structure. It gives the designer more control over the optimization process.However, as the thesis does not take into account real-world loading cases andloading values, such a weighting coefficient can be omitted.

5.3 Concentrated Vertical Loads

The structure with a span of 10m is considered and is subjected to two loads,as given in Figure 5.1. The loads that have the same color are designed inthe same load case. The total load value per position is 100kN . The loads inFigure 5.2a are designed in the same load case, while the other three structures(Figures 5.2b to 5.2d)are subjected to loads in two load load cases, and hence,act independently from each other.First, the optimum solution, as shown in Figure 5.2b, is a remarkably lowerstructure than as discussed in Section 4.5.1 and shown in Figure 5.2a. Theheight decreased from 16 to 1.55m. The solution is a compromise of the optimumsolution of the individual load case; the optimum solution of one load is far fromoptimal for the other load, and hence the optimum structure is one that is inbetween, but much lower than the individual structures. The loads in each loadcase of the structure shown in Figure 5.2c, is asymmetrical, hence, the optimalsolution for one load case is expected to be asymmetrical as well. On the otherhand, the total load value at one position is equal to the load value at theother position, thus the total load is symmetrically distributed. Therefore, thesolution that is optimal for both cases is symmetrical as well. Moreover, theheight is larger than the structure shown top right. This can be accounted tothe fact that both load cases have loads imposed on the same position, and thus,the optimum structure for both load cases exhibits kinks at the same position.Although the structure is symmetrical, the kinks contribute to the optimumstructure for both load cases.

80

Page 99: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

5.3. CONCENTRATED VERTICAL LOADSStrain

energy

[kJ]

Iteration number [-]

010 15

200

5

LC 1 = AC 1

20

50

100

150

250

300

350

400

(a) Analysis case 1

Strain

energy

[kJ]

Iteration number [-]

010 150 5

LC 2

LC 3

AC 2

20

200

400

600

800

1000

1200

1400

(b) Analysis case 2

Strain

energy

[kJ]

Iteration number [-]

010 150 5

LC 4

LC 5

AC 3

20

50

100

150

200

250

300

350

(c) Analysis case 3

Strain

energy

[kJ]

Iteration number [-]

010 15

80

5

LC 6

LC 7

AC 4

20

20

40

60

100

120

140

350

160

0

(d) Analysis case 4

Figure 5.1: The optimization course of two concentrated loads for four situations

L = 30m

LC 1 = F + FAC 1 =LC 1

Heig

ht

[m]

0

15

20

5

10

(a) Analysis case 1: 1 load case

LC 2 = FLC 3 = F

AC 2 = LC 2 + LC 3

L = 30m

Heig

ht

[m]

0

15

20

5

10

(b) Analysis case 2: 2 load cases

LC 4 = 13

F+ 23

F

LC 5 = 23

F+ 13

F

AC 3 = LC 4 + LC 5

L = 30m

Heig

ht

[m]

0

15

20

5

10

(c) Analysis case 3: 2 load cases

Heig

ht

[m]

0

15

20

5

10

LC 6 = 12

F+ 12

F

LC 7 = 12

F+ 12

F

AC 4 =LC 6 + LC 7

L = 30m

(d) Analysis case 4: 2 load cases

Figure 5.2: The optimum solutions when subjected to concentrated loads designedin different load cases

The structure in Figure 5.2d yields the lowest strain energy; the loads in one

81

Page 100: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 5. APPLICATION TO MULTIPLE LOADING CASES

loading case are symmetrical, and only 100kN is imposed on the structure eachtime, instead of 200kN as in Figure 5.2a. Obviously, it is more advantageous tosubject the structure to only half the load value at a time. It can also be seenthat the optimum configuration depends on the ratio of loads, rather than theload value itself.

In Figure 5.1 is illustrated the fitness of the optimum of one loading case relativeto the other case. It can be clearly be seen in Figures 5.1b and 5.1c that thealgorithm pursuits a compromise of the two load cases. In the first iteration, asolution is found that is optimal for load case 3 and 5, and in the next, a majorimprovement for the load cases 4 and 6 has occurred. However, this could nothave been found without worsening the optimum for load cases 3 and 5. On theother hand, the sum of both worsening and improvement is positive, and hence,the compromised solution is improved, as illustrated by the descending blacklines. Another remark concerns the difficulty to fine-tune the compromise oftwo optima. The algorithm is terminated relatively early, although the solutionis more optimal for load cases 3 and 5 than for 2 and 4. This is due to the lackof the algorithm to find a perfect symmetrical geometry.Another example shows the result of the optimization process for 9 loading cases.The optimum solution is given in Figure 5.2. Again, the height is significantlylower than the structure as shown in Table 4.9, and is 1.47m. Furthermore, inthe early stage, the strain energy due to each loading case is reduced. After6 iterations, it can be seen that a further reduction in the sum of the strainenergies is not possible without sacrificing the optimum solution for load cases1 and 2 (the continuous blue and red line).

AC =∑9

q=1 LCq

L = 30m

H=

1.5

m

LC 1 LC 2 LC 3 LC 4 LC 5 LC 6 LC 7 LC 8 LC 9

Figure 5.3: The optimum solution when subjected to 9 loads in 9 different loadingcases

5.4 Uniformly Distributed Horizontal and Ver-tical Loads

Two situations, which are subjected to both a vertical and horizontal uniformlydistributed load, are considered. Three optimizations are conducted. For thefirst two, the structure is subjected to load combination 1 or 2, composed asgiven below:The first two found the optimum when subjected to either load combination1 or 2. The last analysis optimized the structure when subjected to both theload combinations. The structure spans 10m. In the first situation, the verticalload is 12.5 times the horizontal load. The optimum structures are given in Fig-ure 5.5. It can be seen that the algorithm finds two almost identical structures

82

Page 101: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

5.4. UNIFORMLY DISTRIBUTED HORIZONTAL AND VERTICALLOADS

Strain

energy

LC

[kJ]

Iteration number [-]

0

10 150 5

LC 1

500

1000

1500

2000

2500

3000

Strain

energy

∑ LC

[kJ]

0

5000

10.000

15.000

LC 2 LC 3 LC 4 LC 5 LC 6 LC 7 LC 8 LC 9 ∑9q=1 LCq

Figure 5.4: The optimization course when subjected to 9 loads in 9 different loadingcases

Load combination 1 Load combination 2

Figure 5.5: Load combinations composed of vertical and horizontal load from eitherleft or right

when subjected to load combination 1 or to load combination 2. The structureis more or less symmetrical due to the small contribution of the horizontal load.The same conclusion can be drawn from Figure 5.7a; the final strain energylevels are more or less equal. If the structure must be able to withstand bothload combinations, the optimum structure is 20 per cent lower than when it isdesigned to carry only one load combination. Figure 5.7b shows that the algo-rithm alters between structures that is more optimum for one load combinationthan the other. However, the difference in performance of the optimum regard-ing both load combinations decreases over the iterations, and is eventually only4 per cent.

0

2

4

6

8

10

0 10 20 30

Heig

ht

[m]

Span [m]

Load combination 1

Load combination 2

Load combination 1 + 2

Figure 5.6: Situation 1: vertical load = 12.5 horizontal load - The optimum structureswhen subjected to either load combination 1 or 2, or to both combinations.

83

Page 102: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 5. APPLICATION TO MULTIPLE LOADING CASES

45 50

0

10

20

30

40

50

60

70

80

0 5 10 15 20 25 30 35 40 45 50

Strain

energy

[kJ]

Iteration number [-]

Load combination 1

Load combination 2

(a) Subjected to a single load combination

0

10

20

30

40

50

60

70

80

0 5 10 15 20 25 30 35 40 45 50

Strain

energy

[kJ]

Iteration number [-]

Load combination 1

Load combination 2

Load combination 1 + 2

(b) Subjected to multiple load combinations

Figure 5.7: Situation 1: vertical load = 12.5 horizontal load - The optimizationcourse when considering a single or multiple load combinations

In the second situation, the vertical load is only 1.6 times the horizontal load.Due to the relatively high contribution of the horizontal load, the optimumstructures subjected to only a single load case is slightly asymmetrical, as givenby blue and orange lines in Figure 5.7. Again, the optimum structure that mustwithstand both load combinations, is lower than when the structure is subjectedto a singe load combination. However, the difference in height is now 40 percent due to the larger difference in optimum of the specific load combinations.Figure 5.9a shows the algorithm has more difficulty to find the global optimum,if the loading is more asymmetrical. A larger discrepancy between the two strainenergy levels can be noticed and is now 11 per cent. Furthermore, the differencein performance regarding the individual load combinations remains relativelylarge in the early stage, but decreases to a negligible 4 per cent, as shown inFigure 5.9b.

0

2

4

6

8

10

0 10 20 30

Heig

ht

[m]

Span [m]

Load combination 1

Load combination 2

Load combination 1 + 2

Figure 5.8: Situation 1: vertical load = 1.6 horizontal load - The optimum structureswhen subjected to either load combination 1 or 2, or to both combinations.

5.5 Conclusions

This chapter presented the extension of the optimization algorithm to multipleloading cases, following the method described by [28]. This is a very simplemethod to solve multiple-objective optimization problems, and requires onlya small modification in the objective function. When multiple loading casesare involved, a compromise of the individual optimal structures is pursued. Ifthe optimum structure of one load case is far from the optimum structure of

84

Page 103: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

5.5. CONCLUSIONS

5

0

1

2

3

4

5

0 5 10 15 20 25 30 35 40 45 50

Strain

energy

[kJ]

Iteration number [-]

Load combination 1

Load combination 2

(a) Subjected to a single load combination

0

1

2

3

4

5

0 5 10 15 20 25 30 35 40 45 50

Strain

energy

[kJ]

Iteration number [-]

Load combination 1

Load combination 2

Load combination 1 + 2

(b) Subjected to multiple load combinations

Figure 5.9: Situation 1: vertical load = 1.6 horizontal load - The optimization coursewhen when considering a single or multiple load combinations

the other load case, the compromised solution is a structure with a very lowheight. Therefore, it is important to design the loads in in the correct loadingcases, as this has great impact on the height of the optimum structures, andhence also the thrust forces. This influence is smaller if the self weight of thestructure is dominant, leading to small discrepancies in the optimum solutionsof the individual loading cases. Finally can be concluded that the algorithm hasmore difficulty to find a good solution if the optimum is asymmetrical.

85

Page 104: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer
Page 105: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

Conclusions andRecommendations

Conclusions

The Master’s thesis objective was to design a tool that graphically informs theuser how to improve the structural behavior of free forms, i.e. the stress andcompliance, and thereby giving an understanding of the structural behavior.In order to provide graphical information, B-spline curves are introduced. Thestructural improvement is attempted to achieve by minimizing the total strainenergy of the structure. In this section, an overview is given of the previouschapters.

First, an adequate algorithm is chosen. The results of three algorithms arecompared to the known, global optimum. In general, the obtained accuracy ofthe algorithms is higher when dealing with less control points. Furthermore, thedifference between the algorithms is small for five control points, if not moreor less equal, while the discrepancy grows for nine control points. In general,the HC performs best when dealing with structures subjected to concentratedloads or projected uniformly distributed loads. Regarding self weight, GA findsthe best result with five control points. For the HC, the number of conductedanalyses decreases slightly for a higher number of control points. This provesthat the method is very effective. The GA, on the other hand, is very slow forevery optimization, although it was capable of finding a solution close to thenear-optimum when dealing with self weight. The main drawback of the GA,is the need to adapt the basis algorithm to the specific problem, by adjustingthe crossover and mutation strength to the correct values. But even then, thealgorithm has a trial-and-error nature. Hence, in spite of choosing the optimumoperators, the algorithm is not guaranteed to perform faster. Another draw-back is the requirement of a large search space with many available candidatesolutions. A slightly different structural shape can lead to a huge differencein performance. If a relatively good solution is found, the algorithm does notknow how to fine-tune the solution, and randomly tries different mutations.The chance is very large that only worse solutions are found. The HC in con-trary, performs a sensitivity analysis for every variable. Although this is themost time-consuming part, it enables the algorithm to search in the best direc-tion. The drawback is the decrease in speed when many variables are involved.Nonetheless, this is a common problem for optimization algorithms. The HAalso performs a sensitivity analysis, and is therefore capable of finding better

87

Page 106: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

CHAPTER 5. APPLICATION TO MULTIPLE LOADING CASES

solutions than the GA, but the speed is slower. In overall, the HC performsmost accurate and fast, hence this algorithm is further improved to solve singleand multiple-objective shape optimization problems.

The proposed improvements are related to the variables and the nature of thealgorithm. Because form-finding is concerned, it is valid to base the number ofcontrol points on the optimum structural form, and hereby deleting the controlpoints that describe the original architectural geometry. When dealing withconcentrated loads, three control points are inserted and fixed right under theloads. By placing these points relative to each other, the description of a kinkis ensured. Further, the algorithm is refined by making the sensitivity analy-sis more efficient; rather than exploring the whole direct neighborhood of thesolution, first a direction is chosen, whereafter the optimal position is defined.Finally, a scaling algorithm is implemented to the original HC to help finding theglobal optimum. Because the control points are scaled in height, it is possiblethat loops in the curve occur, which terminates the process immediately. Thiscould have been overcome by scaling the curve itself, however, the associatedcontrol points would be lost. Another option is to disallow the control points tointersect by assigning a priority to each control point. The difficulty is to whichcontrol points should the highest priority be given. The proposed improvementslead to a significant reduction in speed. Furthermore, the algorithm is capableof finding the global optimum for concentrated loads, and the accuracy for uni-formly distributed loads is greatly increased. The inability of the algorithm tofind the global optimum can be attributed to the mutation of each control pointin one iteration. When multiple concentrated loads are imposed, the speed de-creases slightly along with the increase of number of variables, while an accurateresult can be obtained. The number of control points, and number of variables,to describe optimum structures subjected to uniformly distributed loads are de-fined based on the number of imposed concentrated loads. Obviously, due tothe larger number of variables with a higher degree of freedom, more time isrequired to handle an equivalent number of concentrated loads. This problemcan be overcome by modeling the multiple concentrated loads as uniformly dis-tributed loads. On the other hand, the methods is capable of finding accurateresults.

Structures subjected to multiple loading cases are optimized by slightly modi-fying the objective function. When multiple loading cases are involved, a com-promise of the individual optimal structures is pursued and the compromisedsolution is a structure with a very low height. Therefore, it is important todesign the loads in in the correct loading cases, as this has great impact on theheight of the optimum structures, and hence also the thrust forces. This influ-ence is smaller if the self weight of the structure is dominant, leading to smalldiscrepancies in the optimum solutions of the individual loading cases. Finallycan be concluded that the algorithm has more difficulty to find a good solutionif the optimum is asymmetrical.

Concluding, an optimization algorithm has been designed that is capable offinding the optimum shape of structures when subjected to concentrated loads,uniformly distributed loads, and its combinations, where control points are theparameters that describe the structure.

88

Page 107: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

5.5. CONCLUSIONS

Recommendations

As described in the Chapter 4, the algorithm leaves room for improvement.Some refinements have been proposed already, however, the accuracy and speedcan be improved more. A general drawback of optimization algorithms is the in-efficiency and the difficulty to handle a large number of variables. Some methodscan be explored, such as dividing the optimization process in sub-levels, wherethe first level obtains only a rough form of the optimum. In each levels, theadditional variables can be handled, leading to a more accurate form. Anotheroption is to implement strategies from other optimization algorithms that areknown for being better capable of handling a large number of variables. Thealgorithm can also be improved by reducing the number of variables that isrequired. As described in Section 4.3, the number of control points is greatlyincreased if a large number number of concentrated loads is involved. By usingtwo control points, or even only one, between each concentrated load, insteadof three, the algorithm could be much faster already. However, the accuracymay decrease in some situations. Another point of interest is the explorationof other methods to solve multiple loading cases. The examples shown in thisthesis could not have been compared to results in the literature. Therefore, adifferent method should be adopted to verify the results, and perhaps, to im-prove the results. For instance, a different approach to find a pareto optimumsolution can be used, or an other formulation of the objective function can beadopted.

The current algorithm is only a stepping stone towards an optimization pro-gram that can be used in the preliminary stage of a design process. In order tocreate such a program, size optimization must be included to define the dimen-sion of the structure. The structure can be modeled in several ways. A naturalcontinuity of the shape optimization, is to find the thickness of the beam ele-ment. The size can also be obtained by generating a mesh, using 2D-elements.Another option is to approach the thickness by a truss. Where the first doesnot provide graphical information, and a mesh can yield problems regardingautomated processes, a truss is straightforward, and is capable of of finding agood approach to the structural behavior. Moreover, the method is appealingfor the eye, as the structural thickness can be see immediately.Another criterion that must be met, is the structural stability. Depending on theboundary conditions, the arch must provide its own lateral buckling strength.Arches can also exhibit in-plane buckling and snap-through instability.Further, the thesis considers only basic loading cases. In order to obtain real-istic results, the influence of realistic loading cases should be investigated. Anexample is that the wind load decreases if the height of the structure decrease.Moreover, special cases of snow load distribution can be considered.

In addition to form-finding, more research should be conducted to form re-fining. This is especially interesting if the user has a preconceived model, thatmust stay within certain limits to maintain the underlying idea.Finally, it is very interesting to extend the algorithm to 3D structures, with thefocus put on shell structures. Especially shells with double curvature are verystiff. Moreover, this feature makes shells architectural very attractive.

89

Page 108: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer
Page 109: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

Appendix A

Steepest Descent HillClimbing

Option Strict OnImports Excel = Microsoft.Office.Interop.ExcelImports Gsa 8 5

Public Class Form1Public Shared oXL As Excel.ApplicationPublic Shared oWB As Excel.WorkbookPublic Shared oSheet As Excel.WorksheetPublic Shared oRange As Excel.Range

Public Shared spath As String = "E:"Public Shared sfilename As String = "\1.Master ABP SD\1.Master thesis\1.Generative Design\D Script\"Public Shared sFolder As String = "nurbs population\"

’### USER INPUT ####’choose min 3Public Shared cp As Integer’choose "pointLoad" (100kN) or "UDLoad"(1kN/m)Public Shared loadType As String’not projected = udload per cable lengthPublic Shared projected As StringPublic Shared symm As Boolean = False’###

Public Shared fitType As Integer = 0Public Shared fixed As Integer = 1Public Shared y As Integer = 0

Public Shared cpEven As BooleanPublic Shared lastcp As Integer

Public Shared s As IntegerPublic Shared nrNodes As IntegerPublic Shared nrBeams As Integer

Public Shared xMin, xMax, zMin, zMax, xUp As DoublePublic Shared xMid As Double

Public Shared wf(3, 10) As DoublePublic Shared tcp(,,) As DoubleDim MoveSpace(,,) As DoubleDim LimitDesignSpace(,,) As DoublePublic Shared coor(,,) As Double

Public Shared SA SE(,,,) As SinglePublic Shared maxStepSize As IntegerPublic Shared LowestStepSize As Integer

91

Page 110: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX A. STEEPEST DESCENT HILL CLIMBING

Public Shared valueStepSize() As IntegerPublic Shared newSolution As BooleanPublic Shared pert As Integer = -1Public Shared total As Integer = 1Public Shared no improv As Single

Dim Optimum As SingleDim LoopExists As Boolean

Public Shared pop fitness(,,) As Double

Public Shared myGSAObject As Gsa 8 5.ComAuto

Public Function gsaObj() As Gsa 8 5.ComAuto

Static bExistsAlready As Boolean

If Not bExistsAlready Or myGSAObject Is Nothing ThenmyGSAObject = New ComAutobExistsAlready = True

End If

If Not myGSAObject Is Nothing ThengsaObj = myGSAObject

End If

End Function

Public Sub ReleaseGsa()

myGSAObject = Nothing

End Sub

Private Sub Form1 Load(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles MyBase.Load

TxtnrPtLd.Text = CStr(1)

End Sub

Private Sub ChckUDLd CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles ChckUDLd.CheckedChanged

If ChckUDld.Checked ThenRadSpan.Visible = TrueRadElement.Visible = True

ElseRadSpan.Visible = FalseRadElement.Visible = False

End If

End Sub

Private Sub ChckPtLd CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles ChckPtLd.CheckedChanged

If ChckPtLd.Checked ThenLblnrPtLd.Visible = TrueTxtnrPtLd.Visible = True

ElseLblnrPtLd.Visible = FalseTxtnrPtLd.Visible = False

End If

End Sub

92

Page 111: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

Sub original()

Dim u As IntegerDim dmsn As Integer

If ChckPtLd.Checked = True ThenloadType = "pointLoad"

ElseIf ChckUDld.Checked = True ThenloadType = "UDLoad"

End If

If RadSpan.Checked = True Thenprojected = "yes"

ElseIf RadElement.Checked = True Thenprojected = "no"

End If

nrBeams = CInt(gsaObj.GwaCommand("highest,el"))nrNodes = nrBeams + 1cp = CInt(nrBeams / 10 + 1)s = cp - 1

ReDim tcp(1, cp + 1, 3)ReDim coor(1, nrNodes, 2)ReDim pop fitness(1, 10, nrBeams)ReDim MoveSpace(cp, 2, 1)ReDim LimitDesignSpace(cp, 2, 1)

For dmsn = 0 To 2For u = 2 To cp - 1

MoveSpace(u, dmsn, 0) = 30MoveSpace(u, dmsn, 1) = 30

NextNext

ReadGsaFile(0)

For u = 0 To cpFor dmsn = 0 To 2

LimitDesignSpace(u, dmsn, 0) = tcp(0, u, dmsn) - MoveSpace(u, dmsn, 0)LimitDesignSpace(u, dmsn, 1) = tcp(0, u, dmsn) + MoveSpace(u, dmsn, 1)

NextNext

’cpxtcp(0, 1, 0) = 0’cpztcp(0, 1, 2) = 0

xMin = tcp(0, 1, 0)xMax = tcp(0, cp, 0)zMin = tcp(0, 1, 2)zMax = tcp(0, cp, 2)xMid = (xMin + xMax) / 2

’define end of loop

If symm = False Thenlastcp = sxUp = xMax

ElseIf symm = True ThenIf Int(cp / 2) * 2 - cp = -1 Then

cpEven = Falselastcp = CInt(Int(cp / 2) + 1)

ElsecpEven = Truelastcp = CInt(Int(cp / 2))

End IfxUp = xMid

End If

ReDim valueStepSize(lastcp)

’y and weight

93

Page 112: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX A. STEEPEST DESCENT HILL CLIMBING

For u = 0 To cp + 1tcp(0, u, 1) = ytcp(0, u, 3) = fixed

Next u

End Sub

Sub ReadGsaFile(ByVal sol As Integer)

Dim nrNodes1 As IntegerDim node As IntegerDim dmsn As IntegerDim u As Integer

nrNodes1 = CInt((Val(gsaObj.GwaCommand("HIGHEST,NODE"))))

For node = nrNodes1 - (cp + 1) To nrNodes1For dmsn = 0 To 2

tcp(sol, node - (nrNodes1 - (cp + 1)), dmsn) =CDbl(gsaObj.Arg(dmsn + 2, CStr(gsaObj.GwaCommand("get,node.1," & node))))tcp(sol, node - (nrNodes1 - (cp + 1)), 3) = 1tcp(sol, node - (nrNodes1 - (cp + 1)), dmsn) =Math.Round(tcp(sol, node - (nrNodes1 - (cp + 1)), dmsn), 1)

NextNext

’use directcast to convert to or from data type ObjectoSheet = DirectCast(oWB.Worksheets(1), Excel.Worksheet)

For u = 1 To cpoSheet.Cells(1, u) = tcp(sol, u, 0)oSheet.Cells(1, u + cp) = tcp(sol, u, 2)

Next

End Sub

Private Sub BttnBrowse Click(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesBttnBrowse.Click

Dim FileToOpen As String

Select Case OpenFileDialog1.ShowDialog()Case System.Windows.Forms.DialogResult.Cancel

Exit SubEnd Select

FileToOpen = OpenFileDialog1.FileNameTxtFileToOpen.Text = FileToOpen

End Sub

Private Sub Button1 Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

’gsaObj.Open(TxtFileToOpen.Text)gsaObj.Open(TxtFileToOpen.Text)

’start Excel and get Application objectoXL = New Excel.Application’set some propertiesoXL.Visible = TrueoXL.DisplayAlerts = False’open existing workbookoWB = oXL.Workbooks.Add

Dim iter As Integer = 1Dim diffOptimum As Single

94

Page 113: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

If loadType = "pointLoad" ThenOptimum = 0.07459898294

ElseIf loadType = "UDLoad" And projected = "yes" ThenOptimum = 0.000278524

ElseIf loadType = "UDLoad" And projected = "no" ThenOptimum = 0.000435402238508686

End If

’generate initial model and assign fitnessoriginal()calc nodes(0, iter, diffOptimum)calc exp(0)export original(0)fitness(0)diffOptimum = CSng((pop fitness(0, 0, 1) - Optimum) / Optimum * 100)writing file(0, diffOptimum, iter)

DomaxStepSize = 6’na iedere nieuwe oplossing weer tot maxStepSize zoeken, zodat ook 0.8m kan!ReDim SA SE(lastcp, 6, 2, 2) ’leegmaken, anders erbij opgeteldsens anal(iter, diffOptimum)new local solution(iter, diffOptimum)

Loop Until no improv = pop fitness(1, 0, 1) Or diffOptimum < 10’loop until trapped in optimum or when difference current best solution and optimum < 10%

’Save the sheet and closeoSheet = NothingoRange = NothingoWB.SaveAs(spath & sfilename & sFolder & loadType & " " & projected & " " & cp & " localOpt.xls")oWB.Close()oWB = NothingoXL.Quit()

’ Clean up’ NOTE: When in release mode, this does the trickGC.WaitForPendingFinalizers()GC.Collect()GC.WaitForPendingFinalizers()GC.Collect()gsaObj.SaveAs(spath & sfilename & sFolder & "solution " & "sens anal" & iter & ".gwb")gsaObj.Close()ReleaseGsa()

End Sub

Public Shared Sub setupwf()

Dim a As Integer

For a = 0 To 10Dim t As Doublet = a * 0.1wf(0, a) = CSng((1 / 6) * (1 - 3 * t + 3 * t ^2 - t ^3))wf(1, a) = CSng((1 / 6) * (4 - 6 t ^2 + 3 * t ^3))wf(2, a) = CSng((1 / 6) * (1 + 3 * t + 3 * t ^2 - 3 * t ^3))wf(3, a) = CSng((1 / 6) * t ^3)

Next a

End Sub

Public Sub calc nodes(ByVal sol As Integer, ByVal iter As Integer, ByVal diffOptimum As Single)setupwf()

Dim last As IntegerDim node As IntegerDim a, b, d As Integer

LoopExists = False

95

Page 114: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX A. STEEPEST DESCENT HILL CLIMBING

For b = 0 To cp - 2If b = cp - 2 Then

last = 10Else

last = 9End If

For a = 0 To lastFor d = 0 To 2’Coordinate nodes P(t)=(P i*w i*B n,i)/(B n,i*w i)coor(sol, a + 1 + b * 10, d) = Math.Round(

(wf(0, a) * tcp(sol, b, d) * tcp(sol, b, 3) +wf(1, a) * tcp(sol, b + 1, d) * tcp(sol, b + 1, 3) +wf(2, a) * tcp(sol, b + 2, d) * tcp(sol, b + 2, 3) +wf(3, a) * tcp(sol, b + 3, d) * tcp(sol, b + 3, 3)) /(wf(0, a) * tcp(sol, b, 3) +wf(1, a) * tcp(sol, b + 1, 3) +wf(2, a) * tcp(sol, b + 2, 3) +wf(3, a) * tcp(sol, b + 3, 3)), 3)

Next dnode += 1ChkIntersection(sol, node, iter, diffOptimum)If LoopExists = True Then

Exit SubEnd If

Next aNext b

End Sub

Public Sub calc exp(ByVal sol As Integer)

Dim u As IntegerDim nodeNr As IntegerDim node As IntegerDim x, y, z As StringDim cpNr As IntegerDim posBeamF As DoubleDim ELNrF As IntegerDim posLoadF() As DoubleDim Load As Integer

Dim nrOfLoadBeam As Integer = CInt(gsaObj.GwaCommand("highest,load beam"))Dim nrOfLoadNode As Integer = CInt(gsaObj.GwaCommand("highest,load node"))

ReDim posLoadF(nrOfLoadBeam + nrOfLoadNode)

For Load = 1 To nrOfLoadBeam + nrOfLoadNodeposLoadF(Load) = coor(0, nrNodes, 0) / (nrOfLoadBeam + nrOfLoadNode + 1) ∗ Load

Next

For node = 1 To nrNodes - 2nodeNr = 0nodeNr = node + 1x = CStr(coor(sol, nodeNr, 0))y = CStr(0)z = CStr(coor(sol, nodeNr, 2))gsaObj.GwaCommand("SET,NODE.1," & nodeNr & "," &

x & "," &y & "," &z & ",GLOBAL,0,1,0,1,0,1")

Next node

If loadType = "pointLoad" ThengsaObj.GwaCommand("delete,load beam,1," & nrOfLoadBeam)gsaObj.GwaCommand("delete,load node,1," & nrOfLoadNode)

If symm = False Then

For Load = 1 To nrOfLoadBeam + nrOfLoadNode

For node = 1 To nrNodes - 1

96

Page 115: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

If coor(sol, node, 0) <= posLoadF(Load)And coor(sol, node + 1, 0) > posLoadF(Load) Then

posBeamF = posLoadF(Load) - coor(sol, node, 0)ELNrF = nodeExit For

End If

Next nodegsaObj.GwaCommand("SET,LOAD BEAM POINT," & ELNrF & ",1,GLOBAL,NO,X,+" & posBeamF & ",-100")gsaObj.GwaCommand("SET,LOAD BEAM POINT," & ELNrF & ",1,GLOBAL,NO,Z,+" & posBeamF & ",-100")

Next

ElseIf symm = True ThenELNrF = CInt((s ∗ 10)/2 + 1)gsaObj.GwaCommand("DELETE,LOAD NODE,1")gsaObj.GwaCommand("SET,LOAD NODE," & ELNrF & ",1,GLOBAl,Z,-100")

End If

End If

For u = 0 To cp + 1cpNr = nrNodescpNr = nrNodes + u + 1x = CStr(tcp(sol, u, 0))y = CStr(0)z = CStr(tcp(sol, u, 2))gsaObj.GwaCommand("SET,NODE.1," & cpNr & "," &

x & "," &y & "," &z & ",GLOBAL")

Next u

End Sub

Public Sub export original(ByVal sol As Integer)

Dim beam As IntegerDim beamNr As IntegerDim topo1, topo2 As IntegerDim x, y, z As String

x = CStr(xMin)y = CStr(0)z = CStr(zMin)

gsaObj.GwaCommand("SET,NODE.1,1," &x & "," &y & "," &z & ",GLOBAL,1,1,1,1,0,1")

x = CStr(xMax)y = CStr(0)z = CStr(zMax)

gsaObj.GwaCommand("SET,NODE.1," & nrNodes & "," &x & "," &y & "," &z & ",GLOBAL,1,1,1,1,0,1")

For beam = 0 To nrBeams - 1beamNr = 0beamNr = beam + 1topo1 = beamNrtopo2 = topo1 + 1gsaObj.GwaCommand("SET,EL BEAM," & beamNr & ",1,1," & topo1& "," & topo2 & ",0,90")

Next beam

97

Page 116: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX A. STEEPEST DESCENT HILL CLIMBING

End Sub

Sub fitness(ByVal sol As Integer)

Dim beam As IntegerDim SE As StringDim totalSE As SingleDim nr As IntegerDim A As Integer = 14003001 ’menbrane stressDim Bz posz As Integer = 14003006 ’bending stressDim Bz negz As Integer = 14003007Dim C1 As Integer = 14003008Dim C2 As Integer = 14003009

gsaObj.Analyse()

totalSE = 0

For beam = 1 To nrBeamsSE = gsaObj.Arg(3, CStr(gsaObj.GwaCommand("GET,STRAIN ENERGY,"& beam & ",1")))’fitnesstotalSE = totalSE + CSng(SE)

Next beam

pop fitness(sol, 0, 1) = totalSEDim Fr x, Fr z, Ax, Mzz As StringDim aStress, zzStresPos, zzStressNeg, stress1, stress2 As ObjectFr x = gsaObj.Arg(3, CStr(gsaObj.GwaCommand("GET,REACT FORCE,1,1")))Fr z = gsaObj.Arg(5, CStr(gsaObj.GwaCommand("GET,REACT FORCE,1,1")))pop fitness(sol, 1, 1) = CSng(Fr x)pop fitness(sol, 2, 1) = CSng(Fr z)

For beam = 1 To nrBeamsAx = gsaObj.Arg(4, CStr(gsaObj.GwaCommand("GET,FORCE 1D," & beam & ",1,0")))Mzz = gsaObj.Arg(6, CStr(gsaObj.GwaCommand("get,moment 1d," & beam & ",1,0")))pop fitness(sol, 3, beam) = CSng(Ax)pop fitness(sol, 4, beam) = CSng(Mzz)

NextgsaObj.Output Init(&H20, "GLOBAL", "A1", A, 0)For beam = 1 To nrBeams

nr = gsaObj.Output NumElemPos(beam)aStress = gsaObj.Output Extract(beam, 0)pop fitness(sol, 5, beam) = CSng(aStress)

NextgsaObj.Output Init(&H20, "GLOBAL", "A1", Bz posz, 0)For beam = 1 To nrBeams

nr = gsaObj.Output NumElemPos(beam)zzStresPos = gsaObj.Output Extract(beam, 0)pop fitness(sol, 6, beam) = CSng(zzStresPos)

NextgsaObj.Output Init(&H20, "GLOBAL", "A1", Bz negz, 0)For beam = 1 To nrBeams

nr = gsaObj.Output NumElemPos(beam)zzStressNeg = gsaObj.Output Extract(beam, 0)pop fitness(sol, 7, beam) = CSng(zzStressNeg)

Next beamgsaObj.Output Init(&H20, "GLOBAL", "A1", C1, 0)For beam = 1 To nrBeams

nr = gsaObj.Output NumElemPos(beam)stress1 = gsaObj.Output Extract(beam, 0)pop fitness(sol, 8, beam) = CSng(stress1)

Next beamgsaObj.Output Init(&H20, "GLOBAL", "A1", C2, 0)For beam = 1 To nrBeams

nr = gsaObj.Output NumElemPos(beam)stress2 = gsaObj.Output Extract(beam, 0)pop fitness(sol, 9, beam) = CSng(stress2)

Next beam

gsaObj.Delete("results")

98

Page 117: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

End Sub

Sub sens anal(ByVal iter As Integer, ByVal diffOptimum As Single)

Dim u, uu As IntegerDim dmsn As IntegerDim stepsize As SingleDim pert0, pert2 As IntegerDim mutation0, mutation2 As SingleDim increaseStepSize As IntegerDim beam As Integer

’appply mutation per node

For u = 2 To lastcpFor increaseStepSize = 0 To maxStepSize

For pert0 = 0 To 2For pert2 = 0 To 2

newSolution = Falsestepsize = 80stepsize = CSng(stepsize / (2 ^increaseStepSize))

’copy initial geometryFor uu = 0 To cp + 1

For dmsn = 0 To 3tcp(1, uu, dmsn) = tcp(0, uu, dmsn)

NextNext

’apply perturbation, analyse each modification and put in arrayIf pert0 >= 1 Then

mutation0 = CSng((pert ^pert0) / stepsize)ElseIf pert0 = 0 Then

mutation0 = 0End If

If pert2 >= 1 Thenmutation2 = CSng((pert ^pert2) / stepsize)

ElseIf pert2 = 0 Thenmutation2 = 0

End If

tcp(1, u, 0) += mutation0tcp(1, u, 2) += mutation2

If (LimitDesignSpace(u, 0, 0) <> 0 And LimitDesignSpace(u, 0, 1) <> 0)Or (LimitDesignSpace(u, 2, 0) <> 0 And LimitDesignSpace(u, 2, 1) <> 0) Then

’LimitDesignSpace(0)=LimitDesignSpace(1)=0,hier is een extra controle punt toegevoegd, >mag overal heen’en anders gebonden aan opgegeven limitdesignspace’eis: tcp() > LimitDesignSpace() And tcp(nrSol, u, dmsn) < LimitDesignSpace(u, dmsn, 1)If tcp(1, u, 0) > LimitDesignSpace(u, 0, 1) Then

tcp(1, u, 0) = tcp(0, u, 0)ElseIf tcp(1, u, 0) < LimitDesignSpace(u, 0, 0) Then

tcp(1, u, 0) = tcp(0, u, 0)End IfIf tcp(1, u, 2) > LimitDesignSpace(u, 2, 1) Then

tcp(1, u, 2) = tcp(0, u, 2)ElseIf tcp(1, u, 2) < LimitDesignSpace(u, 2, 0) Then

tcp(1, u, 2) = tcp(0, u, 2)End If

End If

If symm = True Thentcp(1, 3, 0) = xMidtcp(1, 4, 0) = xMax - tcp(1, 2, 0)tcp(1, 4, 2) = tcp(1, 2, 2)

End If

’if mutation is reset, then pert0 and pert2 arenot reset.’the corresponding E s is equal to the initial geometry,implying this solution will never be chosen.

99

Page 118: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX A. STEEPEST DESCENT HILL CLIMBING

’hence, pert0 and pert2 can be used to determine the final geometry

’calculate accompanying phantom nodesFor dmsn = 0 To 2

tcp(1, 0, dmsn) = 2 * tcp(1, 1, dmsn) - tcp(1, 2, dmsn)tcp(1, cp + 1, dmsn) = 2 * tcp(1, cp, dmsn) - tcp(1, cp - 1, dmsn)

Next

For uu = 0 To cp + 1For dmsn = 0 To 3

tcp(1, uu, dmsn) = CSng(Math.Round(tcp(1, uu, dmsn), 4))Next

Next

calc nodes(1, iter, diffOptimum)

If LoopExists = True Thenrelease solution(iter, diffOptimum)SA SE(u, increaseStepSize, pert0, pert2) =CSng(pop fitness(0, 0, 1))

ElseIf LoopExists = False Thencalc exp(1)gsaObj.Analyse()For beam = 1 To nrBeams

SA SE(u, increaseStepSize, pert0, pert2) +=CSng(gsaObj.Arg(3, CStr(gsaObj.GwaCommand("GET,STRAIN ENERGY," & beam & ",1"))))

Next beamgsaObj.Delete("results")End If

Next pert2Next pert0

Next increaseStepSizeNext u

End Sub

Sub new local solution(ByVal iter As Integer, ByVal diffOptimum As Single)

’modify the variable that yield the most improvementDim u As IntegerDim strainEnergy As SingleDim lowestStrainEnergy(lastcp) As SingleDim pert0 (lastcp), pert2 (lastcp) As IntegerDim increaseStepSize As IntegerDim stepsize As SingleDim nrSE As IntegernewSolution = TrueoSheet = DirectCast(oWB.Worksheets(2), Excel.Worksheet)

’voor u kijken wat richting het beste is geweest, en welke stapgrootte daarbij hoort

For u = 2 To lastcpstrainEnergy = 9999999999For increaseStepSize = 0 To maxStepSize

For pert0 = 0 To 2For pert2 = 0 To 2

If SA SE(u, increaseStepSize, pert0, pert2) < strainEnergy ThenstrainEnergy = SA SE(u, increaseStepSize, pert0, pert2)pert0 (u) = pert0pert2 (u) = pert2valueStepSize(u) = increaseStepSizelowestStrainEnergy(u) = strainEnergy

End IfNext

NextNext

Next

’copy initial geometryFor u = 0 To cp + 1

For dmsn = 0 To 3tcp(1, u, dmsn) = tcp(0, u, dmsn)

100

Page 119: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

NextNext

’NOTE even if pert0 or pert2=0, to the power yields 1For u = 2 To lastcp

stepsize = 80stepsize = CSng(stepsize / (2 ^valueStepSize(u)))If pert0 (u) <> 0 Then

tcp(1, u, 0) += CSng((pert ^pert0 (u)) / stepsize)End IfIf pert2 (u) <> 0 Then

tcp(1, u, 2) += CSng((pert ^pert2 (u)) / stepsize)End If

Next

If symm = True Thentcp(1, 3, 0) = xMidtcp(1, 4, 0) = xMax - tcp(1, 2, 0)tcp(1, 4, 2) = tcp(1, 2, 2)

End If

’calculate new phantom nodesFor dmsn = 0 To 2

tcp(1, 0, dmsn) = 2 * tcp(1, 1, dmsn) - tcp(1, 2, dmsn)tcp(1, cp + 1, dmsn) = 2 * tcp(1, cp, dmsn) - tcp(1, cp - 1, dmsn)

Next

For u = 0 To cp + 1For dmsn = 0 To 3

tcp(1, u, dmsn) = CSng(Math.Round(tcp(1, u, dmsn), 4))Next

Next

’analyse new modified solutioncalc nodes(1, iter, diffOptimum)If LoopExists = True Then

LowestStepSize = 0For u = 0 To lastcp

If valueStepSize(u) > LowestStepSize ThenLowestStepSize = valueStepSize(u)

End IfNext

release solution(iter, diffOptimum)ElseIf LoopExists = False Thencalc exp(1)fitness(1)replace if better(iter, diffOptimum)End If

End Sub

Sub ChkIntersection(ByVal sol As Integer, ByVal node As Integer, ByVal iter As Integer, ByValdiffOptimum As Single)

’disallow intersections of polygonal edgesDim gradient(node) As DoubleDim b(nrBeams) As DoubleDim beam As IntegerDim intersection As DoubleDim lowx, upx As DoubleDim low1x, up1x As Double

If node >= 2 ThenIf coor(sol, node, 0) = coor(sol, node - 1, 0)And coor(sol, node, 2) = coor(sol, node - 1, 2) Then

LoopExists = TrueExit Sub

End IfEnd If

If node >= 4 Thengradient(0) = (coor(sol, node, 2) - coor(sol, node - 1, 2)) /(coor(sol, node, 0) - coor(sol, node - 1, 0))

101

Page 120: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX A. STEEPEST DESCENT HILL CLIMBING

b(0) = coor(sol, node, 2) - (gradient(0) * coor(sol, node, 0))’segment boundaries of last segmentIf coor(sol, node, 0) < coor(sol, node - 1, 0) Then

lowx = coor(sol, node, 0)upx = coor(sol, node - 1, 0)

Elselowx = coor(sol, node - 1, 0)upx = coor(sol, node, 0)

End If

For beam = 1 To node - 3gradient(beam) = Math.Round((coor(sol, beam + 1, 2) -coor(sol, beam, 2)) /(coor(sol, beam + 1, 0) - coor(sol, beam, 0)), 5)b(beam) = Math.Round(coor(sol, beam, 2) - (gradient(beam) *coor(sol, beam, 0)), 5)

Next

For beam = 1 To node - 3’if both lines are not parallel, intersection could occurIf gradient(beam) <> gradient(0) Then’segment boundaries of segment to be checked

If coor(sol, beam, 0) < coor(sol, beam + 1, 0) Thenlow1x = coor(sol, beam, 0)up1x = coor(sol, beam + 1, 0)

Elselow1x = coor(sol, beam + 1, 0)up1x = coor(sol, beam, 0)

End Ifintersection = (b(beam) - b(0)) / (gradient(0) -gradient(beam))’if intersection is in both x-interval-->determine new cpsIf intersection >= lowx And intersection <= upx And

intersection >= low1x And intersection <= up1x ThenLoopExists = TrueExit Sub

End IfEnd If

NextEnd If

End Sub

Sub release solution(ByVal iter As Integer, ByVal diffOptimum As Single)

Dim u, dmsn As Integer

If newSolution = False ThenFor u = 0 To cp + 1

For dmsn = 0 To 3tcp(1, u, dmsn) = tcp(0, u, dmsn)

NextNext

ElseIf newSolution = True ThenIf maxStepSize > 0 Then

LowestStepSize -= 1If maxStepSize > LowestStepSize Then

maxStepSize = LowestStepSizeElse

maxStepSize -= 1End If

new local solution(iter, diffOptimum)Else

StopFor u = 0 To cp + 1

For dmsn = 0 To 3tcp(1, u, dmsn) = tcp(0, u, dmsn)

NextNext

pop fitness(1, 0, 1) = pop fitness(0, 0, 1)replace if better(iter, diffOptimum)End If

End If

102

Page 121: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

End Sub

Sub replace if better(ByRef iter As Integer, ByVal diffOptimum As Single)

Dim u As IntegerDim dmsn As IntegerDim fittype As IntegerDim beam As Integer

’replace solution if modified one is betteriter += 1diffOptimum = CSng((pop fitness(1, 0, 1) - Optimum) / Optimum * 100)

If pop fitness(1, 0, 1) < pop fitness(0, 0, 1) ThenFor u = 0 To cp + 1

For dmsn = 0 To 3tcp(0, u, dmsn) = tcp(1, u, dmsn)

NextNext

For fittype = 0 To 9For beam = 1 To nrBeams

pop fitness(0, fittype, beam) = pop fitness(1, fittype, beam)Next

Next

OutputGSAViews()writing file(1, diffOptimum, iter)Else

If maxStepSize > 0 ThenLowestStepSize = 0For u = 0 To lastcp

If valueStepSize(u) > LowestStepSize ThenLowestStepSize = valueStepSize(u)

End IfNextLowestStepSize -= 1If maxStepSize > LowestStepSize Then

maxStepSize = LowestStepSizeElse

maxStepSize -= 1End Ifnew local solution(iter, diffOptimum)

Elseno improv = CSng(pop fitness(1, 0, 1))

End IfEnd If

End Sub

Sub OutputGSAViews()

Dim GraphicView As String

GraphicView = CStr(TxtGraphicView.Text)gsaObj.SaveViewToFile(GraphicView, "PNG")

End Sub

Public Sub writing file(ByVal sol As Integer, ByVal diffOptimum As Single, ByVal iter As Integer)

Dim ws, fitt, u, beam As Integerws = 1

’get correct worksheetoSheet = DirectCast(oWB.Worksheets(ws), Excel.Worksheet)

total += 1

oSheet.Cells(total, 1) = iteroSheet.Cells(total, 2) = pop fitness(sol, fitType, 1)oSheet.Cells(total, 3) = diffOptimum

103

Page 122: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX A. STEEPEST DESCENT HILL CLIMBING

For u = 0 To cp + 1oSheet.Cells(total, 4 + u) = tcp(sol, u, 0)oSheet.Cells(total, 4 + u + (cp + 2)) = tcp(sol, u, 2)oSheet.Cells(total, 4 + u + 2 * (cp + 2)) = tcp(sol, u, 3)

Next

For fitt = 1 To 2oSheet.Cells(fitt + (total - 1) * nrBeams, 11 + 3 * (cp + 2)) =pop fitness(sol, fitt, 1)

Next

For fitt = 3 To 9For beam = 1 To nrBeams

oSheet.Cells(3 + (total - 1) * (nrBeams + 1) + beam, 10 + 3 * (cp + 2)) = beamoSheet.Cells(3 + (total - 1) * (nrBeams + 1) + beam, 10 + 3 * (cp + 2) + (fitt - 2)) =pop fitness(sol, fitt, beam)

NextNext

End Sub

End Class

104

Page 123: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

Appendix B

Genetic Algorithm

Option Strict OnImports Excel = Microsoft.Office.Interop.ExcelImports Gsa 8 5

Public Class Form1Public Shared oXL As Excel.ApplicationPublic Shared oWB As Excel.WorkbookPublic Shared oSheet As Excel.WorksheetPublic Shared oRange As Excel.Range

Public Shared spath As String = "E:"Public Shared sfilename As String = "\1.Master ABP SD\1.Master thesis\1.Generative Design\D Script\"Public Shared sFolder As String = "nurbs population\"

’### USER INPUT ####’choose min 3Public Shared cp As Integer’choose "pointLoad" (100kN) or "UDLoad"(1kN/m)Public Shared loadType As String = "UDLoad"’not projected = self weightPublic Shared projected As String = "no"Public Shared symm As Boolean = False’###

Public Shared fitType As Integer = 0Public Shared nrSol As Integer = 11Public Shared fixed As Integer = 1Public Shared y As Integer = 0Dim NewGsaSolution As String

Public Shared p As Double = 2

Public Shared cpEven As BooleanPublic Shared lastcp As Integer

Public Shared s As IntegerPublic Shared nrNodes As IntegerPublic Shared nrBeams As Integer

Public Shared xMin, xMax, zMin, zMax, xUp As DoublePublic Shared xMid As DoubleDim maxHeight As Double = 10Public Shared wMin, wMax As Integer

Public Shared wf(3, 10) As DoublePublic Shared tcp(,,) As DoublePublic Shared coor(,,) As Double

Dim LoopExists As Boolean

Public Shared limit1, limit2 As Double

105

Page 124: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX B. GENETIC ALGORITHM

Public Shared iter As IntegerPublic Shared best As IntegerPublic Shared worst As IntegerDim NrLoadCases As IntegerPublic Shared pop fitness(,,) As DoublePublic Shared bestValue As DoublePublic Shared worstValue As DoublePublic Shared total As IntegerPublic Shared range(nrSol) As Double

Public Shared myGSAObject As Gsa 8 5.ComAuto

Public Function gsaObj() As Gsa 8 5.ComAuto

Static bExistsAlready As Boolean

If Not bExistsAlready Or myGSAObject Is Nothing ThenmyGSAObject = New ComAutobExistsAlready = True

End If

If Not myGSAObject Is Nothing ThengsaObj = myGSAObject

End If

End Function

Public Sub ReleaseGsa()

myGSAObject = Nothing

End Sub

Sub original()

Dim u As Integer

s = cp - 1nrNodes = s * 10 + 1nrBeams = s * 10

ReDim tcp(nrSol, cp + 1, 3)ReDim coor(nrSol, nrNodes, 3)ReDim pop fitness(nrSol, 10, nrBeams)

’cpxtcp(0, 1, 0) = 0tcp(0, cp, 0) = 10’cpztcp(0, 1, 2) = 0tcp(0, cp, 2) = 5 ’0

xMin = tcp(0, 1, 0)xMax = tcp(0, cp, 0)zMin = tcp(0, 1, 2)zMax = tcp(0, cp, 2)xMid = (xMin + xMax) / 2

For u = 0 To cp + 1tcp(0, u, 1) = ytcp(0, u, 3) = fixed

Next u

If symm = False ThenxUp = xMaxlastcp = s

ElseIf symm = True ThenxUp = xMidIf Int(cp / 2) * 2 - cp = -1 Then

106

Page 125: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

cpEven = Falselastcp = CInt(Int(cp / 2) + 1)

ElsecpEven = Truelastcp = CInt(Int(cp / 2))

End IfFor u = 1 To lastcp

tcp(0, cp - (u - 1), 0) = xMax - tcp(0, u, 0)Next u

End If

End Sub

Sub get nodes gsa(ByVal sol As Integer, ByVal nrcontrolpoints As Integer)

Dim nrNodes1 As IntegerDim node As IntegerDim dmsn As IntegerDim u As IntegerDim controlpoint As Integer

gsaObj.Close()ReleaseGsa()Dim newGsaFile As StringnewGsaFile = Replace(FileToOpen, ".gwb", " " & nrcontrolpoints & " " & sol & ".gwb")gsaObj.Open(newGsaFile)

nrNodes1 = CInt((Val(gsaObj.GwaCommand("HIGHEST,NODE"))))

For node = (nrNodes1 - cp + 1) To nrNodes1controlpoint += 1For dmsn = 0 To 2

tcp(sol, controlpoint, dmsn) = CDbl(gsaObj.Arg(dmsn + 2,CStr(gsaObj.GwaCommand("get,node.1," & node))))tcp(sol, controlpoint, 3) = fixedtcp(sol, controlpoint, dmsn) = Math.Round(tcp(sol, controlpoint, dmsn), 5)

NextNext

’use directcast to convert to or from data type ObjectoSheet2 = DirectCast(oWB.Worksheets(2), Excel.Worksheet)

For u = 1 To cpoSheet2.Cells(sol, u) = tcp(sol, u, 0)oSheet2.Cells(sol, u + cp) = tcp(sol, u, 2)

Next

End Sub

Sub get nodes excel(ByVal sol As Integer)

Dim c, u As Integer

oSheet2 = DirectCast(oWB.Worksheets(1), Excel.Worksheet)

For u = 1 To cptcp(sol, u, 0) = CDbl(oSheet2.Cells(sol, u).Value)tcp(sol, u, 2) = CDbl(oSheet2.Cells(sol, u + cp).value)osheet2.Cells(sol, u) = tcp(sol, u, 0)oSheet2.Cells(sol, u + cp) = tcp(sol, u, 2)

Next

For u = 0 To cp + 1tcp(sol, u, 3) = 1

Next

’calculate phantom pointsFor c = 0 To 2

tcp(sol, 0, c) = Math.Round(2 * tcp(sol, 1, c) - tcp(sol, 2, c), 3)tcp(sol, cp + 1, c) = Math.Round(2 * tcp(sol, cp, c) - tcp(sol, cp - 1, c), 3)

Next c

107

Page 126: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX B. GENETIC ALGORITHM

End Sub

Public Sub Button1 Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim sol As IntegerDim u As Integer

’include odds to randomly mutate cps in order to reach global optimumDim mutationStrength As DoubleDim diffOptimum As DoubleDim Crit As Integer

Dim rank(nrSol - 1) As IntegerDim SE As DoubleDim beam As IntegerDim avrg pop(1) As DoubleDim ImprovRng As DoubleDim n As IntegerDim count As IntegerDim totalWorst As IntegerDim worst replaced As BooleanDim Node1, Node2 As IntegerDim ExcelFile As String

Select Case OpenFileDialog1.ShowDialog()Case System.Windows.Forms.DialogResult.Cancel

Exit SubEnd Select

FileToOpen = OpenFileDialog1.FileName

gsaObj.Open(FileToOpen)’gsaObj.Open(FileToOpen)

’start Excel and get Application object. oXL = New Excel.Application’set some propertiesoXL.Visible = TrueoXL.DisplayAlerts = False

For nrControlPoints = 3 To 9gsaObj.Delete("results and cases")

cp = nrControlPointsiter = 0total = 0totalWorst = 0mutationStrength = 25Crit = -75n = 0count = 0ImprovRng = 0

ExcelFile = Replace(FileToOpen, ".gwb", " " & nrControlPoints & "cp.xls")

’generate initial model and assign fitnessoriginal()export original(0)

’generate population and assign fitnessoWB = oXL.Workbooks.AddoSheet2 = DirectCast(oWB.Worksheets(2), Excel.Worksheet)

For sol = 1 To nrSol - 1’get nodes gsa(sol, nrControlPoints)control points(sol)calc nodes(sol, mutationStrength, rank, Node1, Node2)calc exp(sol)NewGsaSolution = Replace(FileToOpen, ".gwb", " " & nrControlPoints & " " & sol & ".gwb")gsaObj.SaveAs(NewGsaSolution)

SE = 0gsaObj.Analyse()NrLoadCases = gsaObj.HighestCase("L")

108

Page 127: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

For loadcase = 1 To NrLoadCasesFor beam = 1 To nrBeams

SE += CDbl(gsaObj.Arg(3, CStr(gsaObj.GwaCommand("GET,STRAIN ENERGY," & beam & "," & loadcase))))

Next beamNextSE = Math.Round(SE, 5)gsaObj.Delete("results")

pop fitness(sol, 0, 1) = SEFor u = 1 To cp

oSheet2.Cells(sol, u) = tcp(sol, u, 0)oSheet2.Cells(sol, u + cp) = tcp(sol, u, 2)

NextoSheet2.Cells(sol, cp * 2 + 1) = pop fitness(sol, 0, 1)

Next sol

Crit += CInt(Crit / 2 ^n)avrg pop(1) = (0 + 0) / 2’start iterationDo

iter += 1’rankReDim rank(nrSol - 1)rank solutions(rank)

’generate new nodes and analyzecreate new solution(mutationStrength, rank, 2, s)calc nodes(nrSol, mutationStrength, rank, Node1, Node2)calc exp(nrSol)fitness(nrSol)gsaObj.Delete("results")’replace if pop fitness(nrSol)<worstValueIf pop fitness(nrSol, fitType, 1) <bestValue Then

OutputGSAViews()End Ifreplace if better than worst(totalWorst, worst replaced,nrControlPoints)

avrg pop(0) = avrg pop(1)avrg pop(1) = (bestValue + worstValue) / 2’cumulative improvementIf iter > 1 Then

ImprovRng += (avrg pop(1) - avrg pop(0)) / avrg pop(0) * 100End If

If mutationStrength > 10 ThenIf ImprovRng < Crit Then

n += 1Crit += CInt(Crit / 2 ^n)mutationStrength -= 3

End IfEnd If

writing file(best, totalWorst, diffOptimum, ImprovRng, worst replaced, nrControlPoints)count += 1If count = 100 Then

oWB.SaveAs(ExcelFile)count = 0

End If

Loop Until iter = 15000

’Save and closeoSheet = NothingoRange = NothingoWB.SaveAs(ExcelFile)oWB.Close()oWB = NothingNewGsaSolution = Replace(FileToOpen, ".gwb", " " & nrControlPoints & "cp " & nrSol & ".gwb")gsaObj.SaveAs(NewGsaSolution)

Next

109

Page 128: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX B. GENETIC ALGORITHM

oXL.Quit()

’ Clean up’ NOTE: When in release mode, this does the trickGC.WaitForPendingFinalizers()GC.Collect()GC.WaitForPendingFinalizers()GC.Collect()gsaObj.Close()ReleaseGsa()

End Sub

Public Shared Function create rndNr(ByVal Lowest As Double, ByVal highest As Double, ByVal decimalsAs Integer) As Double

Dim randomnumbers As Double

If decimals = 0 ThenRandomize()randomnumbers = Int((highest - Lowest) * Rnd() + Lowest)

ElseRandomize()randomnumbers = Math.Round((highest - Lowest) * Rnd() + Lowest, decimals)

End If

create rndNr = randomnumbers

End Function

Public Shared Sub setupwf()

Dim a As Integer

For a = 0 To 10Dim t As Doublet = a * 0.1wf(0, a) = (1 / 6) * (1 - 3 * t + 3 * t ^2 - t ^3)wf(1, a) = (1 / 6) * (4 - 6 * t ^2 + 3 * t ^3)wf(2, a) = (1 / 6) * (1 + 3 * t + 3 * t ^2 - 3 * t ^3)wf(3, a) = (1 / 6) * t ^3

Next a

End Sub

Public Sub control points(ByVal sol As Integer)

Dim c, u As IntegerDim nr, r As IntegerDim high coor As DoubleDim xRnd(lastcp) As Double

Dim lus As Booleanlus = True

Dim rankx(cp) As Integer

For u = 0 To cp + 1tcp(sol, u, 1) = ytcp(sol, u, 3) = 1

Next u

tcp(sol, 1, 0) = xMintcp(sol, cp, 0) = xMaxtcp(sol, 1, 2) = zMintcp(sol, cp, 2) = zMaxtcp(sol, 0, 3) = fixedtcp(sol, 1, 3) = fixedtcp(sol, cp, 3) = fixedtcp(sol, cp + 1, 3) = fixed

110

Page 129: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

For u = 2 To lastcpxRnd(u) = create rndNr(xMin, xUp, 1)

Next u

For u = 2 To stcp(sol, u, 2) = Math.Round(create rndNr(1, maxHeight, 1), 3)tcp(sol, u, 3) = fixed

Next

’arranging the x-coordinates in increasing sequence’however, later should the population be based on the design,and the x-coordinates are allowed to intersect

For r = 2 To lastcphigh coor = xMaxnr = 2For u = 2 To lastcp

If xRnd(u) <= high coor And rankx(u) = 0 Thenhigh coor = xRnd(u)nr = u

End IfNext urankx(nr) = rtcp(sol, r, 0) = xRnd(nr)

Next r

’set lastcp=xMidIf symm = True Then

If cpEven = False Thentcp(sol, lastcp, 0) = xMid

End IfFor u = 1 To lastcp

tcp(sol, cp - (u - 1), 0) = xMax - tcp(sol, u, 0)Next u

End If

’calculate phantom pointsFor c = 0 To 2

tcp(sol, 0, c) = Math.Round(2 * tcp(sol, 1, c) -tcp(sol, 2, c), 3)tcp(sol, cp + 1, c) = Math.Round(2 * tcp(sol, cp, c) -tcp(sol, cp - 1, c), 3)

Next c

End Sub

Public Sub calc nodes(ByVal sol As Integer, ByVal mutationStrength As Double, ByVal rank() As Integer,ByVal Node1 As Integer, ByVal Node2 As Integer)

Dim node As IntegerDim segment As IntegerDim last As IntegerDim a, b, d As Integer

setupwf()LoopExists = False

If Node1 < 3 Thensegment = 0node = 0

Elsesegment = Node1 - 3node = segment * 10

End If

For b = segment To cp - 2If b = cp - 2 Then

last = 10Else

last = 9End If

111

Page 130: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX B. GENETIC ALGORITHM

For a = 0 To lastFor d = 0 To 2

’Coordinate nodes P(t)=(P i*w i*B n,i)/(B n,i*w i)coor(sol, 1 + a + b * 10, d) =Math.Round((wf(0, a) * tcp(sol, b, d) * tcp(sol, b, 3) +wf(1, a) * tcp(sol, b + 1, d) * tcp(sol, b + 1, 3) +wf(2, a) * tcp(sol, b + 2, d) * tcp(sol, b + 2, 3) +wf(3, a) * tcp(sol, b + 3, d) * tcp(sol, b + 3, 3)) /(wf(0, a) * tcp(sol, b, 3) +wf(1, a) * tcp(sol, b + 1, 3) +wf(2, a) * tcp(sol, b + 2, 3) +wf(3, a) * tcp(sol, b + 3, 3)), 3)

Next dnode += 1ChkIntersection(sol, mutationStrength, rank, node, Node1, Node2,segment)

If LoopExists = True Thenrelease solution(sol, mutationStrength, rank, node, Node1,Node2)

End If

Next aNext b

End Sub

Sub ChkIntersection(ByVal sol As Integer, ByVal node As Integer, ByVal iter As Integer, ByValdiffOptimum As Single)

’disallow intersections of polygonal edgesDim gradient(node) As DoubleDim b(nrBeams) As DoubleDim beam As IntegerDim intersection As DoubleDim lowx, upx As DoubleDim low1x, up1x As Double

If node >= 2 ThenIf coor(sol, node, 0) = coor(sol, node - 1, 0)And coor(sol, node, 2) = coor(sol, node - 1, 2) Then

LoopExists = TrueExit Sub

End IfEnd If

If node >= 4 Thengradient(0) = (coor(sol, node, 2) - coor(sol, node - 1, 2)) /(coor(sol, node, 0) - coor(sol, node - 1, 0))b(0) = coor(sol, node, 2) - (gradient(0) * coor(sol, node, 0))’segment boundaries of last segmentIf coor(sol, node, 0) < coor(sol, node - 1, 0) Then

lowx = coor(sol, node, 0)upx = coor(sol, node - 1, 0)

Elselowx = coor(sol, node - 1, 0)upx = coor(sol, node, 0)

End If

For beam = 1 To node - 3gradient(beam) = Math.Round((coor(sol, beam + 1, 2) -coor(sol, beam, 2)) /(coor(sol, beam + 1, 0) - coor(sol, beam, 0)), 5)b(beam) = Math.Round(coor(sol, beam, 2) - (gradient(beam) *coor(sol, beam, 0)), 5)

Next

For beam = 1 To node - 3’if both lines are not parallel, intersection could occurIf gradient(beam) <> gradient(0) Then’segment boundaries of segment to be checked

If coor(sol, beam, 0) < coor(sol, beam + 1, 0) Then

112

Page 131: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

low1x = coor(sol, beam, 0)up1x = coor(sol, beam + 1, 0)

Elselow1x = coor(sol, beam + 1, 0)up1x = coor(sol, beam, 0)

End Ifintersection = (b(beam) - b(0)) / (gradient(0) -gradient(beam))’if intersection is in both x-interval-->determine new cpsIf intersection >= lowx And intersection <= upx And

intersection >= low1x And intersection <= up1x ThenLoopExists = TrueExit Sub

End IfEnd If

NextEnd If

End Sub

Sub release solution(ByVal sol As Integer, ByVal mutationStrength As Double, ByVal rank() As Integer,ByVal node As Integer, ByRef Node1 As Integer, ByRef Node2 As Integer)

If iter > 0 ThenNode1 = CInt(Int(node / 10))If Node1 > lastcp Then ’ s Then

Node1 = lastcp - (Node1 - lastcp)ElseIf Node1 = 0 Then

Node1 = 1End If

Node2 = Node1 + 3If Node2 > lastcp Then

Node2 = lastcpEnd If

create new solution(mutationStrength, rank, Node1, Node2)calc nodes(sol, mutationStrength, rank, Node1, Node2)

Elsecontrol points(sol)calc nodes(sol, mutationStrength, rank, Node1, Node2)

End If

End Sub

Public Sub calc exp(ByVal sol As Integer)

Dim u As IntegerDim x, y, z As StringDim cpNr As IntegerDim posBeam As DoubleDim ELNr As IntegerDim posLoad(1) As DoubleDim nrOfLoadBeam As Integer = CInt(gsaObj.GwaCommand("highest,load beam"))Dim nrOfLoadNode As Integer = CInt(gsaObj.GwaCommand("highest,load node"))

posLoad(0) = xMinposLoad(1) = xMid

gsaObj.GwaCommand("delete,load beam,1," & nrOfLoadBeam)gsaObj.GwaCommand("delete,load node,1," & nrOfLoadNode)

For node = 2 To nrNodes - 1x = CStr(coor(sol, node, 0))y = CStr(0)z = CStr(coor(sol, node, 2))gsaObj.GwaCommand("SET,NODE.1," & node & "," &

x & "," &y & "," &z & ",GLOBAL,0,1,0,1,0,1")

Next

113

Page 132: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX B. GENETIC ALGORITHM

If loadType = "pointLoad" ThenIf symm = False Then

For node = 1 To nrNodes - 1If coor(sol, node, 0) <= posLoad(1) And coor(sol, node + 1, 0) > posLoad(1) Then

posBeam = posLoad(1) - coor(sol, node, 0)ELNr = nodeEnd If

NextgsaObj.GwaCommand("SET,LOAD BEAM POINT," & ELNr & ",1,GLOBAL,NO,Z,+" & posBeam & ",-100")

ElseIf symm = True ThenELNr = CInt((s * 10) / 2 + 1)gsaObj.GwaCommand("DELETE,LOAD NODE,1")gsaObj.GwaCommand("SET,LOAD NODE," & ELNr & ",1,GLOBAl,z,-100")

End If

ElseIf loadType = "UDLoad" ThengsaObj.GwaCommand("SET,LOAD BEAM UDL,all,1,GLOBAL,no,Z,-1")

End If

For u = 1 To cpcpNr = nrNodes + 1 + ux = CStr(tcp(sol, u, 0))y = CStr(0)z = CStr(tcp(sol, u, 2))gsaObj.GwaCommand("SET,NODE.1," & cpNr & "," &

x & "," &y & "," &z & ",GLOBAL") Next

End Sub

Public Sub export original(ByVal sol As Integer)

Dim beam As IntegerDim x, y, z As StringDim HighestElementNr As Integer = CInt(gsaObj.GwaCommand("highest,el"))Dim HighestNodeNr As Integer = CInt(gsaObj.GwaCommand("highest,node"))

’verwijder allesgsaObj.Delete("results")gsaObj.GwaCommand("delete,node,1," & HighestNodeNr)gsaObj.GwaCommand("delete,el,1," & HighestElementNr)

x = CStr(xMin)y = CStr(0)z = CStr(zMin)

gsaObj.GwaCommand("SET,NODE.1,1," &x & "," &y & "," &z & ",GLOBAL,1,1,1,1,0,1")x = CStr(xMax)y = CStr(0)z = CStr(zMax)

gsaObj.GwaCommand("SET,NODE.1," & nrNodes & "," &x & "," &y & "," &z & ",GLOBAL,1,1,1,1,0,1")

For beam = 1 To nrBeamsgsaObj.GwaCommand("SET,EL BEAM," & beam & ",1,1," & beam & ","& beam + 1 & ",0,90")

Next beam

End Sub

Sub fitness(ByVal sol As Integer)

Dim beam As IntegerDim SE As StringDim totalSE As SingleDim nr As Integer

114

Page 133: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

Dim A As Integer = 14003001 ’menbrane stressDim Bz posz As Integer = 14003006 ’bending stressDim Bz negz As Integer = 14003007Dim C1 As Integer = 14003008Dim C2 As Integer = 14003009

gsaObj.Analyse()

totalSE = 0

For beam = 1 To nrBeamsSE = gsaObj.Arg(3, CStr(gsaObj.GwaCommand("GET,STRAIN ENERGY,"& beam & ",1")))’fitnesstotalSE = totalSE + CSng(SE)

Next beam

pop fitness(sol, 0, 1) = totalSEDim Fr x, Fr z, Ax, Mzz As StringDim aStress, zzStresPos, zzStressNeg, stress1, stress2 As ObjectFr x = gsaObj.Arg(3, CStr(gsaObj.GwaCommand("GET,REACT FORCE,1,1")))Fr z = gsaObj.Arg(5, CStr(gsaObj.GwaCommand("GET,REACT FORCE,1,1")))pop fitness(sol, 1, 1) = CSng(Fr x)pop fitness(sol, 2, 1) = CSng(Fr z)

For beam = 1 To nrBeamsAx = gsaObj.Arg(4, CStr(gsaObj.GwaCommand("GET,FORCE 1D," & beam& ",1,0")))Mzz = gsaObj.Arg(6, CStr(gsaObj.GwaCommand("get,moment 1d," & beam& ",1,0")))pop fitness(sol, 3, beam) = CSng(Ax)pop fitness(sol, 4, beam) = CSng(Mzz)

NextgsaObj.Output Init(&H20, "GLOBAL", "A1", A, 0)For beam = 1 To nrBeams

nr = gsaObj.Output NumElemPos(beam)aStress = gsaObj.Output Extract(beam, 0)pop fitness(sol, 5, beam) = CSng(aStress)

NextgsaObj.Output Init(&H20, "GLOBAL", "A1", Bz posz, 0)For beam = 1 To nrBeams

nr = gsaObj.Output NumElemPos(beam)zzStresPos = gsaObj.Output Extract(beam, 0)pop fitness(sol, 6, beam) = CSng(zzStresPos)

NextgsaObj.Output Init(&H20, "GLOBAL", "A1", Bz negz, 0)For beam = 1 To nrBeams

nr = gsaObj.Output NumElemPos(beam)zzStressNeg = gsaObj.Output Extract(beam, 0)pop fitness(sol, 7, beam) = CSng(zzStressNeg)

Next beamgsaObj.Output Init(&H20, "GLOBAL", "A1", C1, 0)For beam = 1 To nrBeams

nr = gsaObj.Output NumElemPos(beam)stress1 = gsaObj.Output Extract(beam, 0)pop fitness(sol, 8, beam) = CSng(stress1)

Next beamgsaObj.Output Init(&H20, "GLOBAL", "A1", C2, 0)For beam = 1 To nrBeams

nr = gsaObj.Output NumElemPos(beam)stress2 = gsaObj.Output Extract(beam, 0)pop fitness(sol, 9, beam) = CSng(stress2)

Next beam

gsaObj.Delete("results") End Sub

Public Sub rank solutions(ByRef rank() As Integer)

’rank() should be reset every iteration, else wont rank the solutionsDim r As IntegerDim nr As IntegerDim mindisp As DoubleDim sol As Integer

115

Page 134: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX B. GENETIC ALGORITHM

For r = 1 To nrSol - 1mindisp = 0nr = 0For sol = 1 To nrSol - 1

If pop fitness(sol, fitType, 1) > mindisp And rank(sol) = 0 Thenmindisp = pop fitness(sol, fitType, 1)nr = sol

End IfNext solrank(nr) = r

Next r

End Sub

Public Sub create new solution(ByVal mutationStrength As Double, ByVal rank() As Integer, ByValNode1 As Integer, ByVal Node2 As Integer)

Dim u, sol As IntegerDim sumrank As DoubleDim dmsn As Integer

For u = 0 To cp + 1tcp(nrSol, u, 1) = ytcp(nrSol, u, 3) = fixed

Next

sumrank = 0For sol = 1 To nrSol - 1

sumrank = (sumrank + sol ^p)Next solsumrank = (sumrank + mutationStrength ^p)

’determine the ranges of the chancesrange(0) = mutationStrength ^p / sumrankFor sol = 1 To nrSol - 1

range(sol) = range(sol - 1) + rank(sol) ^p / sumrankNext sol

For dmsn = 0 To 2For u = Node1 To Node2

If dmsn = 1 Thentcp(nrSol, u, 1) = y

ElseIf dmsn = 0 ThenDetermineControlPoints(u, dmsn)

ElseIf dmsn = 2 ThenDetermineControlPoints(u, dmsn)

End IfNext

Next dmsn

tcp(nrSol, 1, 0) = xMintcp(nrSol, cp, 0) = xMaxtcp(nrSol, 1, 2) = zMintcp(nrSol, cp, 2) = zMax

’set midcp=xMid

If symm = True ThenIf cpEven = False Then

tcp(nrSol, lastcp, 0) = xMidEnd If

For u = 1 To lastcptcp(sol, cp - (u - 1), 0) = xMax - tcp(sol, u, 0)tcp(sol, cp - (u - 1), 2) = tcp(sol, u, 2)

Next uEnd If

For u = 1 To cpFor dmsn = 0 To 2

tcp(nrSol, u, dmsn) = Math.Round(tcp(nrSol, u, dmsn), 1)

116

Page 135: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

NextNext

’calculate new phantom pointsFor dmsn = 0 To 2

tcp(nrSol, 0, dmsn) = 2 * tcp(nrSol, 1, dmsn) - tcp(nrSol, 2, dmsn)tcp(nrSol, cp + 1, dmsn) = 2 * tcp(nrSol, cp, dmsn) - tcp(nrSol, cp - 1, dmsn)

Next dmsn

End Sub

Sub DetermineControlPoints(ByVal u As Integer, ByVal dmsn As Integer)

’determine mutation or crossoverDim rnd As DoubleDim rnd3 As Double

rnd = create rndNr(0, 1, 2)

If rnd <= range(0) Then

’uniform mutationIf dmsn = 0 Then

determine cpx(u, dmsn)rnd3 = create rndNr(0, 1, 2)tcp(nrSol, u, dmsn) = rnd3 * limit1 + (1 - rnd3) * limit2

ElseIf dmsn = 2 Thentcp(nrSol, u, dmsn) = create rndNr(1, maxHeight, 1)

End If

’nonuniform mutationElseIf rnd > range(0) And rnd <= range(1) Then

tcp(nrSol, u, dmsn) = tcp(1, u, dmsn) + UniMutat()ElseIf rnd > range(1) And rnd <= range(2) Then

tcp(nrSol, u, dmsn) = tcp(2, u, dmsn) + UniMutat()ElseIf rnd > range(2) And rnd <= range(3) Then

tcp(nrSol, u, dmsn) = tcp(3, u, dmsn) + UniMutat()ElseIf rnd > range(3) And rnd <= range(4) Then

tcp(11, u, dmsn) = tcp(4, u, dmsn) + UniMutat()ElseIf rnd > range(4) And rnd <= range(5) Then

tcp(11, u, dmsn) = tcp(5, u, dmsn) + UniMutat()ElseIf rnd > range(5) And rnd <= range(6) Then

tcp(11, u, dmsn) = tcp(6, u, dmsn) + UniMutat()ElseIf rnd > range(6) And rnd <= range(7) Then

tcp(11, u, dmsn) = tcp(7, u, dmsn) + UniMutat()ElseIf rnd > range(7) And rnd <= range(8) Then

tcp(11, u, dmsn) = tcp(8, u, dmsn) + UniMutat()ElseIf rnd > range(8) And rnd <= range(9) Then

tcp(11, u, dmsn) = tcp(9, u, dmsn) + UniMutat()ElseIf rnd > range(9) And rnd <= range(10) Then

tcp(11, u, dmsn) = tcp(10, u, dmsn) + UniMutat()End If

End Sub

Public Shared Function UniMutat() As Single

Dim GausOdd As DoubleDim SIG As Single = 0.1Dim odd As Single

GausOdd = create rndNr(0, 1, 2)

If GausOdd < 0.34 Thenodd = 1 * SIG

ElseIf GausOdd >= 0.34 And GausOdd < 0.68 Thenodd = -1 * SIG

ElseIf GausOdd >= 0.68 And GausOdd < 0.82 Thenodd = 2 * SIG

ElseIf GausOdd >= 0.82 And GausOdd < 0.96 Thenodd = -2 * SIG

ElseIf GausOdd >= 0.96 And GausOdd < 0.98 Thenodd = 3 * SIG

117

Page 136: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX B. GENETIC ALGORITHM

ElseIf GausOdd >= 0.98 And GausOdd < 1 Thenodd = -3 * SIG

End If

UniMutat = odd

End Function

Sub determine cpx(ByVal u As Integer, ByVal dmsn As Integer)

Dim sumrankx As DoubleDim rangex(nrSol) As DoubleDim sol As IntegerDim rnd1 As DoubleDim rnd2 As Double

sumrankx = 1 * (nrSol - 1)rangex(0) = 0

For sol = 1 To nrSolrangex(sol) = rangex(sol - 1) + 1 / sumrankx

Next

rnd1 = create rndNr(0, 1, 3)If rnd1 <= rangex(1) Then

limit1 = tcp(1, u - 1, dmsn)ElseIf rnd1 > rangex(1) And rnd1 <= rangex(2) Then

limit1 = tcp(2, u - 1, dmsn)ElseIf rnd1 > rangex(2) And rnd1 <= rangex(3) Then

limit1 = tcp(3, u - 1, dmsn)ElseIf rnd1 > rangex(3) And rnd1 <= rangex(4) Then

limit1 = tcp(4, u - 1, dmsn)ElseIf rnd1 > rangex(4) And rnd1 <= rangex(5) Then

limit1 = tcp(5, u - 1, dmsn)ElseIf rnd1 > rangex(5) And rnd1 <= rangex(6) Then

limit1 = tcp(6, u - 1, dmsn)ElseIf rnd1 > rangex(6) And rnd1 <= rangex(7) Then

limit1 = tcp(7, u - 1, dmsn)ElseIf rnd1 > rangex(7) And rnd1 <= rangex(8) Then

limit1 = tcp(8, u - 1, dmsn)ElseIf rnd1 > rangex(8) And rnd1 <= rangex(9) Then

limit1 = tcp(9, u - 1, dmsn)ElseIf rnd1 > rangex(9) And rnd1 <= rangex(10) Then

limit1 = tcp(10, u - 1, dmsn)End If

rnd2 = create rndNr(0, 1, 3)If rnd2 <= rangex(1) Then

limit2 = tcp(1, u + 1, dmsn)ElseIf rnd2 > rangex(1) And rnd2 <= rangex(2) Then

limit2 = tcp(2, u + 1, dmsn)ElseIf rnd2 > rangex(2) And rnd2 <= rangex(3) Then

limit2 = tcp(3, u + 1, dmsn)ElseIf rnd2 > rangex(3) And rnd2 <= rangex(4) Then

limit2 = tcp(4, u + 1, dmsn)ElseIf rnd2 > rangex(4) And rnd2 <= rangex(5) Then

limit2 = tcp(5, u + 1, dmsn)ElseIf rnd2 > rangex(5) And rnd2 <= rangex(6) Then

limit2 = tcp(6, u + 1, dmsn)ElseIf rnd2 > rangex(6) And rnd2 <= rangex(7) Then

limit2 = tcp(7, u + 1, dmsn)ElseIf rnd2 > rangex(7) And rnd2 <= rangex(8) Then

limit2 = tcp(8, u + 1, dmsn)ElseIf rnd2 > rangex(8) And rnd2 <= rangex(9) Then

limit2 = tcp(9, u + 1, dmsn)ElseIf rnd2 > rangex(9) And rnd2 <= rangex(10) Then

limit2 = tcp(10, u + 1, dmsn)End If

End Sub

Public Sub replace if better than worst(ByRef totalworst As Integer, ByRef worst replaced As Boolean,ByVal nrControlpoints As Integer)

118

Page 137: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

Dim sol, c, u, node As IntegerDim type, beam As Integer

oSheet2 = DirectCast(oWB.Worksheets(2), Excel.Worksheet)

For u = 1 To cpoSheet2.Cells(nrSol + 1, u) = tcp(nrSol, u, 0)oSheet2.Cells(nrSol + 1, u + cp) = tcp(nrSol, u, 2)

NextoSheet2.Cells(nrSol + 1, cp * 2 + 1) = pop fitness(nrSol, 0, 1)

’determine worst solution sol in populationworst = 0worstValue = 0For sol = 1 To 10

If pop fitness(sol, fitType, 1) > worstValue ThenworstValue = pop fitness(sol, fitType, 1)worst = sol

End IfNext sol

If worst > 0 ThenIf pop fitness(nrSol, fitType, 1) < pop fitness(worst, fitType, 1)Then

totalworst += 1worst replaced = TrueFor c = 0 To 3

For u = 0 To cp + 1tcp(worst, u, c) = tcp(nrSol, u, c)

Next uFor node = 1 To nrNodes

coor(worst, node, c) = coor(nrSol, node, c)Next

Next c

For type = 0 To 9For beam = 1 To nrBeams

pop fitness(worst, type, beam) =pop fitness(nrSol, type, beam)

NextNext

For u = 1 To cpoSheet2.Cells(worst, u) = tcp(nrSol, u, 0)oSheet2.Cells(worst, u + cp) = tcp(nrSol, u, 2)

NextoSheet2.Cells(worst, 2 * cp + 1) = pop fitness(nrSol, 0, 1)

NewGsaSolution = Replace(FileToOpen, ".gwb", " " & nrcontrolpoints& " " & worst & ".gwb")gsaObj.SaveAs(NewGsaSolution)

Elseworst replaced = False

End IfEnd If

’determine new worst solution sol in population worst = 0 worstValue = 0

For sol = 1 To 10If pop fitness(sol, fitType, 1) > worstValue Then

worstValue = pop fitness(sol, fitType, 1)worst = sol

End IfNext sol

’determine best solution in populationbest = 1bestValue = pop fitness(1, fitType, 1)For sol = 1 To 10

If bestValue > pop fitness(sol, fitType, 1) ThenbestValue = pop fitness(sol, fitType, 1)best = sol

End IfNext sol

119

Page 138: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX B. GENETIC ALGORITHM

End Sub

Sub OutputGSAViews()

gsaObj.SaveViewToFile("yElevation 1:100", "PNG")

End Sub

Public Sub writing file(ByVal sol As Integer, ByVal totalWorst AsInteger, ByVal diffOptimum As Double, ByVal ImprovRng As Double, ByVal worst replaced As Boolean,ByVal nrControlpoints As Integer)

Dim ws, fitt, u, beam As Integerws = 1

’get correct worksheetoSheet = DirectCast(oWB.Worksheets(ws), Excel.Worksheet)

If worst replaced = True ThenoSheet.Cells(totalWorst, 1) = iteroSheet.Cells(totalWorst, 2) = bestoSheet.Cells(totalWorst, 3) = bestValueoSheet.Cells(totalWorst, 4) = worstoSheet.Cells(totalWorst, 5) = worstValueoSheet.Cells(totalWorst, 6) = Math.Round(range(0), 2)oSheet.Cells(totalWorst, 7) = diffOptimumoSheet.Cells(totalWorst, 8) = ImprovRng

End If

oSheet.Cells(iter, 9) = pop fitness(nrSol, fitType, 1)If iter = 1 Then

gsaObj.Close()ReleaseGsa()NewGsaSolution = Replace(FileToOpen, ".gwb", " " & nrControlpoints &" " & best & ".gwb"\)gsaObj.Open(NewGsaSolution)OutputGSAViews()

For u = 1 To cpoSheet.Cells(iter, 9 + u) = tcp(sol, u, 0)oSheet.Cells(iter, 9 + u + (cp + 2)) = tcp(sol, u, 2)oSheet.Cells(iter, 9 + u + 2 * (cp + 2)) = tcp(sol, u, 3)

Next

End If

If pop fitness(nrSol, 0, 1) = bestValue Thentotal = total + 1

For u = 1 To cpoSheet.Cells(total, 9 + u) = tcp(sol, u, 0)oSheet.Cells(total, 9 + u + (cp + 2)) = tcp(sol, u, 2)oSheet.Cells(total, 9 + u + 2 * (cp + 2)) = tcp(sol, u, 3)

Next

For fitt = 1 To 2oSheet.Cells(fitt + (total - 1) * nrBeams, 11 + 3 * (cp)) =pop fitness(sol, fitt, 1)

Next

For fitt = 3 To 9For beam = 1 To nrBeams

oSheet.Cells(3 + (total - 1) * (nrBeams + 1) + beam,10 + 3 * (cp)) = beamoSheet.Cells(3 + (total - 1) * (nrBeams + 1) + beam,10 + 3 * (cp) + (fitt - 2)) = pop fitness(sol, fitt, beam)

NextNext fitt

End If

End Sub

120

Page 139: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

End Class

121

Page 140: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer
Page 141: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

Appendix C

Hybrid Algorithm

Option Strict OnImports Excel = Microsoft.Office.Interop.ExcelImports Gsa 8 5

Public Class Form1Public Shared oXL As Excel.ApplicationPublic Shared oWB As Excel.WorkbookPublic Shared oSheet As Excel.WorksheetPublic Shared oRange As Excel.Range

Public Shared spath As String = "E:"Public Shared sfilename As String = "\1.Master ABP SD\1.Master thesis\1.Generative Design\D Script\"Public Shared sFolder As String = "nurbs population\"

’### USER INPUT ####’choose min 3Public Shared cp As Integer = 9’choose "pointLoad" (100kN) or "UDLoad"(1kN/m)Public Shared loadType As String = "UDLoad"’not projected = self weightPublic Shared projected As String = "no"Public Shared symm As Boolean = False’###

Public Shared fitType As Integer = 0Public Shared nrSol As Integer = 11Public Shared fixed As Integer = 1Public Shared y As Integer = 0

Public Shared p As Double = 2

Public Shared cpEven As BooleanPublic Shared lastcp As Integer

Public Shared s As Integer = cp - 1Public Shared nrNodes As Integer = s * 10 + 1Public Shared nrBeams As Integer = s * 10

Public Shared xMin, xMax, zMin, zMax, xUp As DoubleDim maxHeight As Double = 7Public Shared xMid As DoublePublic Shared wMin, wMax As Integer

Public Shared wf(3, 10) As DoublePublic Shared tcp(nrSol + 1, cp + 1, 3) As DoublePublic Shared coor(nrSol + 1, nrNodes, 2) As DoublePublic Shared pop fitness(nrSol + 1, 10, nrBeams) As Double

Public Shared GeneticAlgorithm As BooleanPublic Shared newGeneticSolution As BooleanPublic Shared NoImprovement As Boolean

123

Page 142: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX C. HYBRID ALGORITHM

Dim ImprovementBestValue As DoublePublic Shared limit1, limit2 As DoublePublic Shared range(nrSol) As DoublePublic Shared ImprovRng As DoublePublic Shared Improvement As Double

Public Shared best As IntegerPublic Shared worst As IntegerPublic Shared bestValue As DoublePublic Shared worstValue As Double

Public Shared iter As Integer = 0Public Shared total As Integer = 1Public Shared total LS As Integer = 0

Public Shared SA SE(,,,) As SinglePublic Shared newSolution As BooleanPublic Shared maxStepSize As IntegerDim valueStepSize() As IntegerDim LowestStepSize As IntegerConst pert As Integer = -1Dim LoopExists As Boolean = False

Public Shared myGSAObject As Gsa 8 5.ComAuto

Public Function gsaObj() As Gsa 8 5.ComAuto

Static bExistsAlready As Boolean

If Not bExistsAlready Or myGSAObject Is Nothing ThenmyGSAObject = New ComAutobExistsAlready = True

End If

If Not myGSAObject Is Nothing ThengsaObj = myGSAObject

End If

End Function

Public Sub ReleaseGsa()

myGSAObject = Nothing

End Sub

Sub original()

Dim c, u As Integer

’cpxtcp(0, 1, 0) = 0tcp(0, cp, 0) = 10

’cpztcp(0, 1, 2) = 0tcp(0, cp, 2) = 0

xMin = tcp(0, 1, 0)xMax = tcp(0, cp, 0)zMin = tcp(0, 1, 2)zMax = tcp(0, cp, 2)xMid = (xMin + xMax) / 2

For u = 0 To cp + 1tcp(0, u, 1) = ytcp(0, u, 3) = fixed

Next u

124

Page 143: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

If symm = False ThenxUp = xMaxlastcp = s

ElseIf symm = True ThenxUp = xMid

If Int(cp / 2) * 2 - cp = -1 ThencpEven = Falselastcp = CInt(Int(cp / 2) + 1)Else

cpEven = Truelastcp = CInt(Int(cp / 2))

End If

For u = 1 To lastcptcp(0, cp - (u - 1), 0) = xMax - tcp(0, u, 0)tcp(0, cp - (u - 1), 2) = tcp(0, u, 2)

Next u

End If

For c = 0 To 2tcp(0, 0, c) = 2 * tcp(0, 1, c) - tcp(0, 2, c)tcp(0, cp + 1, c) = 2 * tcp(0, cp, c) - tcp(0, cp - 1, c)

Next c

End Sub

Public Sub control points(ByVal sol As Integer)

Dim c, u As IntegerDim nr, r As IntegerDim high coor As DoubleDim xRnd(lastcp) As Double

Dim rankx(cp) As Integer

For u = 0 To cp + 1tcp(sol, u, 1) = ytcp(sol, u, 3) = 1

Next u

tcp(sol, 1, 0) = xMintcp(sol, cp, 0) = xMaxtcp(sol, 1, 2) = zMintcp(sol, cp, 2) = zMaxtcp(sol, 0, 3) = fixedtcp(sol, 1, 3) = fixedtcp(sol, cp, 3) = fixedtcp(sol, cp + 1, 3) = fixed

For u = 2 To lastcpxRnd(u) = create rndNr(xMin, xUp, 1)tcp(sol, u, 2) = Math.Round(create rndNr(1, maxHeight, 1), 3)

Next u

’arranging the x-coordinates in increasing sequence’however, later should the population be based on the design,and the x-coordinates are allowed to intersect

For r = 2 To lastcphigh coor = xMaxnr = 2For u = 2 To lastcp

If xRnd(u) <= high coor And rankx(u) = 0 Thenhigh coor = xRnd(u)nr = u

End IfNext urankx(nr) = rtcp(sol, r, 0) = xRnd(nr)

Next r

125

Page 144: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX C. HYBRID ALGORITHM

’set lastcp=xMidIf symm = True Then

If cpEven = False Thentcp(sol, lastcp, 0) = xMid

End IfFor u = 1 To lastcp

tcp(sol, cp - (u - 1), 0) = xMax - tcp(sol, u, 0)Next u

End If

’calculate phantom pointsFor c = 0 To 2

tcp(sol, 0, c) = Math.Round(2 * tcp(sol, 1, c) -tcp(sol, 2, c), 3)tcp(sol, cp + 1, c) = Math.Round(2 * tcp(sol, cp, c) -tcp(sol, cp - 1, c), 3)

Next c

End Sub

Sub get nodes gsa(ByVal sol As Integer, ByVal nrcontrolpoints As Integer)

Dim nrNodes1 As IntegerDim node As IntegerDim dmsn As IntegerDim u As IntegergsaObj.Close()

gsaObj.Open(spath & sfilename & sFolder & "solution " & sol & ".gwb")

nrNodes1 = CInt((Val(gsaObj.GwaCommand("HIGHEST,NODE"))))

For node = (nrNodes1 - cp + 1) To nrNodes1For dmsn = 0 To 2

tcp(sol, node - (nrNodes1 - (cp + 1)), dmsn) = CDbl(gsaObj.Arg(dmsn + 2,CStr(gsaObj.GwaCommand("get,node.1," & node))))tcp(sol, node - (nrNodes1 - (cp + 1)), 3) = fixedtcp(sol, node - (nrNodes1 - (cp + 1)), dmsn) =Math.Round(tcp(sol, node - (nrNodes1 - (cp + 1)), dmsn), 4)

NextNext

’use directcast to convert to or from data type ObjectoSheet = DirectCast(oWB.Worksheets(3), Excel.Worksheet)

For u = 1 To cpoSheet.Cells(sol, u) = tcp(sol, u, 0)oSheet.Cells(sol, u + cp) = tcp(sol, u, 2)

Next

End Sub

’if this sub is activated, set option strict to off’Sub get nodes excel(ByVal sol As Integer, ByVal ws As Integer, ByVal row As Integer)

’ Dim u, c As Integer’ oSheet = DirectCast(oWB.Worksheets(ws), Excel.Worksheet)

’ ’turn option strict off to read data from Excel

’ For u = 1 To cp’ tcp(sol, u, 0) = CDbl(oSheet.Cells(row, u + 4).Value)’ tcp(sol, u, 2) = CDbl(oSheet.Cells(row, u + 24).value)’ Next

’ For c = 0 To 2’ tcp(sol, 0, c) = Math.Round(2 * tcp(sol, 1, c) - tcp(sol, 2, c), 3)’ tcp(sol, cp + 1, c) = Math.Round(2 * tcp(sol, cp, c) - tcp(sol, cp - 1, c), 3)’ Next c

126

Page 145: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

’ For u = 0 To cp + 1’ tcp(sol, u, 3) = 1’ Next

’End Sub

Private Sub Button1 Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

gsaObj.Open(spath & sfilename & sFolder & "basis.gwb")’gsaObj.Open(spath & sfilename & sFolder & "basis.gwb")’start Excel and get Application object.oXL = New Excel.Application’set some propertiesoXL.Visible = TrueoXL.DisplayAlerts = False

’open existing workbookoWB = oXL.Workbooks.Add

Dim sol As IntegerDim u As IntegerDim beam As IntegerDim SE As SingleDim nrLoop As Integer’include odds to randomly mutate cps in order to reach global optimumDim mutationStrength As Double = 25 ’ = 62%Dim Crit As Integer = -75 ’%Dim n As Integer = 0

Dim rank(nrSol - 1) As IntegerDim RankValueSolutions(nrSol - 1) As DoubleDim RankNrSolutions(nrSol - 1) As IntegerDim changeBestValue(1) As DoubleDim avrg pop(1) As Double

Dim count As IntegerDim totalWorst As Integer = 1Dim node As IntegerDim Node1, Node2 As Integer

Crit += CInt(Crit / 2 ^n)avrg pop(1) = (0 + 0) / 2

’generate initial model and assign fitnessoriginal()export original(0)

’generate population and assign fitnessoSheet = DirectCast(oWB.Worksheets(3), Excel.Worksheet)

For sol = 1 To nrSol - 1’get nodes gsa(sol)control points(sol)calc nodes(sol, mutationStrength, rank, node, Node1, Node2,totalWorst)calc exp(sol)gsaObj.SaveAs(spath & sfilename & sFolder & "solution " & sol& ".gwb")

SE = 0gsaObj.Analyse()

For beam = 1 To nrBeamsSE += CSng(gsaObj.Arg(3, CStr(gsaObj.GwaCommand("GET,STRAIN ENERGY,"& beam & ",1"))))

Next beamgsaObj.Delete("results")

pop fitness(sol, 0, 1) = SE

For u = 1 To cpoSheet.Cells(sol, u) = tcp(sol, u, 0)oSheet.Cells(sol, u + cp) = tcp(sol, u, 2)

127

Page 146: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX C. HYBRID ALGORITHM

Next

oSheet.Cells(sol, cp * 2 + 1) = pop fitness(sol, 0, 1)Next sol

’start iterationDo

iter += 1GeneticAlgorithm = True

’rankrank solutions(rank, RankValueSolutions, RankNrSolutions)avrg pop(0) = (bestValue + worstValue) / 2

’generate new solution based on evolutionnewGeneticSolution = True

create new solution(mutationStrength, rank, 2, lastcp)calc nodes(nrSol, mutationStrength, rank, node, Node1, Node2,totalWorst)If LoopExists = True Then

Do Until LoopExists = False

If nrLoop <= 10 Thenrelease solution(nrSol, mutationStrength, rank, node,Node1, Node2,totalWorst)nrLoop += 1

ElseIf nrLoop > 10 ThenNode1 = 0create new solution(mutationStrength, rank, 2, lastcp)calc nodes(nrSol, mutationStrength, rank, node, Node1, Node2,totalWorst)nrLoop = 0

End If

Loop

End If

calc exp(nrSol)gsaObj.Analyse()SE = 0

For beam = 1 To nrBeamsSE += CSng(gsaObj.Arg(3, CStr(gsaObj.GwaCommand("GET,STRAIN ENERGY,"& beam & ",1"))))

Next beam

gsaObj.Delete("results")pop fitness(nrSol, 0, 1) = SEwriting file(nrSol, totalWorst)

’improve new solution locallyGeneticAlgorithm = FalseNoImprovement = FalseNode1 = 0

Do

maxStepSize = 6 ’aan begin van iedere nieuwe oplossingweer tot maxStepSize zoeken, zodat ook 0.8m kan!ReDim SA SE(lastcp, 6, 2, 2) ’leegmaken, anders wordter doorgeteldimprove new solution(mutationStrength, rank, node, Node1, Node2,totalWorst)new local solution(sol, mutationStrength, rank, node, Node1,Node2, totalWorst)

Loop Until Improvement > -5 Or NoImprovement = True’loop until trapped in optimum or when improvement < 5%

128

Page 147: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

GeneticAlgorithm = TruenewGeneticSolution = False

’replace if pop fitness(nrSol) < worstValuerank solutions(rank, RankValueSolutions, RankNrSolutions)changeBestValue(0) = bestValuereplace if better than worst(totalWorst)rank solutions(rank, RankValueSolutions, RankNrSolutions)changeBestValue(1) = bestValueImprovementBestValue = (changeBestValue(1) - changeBestValue(0)) /changeBestValue(0) * 100avrg pop(1) = (bestValue + worstValue) / 2

’cumulative improvementImprovRng += (avrg pop(1) - avrg pop(0)) / avrg pop(0) * 100

writing file(best, totalWorst)

If mutationStrength > 10 ThenIf ImprovRng < Crit Then

n += 1Crit += CInt(Crit / 2 ^n)mutationStrength -= 3

End IfEnd If

count += 1

If count = 100 ThenoWB.SaveAs(spath & sfilename & sFolder & "control points " &cp & " .xls")count = 0

End If

Loop Until (ImprovementBestValue < 0 And ImprovementBestValue > -10)

’Save the sheet and closeoSheet = NothingoRange = NothingoWB.SaveAs(spath & sfilename & sFolder & loadType & " " & projected & " " & cp & " localOpt.xls")oWB.Close()oWB = NothingoXL.Quit()

’ Clean up’ NOTE: When in release mode, this does the trickGC.WaitForPendingFinalizers()GC.Collect()GC.WaitForPendingFinalizers()GC.Collect()gsaObj.SaveAs(spath & sfilename & sFolder & "solution " & "sens anal" & iter & ".gwb")gsaObj.Close()ReleaseGsa()

End Sub

Public Shared Function create rndNr(ByVal Lowest As Double, ByValhighest As Double, ByVal decimals As Integer) As Double

Dim randomnumbers As Double

If decimals = 0 ThenRandomize()randomnumbers = Int((highest - Lowest) * Rnd() + Lowest)

ElseRandomize()randomnumbers = Math.Round((highest - Lowest) * Rnd()+ Lowest, decimals)

End If

create rndNr = randomnumbers

End Function

129

Page 148: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX C. HYBRID ALGORITHM

Public Shared Sub setupwf()

Dim a As Integer

For a = 0 To 10Dim t As Doublet = a * 0.1wf(0, a) = (1 / 6) * (1 - 3 * t + 3 * t ^2 - t ^3)wf(1, a) = (1 / 6) * (4 - 6 * t ^2 + 3 * t ^3)wf(2, a) = (1 / 6) * (1 + 3 * t + 3 * t ^2 - 3 * t ^3)wf(3, a) = (1 / 6) * t ^3

Next a

End Sub

Public Sub calc nodes(ByVal sol As Integer, ByVal mutationStrength As Double, ByVal rank() As Integer,ByRef node As Integer, ByVal Node1 As Integer, ByVal Node2 As Integer, ByVal totalworst As Integer)

Dim segment As IntegerDim last As IntegerDim a, b, d As Integer

setupwf()LoopExists = False

If Node1 < 3 Thensegment = 0node = 0

Elsesegment = Node1 - 3node = segment * 10

End If

For b = segment To cp - 2If b = cp - 2 Then

last = 10Else

last = 9End If

For a = 0 To lastFor d = 0 To 2

’Coordinate nodes P(t)=(P i*w i*B n,i)/(B n,i*w i)coor(sol, 1 + a + b * 10, d) =Math.Round((wf(0, a) * tcp(sol, b, d) * tcp(sol, b, 3) +wf(1, a) * tcp(sol, b + 1, d) * tcp(sol, b + 1, 3) +wf(2, a) * tcp(sol, b + 2, d) * tcp(sol, b + 2, 3) +wf(3, a) * tcp(sol, b + 3, d) * tcp(sol, b + 3, 3)) /(wf(0, a) * tcp(sol, b, 3) +wf(1, a) * tcp(sol, b + 1, 3) +wf(2, a) * tcp(sol, b + 2, 3) +wf(3, a) * tcp(sol, b + 3, 3)), 3)

Next dnode += 1ChkIntersection(sol, mutationStrength, rank, node, Node1, Node2,segment, totalworst)

If LoopExists = True ThenExit Sub

End If

Next aNext b

End Sub

130

Page 149: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

Sub ChkIntersection(ByVal sol As Integer, ByVal node As Integer, ByVal iter As Integer, ByValdiffOptimum As Single)

’disallow intersections of polygonal edgesDim gradient(node) As DoubleDim b(nrBeams) As DoubleDim beam As IntegerDim intersection As DoubleDim lowx, upx As DoubleDim low1x, up1x As Double

If node >= 2 ThenIf coor(sol, node, 0) = coor(sol, node - 1, 0)And coor(sol, node, 2) = coor(sol, node - 1, 2) Then

LoopExists = TrueExit Sub

End IfEnd If

If node >= 4 Thengradient(0) = (coor(sol, node, 2) - coor(sol, node - 1, 2)) /(coor(sol, node, 0) - coor(sol, node - 1, 0))b(0) = coor(sol, node, 2) - (gradient(0) * coor(sol, node, 0))’segment boundaries of last segmentIf coor(sol, node, 0) < coor(sol, node - 1, 0) Then

lowx = coor(sol, node, 0)upx = coor(sol, node - 1, 0)

Elselowx = coor(sol, node - 1, 0)upx = coor(sol, node, 0)

End If

For beam = 1 To node - 3gradient(beam) = Math.Round((coor(sol, beam + 1, 2) -coor(sol, beam, 2)) /(coor(sol, beam + 1, 0) - coor(sol, beam, 0)), 5)b(beam) = Math.Round(coor(sol, beam, 2) - (gradient(beam) *coor(sol, beam, 0)), 5)

Next

For beam = 1 To node - 3’if both lines are not parallel, intersection could occurIf gradient(beam) <> gradient(0) Then’segment boundaries of segment to be checked

If coor(sol, beam, 0) < coor(sol, beam + 1, 0) Thenlow1x = coor(sol, beam, 0)up1x = coor(sol, beam + 1, 0)

Elselow1x = coor(sol, beam + 1, 0)up1x = coor(sol, beam, 0)

End Ifintersection = (b(beam) - b(0)) / (gradient(0) -gradient(beam))’if intersection is in both x-interval-->determine new cpsIf intersection >= lowx And intersection <= upx And

intersection >= low1x And intersection <= up1x ThenLoopExists = TrueExit Sub

End IfEnd If

NextEnd If

End Sub

Sub release solution(ByVal sol As Integer, ByVal mutationStrength As Double, ByVal rank() As Integer,ByVal node As Integer, ByRef Node1 As Integer, ByRef Node2 As Integer, ByVal totalworst As Integer)

Dim u, dmsn As Integer

If GeneticAlgorithm = True Then

If iter > 0 Then

131

Page 150: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX C. HYBRID ALGORITHM

Node1 = CInt(Int(node / 10))

If Node1 > lastcp ThenNode1 = lastcp - (Node1 - lastcp)

End If

Node2 = Node1 + 3

If Node2 > lastcp ThenNode2 = lastcp

End If

create new solution(mutationStrength, rank, Node1, Node2)calc nodes(sol, mutationStrength, rank, node, Node1, Node2,totalworst)Exit Sub

Elsecontrol points(sol)calc nodes(sol, mutationStrength, rank, node, Node1, Node2,totalworst)Exit Sub

End If

ElseIf GeneticAlgorithm = False Then

If newSolution = False Then

For u = 0 To cp + 1For dmsn = 0 To 3

tcp(nrSol + 1, u, dmsn) = tcp(nrSol, u, dmsn)Next

Next

Exit SubElseIf newSolution = True Then

If maxStepSize > 0 ThenLowestStepSize -= 1If maxStepSize > LowestStepSize Then

maxStepSize = LowestStepSizeElse

maxStepSize -= 1End Ifnew local solution(sol, mutationStrength, rank, node, Node1,Node2, totalworst)Exit Sub

ElseNoImprovement = TrueFor u = 0 To cp + 1

For dmsn = 0 To 3tcp(nrSol + 1, u, dmsn) = tcp(nrSol, u, dmsn)

NextNextpop fitness(nrSol + 1, 0, 1) = pop fitness(nrSol, 0, 1)replace if better(sol, mutationStrength, rank, node, Node1,Node2, iter,total, totalworst)Exit Sub

End IfEnd If

End If

End Sub

Public Sub calc exp(ByVal sol As Integer)

Dim u As IntegerDim nodeNr As IntegerDim nodeNumb As IntegerDim x, y, z As StringDim cpNr As IntegerDim posBeam As DoubleDim ELNr As Integer

132

Page 151: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

Dim posLoad As Double = xMid

For nodeNumb = 1 To nrNodes - 2nodeNr = 0nodeNr = nodeNumb + 1x = CStr(coor(sol, nodeNr, 0))y = CStr(0)z = CStr(coor(sol, nodeNr, 2))gsaObj.GwaCommand("SET,NODE.1," & nodeNr & "," &

x & "," &y & "," &z & ",GLOBAL,0,1,0,1,0,1")Next

If loadType = "pointLoad" ThenIf symm = False Then

FornodeNumb = 1 To nrNodes - 1If coor(sol, nodeNumb, 0) <= posLoad And coor(sol,nodeNumb + 1, 0) >= posLoad Then

posBeam = posLoad - coor(sol, nodeNumb, 0)ELNr = nodeNumbEnd If

Next nodeNumb

gsaObj.GwaCommand("DELETE,LOAD BEAM,1")gsaObj.GwaCommand("SET,LOAD BEAM POINT," & ELNr & ",1,GLOBAL,NO,Z,+" & posBeam & ",-100")

ElseIf symm = True ThenELNr = CInt((s * 10) / 2 + 1)gsaObj.GwaCommand("DELETE,LOAD NODE,1")gsaObj.GwaCommand("SET,LOAD NODE," & ELNr & ",1,GLOBAl,z,-100")

End IfEnd If

For u = 0 To cp + 1cpNr = nrNodescpNr = nrNodes + u + 1x = CStr(tcp(sol, u, 0))y = CStr(0)z = CStr(tcp(sol, u, 2))gsaObj.GwaCommand("SET,NODE.1," & cpNr & "," &

x & "," &y & "," &z & ",GLOBAL")Next u

End Sub

Public Sub export original(ByVal sol As Integer)

Dim beam As IntegerDim beamNr As IntegerDim topo1, topo2 As IntegerDim x, y, z As String

x = CStr(xMin)y = CStr(0)z = CStr(zMin)

gsaObj.GwaCommand("SET,NODE.1,1," &x & "," &y & "," &z & ",GLOBAL,1,1,1,1,0,1")

x = CStr(xMax)y = CStr(0)z = CStr(zMax)

gsaObj.GwaCommand("SET,NODE.1," & nrNodes & "," &x & "," &y & "," &z & ",GLOBAL,1,1,1,1,0,1")

133

Page 152: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX C. HYBRID ALGORITHM

For beam = 0 To nrBeams - 1beamNr = 0beamNr = beam + 1topo1 = beamNrtopo2 = topo1 + 1gsaObj.GwaCommand("SET,EL BEAM," & beamNr & ",1,1," & topo1& "," & topo2 & ",0,90")

Next beam

If loadType = "UDLoad" ThengsaObj.GwaCommand("DELETE,LOAD BEAM UDL,1")gsaObj.GwaCommand("SET,LOAD BEAM UDL,ALL,1,GLOBAL," & projected & ",Z,-1")

End If

End Sub

Sub fitness(ByVal sol As Integer)

Dim beam As IntegerDim SE As StringDim totalSE As SingleDim nr As IntegerDim A As Integer = 14003001 ’menbrane stressDim Bz posz As Integer = 14003006 ’bending stressDim Bz negz As Integer = 14003007Dim C1 As Integer = 14003008Dim C2 As Integer = 14003009

gsaObj.Analyse()

totalSE = 0

For beam = 1 To nrBeamsSE = gsaObj.Arg(3, CStr(gsaObj.GwaCommand("GET,STRAIN ENERGY,"& beam & ",1")))’fitnesstotalSE = totalSE + CSng(SE)

Next beam

pop fitness(sol, 0, 1) = totalSEDim Fr x, Fr z, Ax, Mzz As StringDim aStress, zzStresPos, zzStressNeg, stress1, stress2 As ObjectFr x = gsaObj.Arg(3, CStr(gsaObj.GwaCommand("GET,REACT FORCE,1,1")))Fr z = gsaObj.Arg(5, CStr(gsaObj.GwaCommand("GET,REACT FORCE,1,1")))pop fitness(sol, 1, 1) = CSng(Fr x)pop fitness(sol, 2, 1) = CSng(Fr z)

For beam = 1 To nrBeamsAx = gsaObj.Arg(4, CStr(gsaObj.GwaCommand("GET,FORCE 1D," & beam& ",1,0")))Mzz = gsaObj.Arg(6, CStr(gsaObj.GwaCommand("get,moment 1d," & beam& ",1,0")))pop fitness(sol, 3, beam) = CSng(Ax)pop fitness(sol, 4, beam) = CSng(Mzz)

NextgsaObj.Output Init(&H20, "GLOBAL", "A1", A, 0)For beam = 1 To nrBeams

nr = gsaObj.Output NumElemPos(beam)aStress = gsaObj.Output Extract(beam, 0)pop fitness(sol, 5, beam) = CSng(aStress)

NextgsaObj.Output Init(&H20, "GLOBAL", "A1", Bz posz, 0)For beam = 1 To nrBeams

nr = gsaObj.Output NumElemPos(beam)zzStresPos = gsaObj.Output Extract(beam, 0)pop fitness(sol, 6, beam) = CSng(zzStresPos)

NextgsaObj.Output Init(&H20, "GLOBAL", "A1", Bz negz, 0)For beam = 1 To nrBeams

nr = gsaObj.Output NumElemPos(beam)zzStressNeg = gsaObj.Output Extract(beam, 0)pop fitness(sol, 7, beam) = CSng(zzStressNeg)

134

Page 153: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

Next beamgsaObj.Output Init(&H20, "GLOBAL", "A1", C1, 0)For beam = 1 To nrBeams

nr = gsaObj.Output NumElemPos(beam)stress1 = gsaObj.Output Extract(beam, 0)pop fitness(sol, 8, beam) = CSng(stress1)

Next beamgsaObj.Output Init(&H20, "GLOBAL", "A1", C2, 0)For beam = 1 To nrBeams

nr = gsaObj.Output NumElemPos(beam)stress2 = gsaObj.Output Extract(beam, 0)pop fitness(sol, 9, beam) = CSng(stress2)

Next beam

gsaObj.Delete("results") End Sub

Public Sub rank solutions(ByRef rank() As Integer, ByRefRankValueSolutions() As Double, ByRef RankNrSolutions() As Integer)

’rank() should be reset every iteration, else wont rank the solutionsDim r As IntegerDim nr As IntegerDim mindisp As DoubleDim sol As IntegerReDim rank(nrSol - 1)ReDim RankValueSolutions(nrSol - 1)ReDim RankNrSolutions(nrSol - 1)

For r = 1 To nrSol - 1mindisp = 0nr = 0For sol = 1 To nrSol - 1

If pop fitness(sol, fitType, 1) > mindisp And rank(sol) = 0 Thenmindisp = pop fitness(sol, fitType, 1)nr = solRankValueSolutions(r) = mindispRankNrSolutions(r) = sol

End IfNext solrank(nr) = r

Next r

bestValue = RankValueSolutions(nrSol - 1)best = RankNrSolutions(nrSol - 1)worstValue = RankValueSolutions(1)worst = RankNrSolutions(1)

End Sub

Public Sub create new solution(ByVal mutationStrength As Double, ByVal rank() As Integer, ByValNode1 As Integer, ByVal Node2 As Integer)

Dim u, sol As IntegerDim sumrank As DoubleDim dmsn As IntegerDim rnd3 As Double’determine mutation or crossoverDim rnd As Double

For u = 0 To cp + 1tcp(nrSol, u, 1) = ytcp(nrSol, u, 3) = fixed

Next

sumrank = 0For sol = 1 To nrSol - 1

sumrank = (sumrank + sol ^p)Next solsumrank = (sumrank + mutationStrength ^p)

’determine the ranges of the chances

135

Page 154: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX C. HYBRID ALGORITHM

range(0) = mutationStrength ^p / sumrankFor sol = 1 To nrSol - 1

range(sol) = range(sol - 1) + rank(sol) ^p / sumrankNext sol

For dmsn = 0 To 2For u = Node1 To Node2

If dmsn = 1 Thentcp(nrSol, u, 1) = y

ElseIf dmsn = 0 Or dmsn = 2 Thenrnd = create rndNr(0, 1, 2)

If rnd <= range(0) Then

’uniform mutationIf dmsn = 0 Then

determine cpx(u, dmsn)rnd3 = create rndNr(0, 1, 2)tcp(nrSol, u, dmsn) = rnd3 * limit1 + (1 - rnd3) *limit2

ElseIf dmsn = 2 Thentcp(nrSol, u, dmsn) = create rndNr(1, maxHeight, 1)

End If

’nonuniform mutationElseIf rnd > range(0) And rnd <= range(1) Then

tcp(nrSol, u, dmsn) = tcp(1, u, dmsn) + UniMutat()ElseIf rnd > range(1) And rnd <= range(2) Then

tcp(nrSol, u, dmsn) = tcp(2, u, dmsn) + UniMutat()ElseIf rnd > range(2) And rnd <= range(3) Then

tcp(nrSol, u, dmsn) = tcp(3, u, dmsn) + UniMutat()ElseIf rnd > range(3) And rnd <= range(4) Then

tcp(11, u, dmsn) = tcp(4, u, dmsn) + UniMutat()ElseIf rnd > range(4) And rnd <= range(5) Then

tcp(11, u, dmsn) = tcp(5, u, dmsn) + UniMutat()ElseIf rnd > range(5) And rnd <= range(6) Then

tcp(11, u, dmsn) = tcp(6, u, dmsn) + UniMutat()ElseIf rnd > range(6) And rnd <= range(7) Then

tcp(11, u, dmsn) = tcp(7, u, dmsn) + UniMutat()ElseIf rnd > range(7) And rnd <= range(8) Then

tcp(11, u, dmsn) = tcp(8, u, dmsn) + UniMutat()ElseIf rnd > range(8) And rnd <= range(9) Then

tcp(11, u, dmsn) = tcp(9, u, dmsn) + UniMutat()ElseIf rnd > range(9) And rnd <= range(10) Then

tcp(11, u, dmsn) = tcp(10, u, dmsn) + UniMutat()End If

End IfNext

Next dmsn

tcp(nrSol, 1, 0) = xMintcp(nrSol, cp, 0) = xMaxtcp(nrSol, 1, 2) = zMintcp(nrSol, cp, 2) = zMax

’set midcp=xMid

If symm = True ThenIf cpEven = False Then

tcp(nrSol, lastcp, 0) = xMidEnd If

For u = 1 To lastcptcp(sol, cp - (u - 1), 0) = xMax - tcp(sol, u, 0)tcp(sol, cp - (u - 1), 2) = tcp(sol, u, 2)

Next uEnd If

For u = 1 To cpFor dmsn = 0 To 2

tcp(nrSol, u, dmsn) = Math.Round(tcp(nrSol, u, dmsn), 1)Next

Next

136

Page 155: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

’calculate new phantom pointsFor dmsn = 0 To 2

tcp(nrSol, 0, dmsn) = 2 * tcp(nrSol, 1, dmsn) - tcp(nrSol, 2, dmsn)tcp(nrSol, cp + 1, dmsn) = 2 * tcp(nrSol, cp, dmsn) -tcp(nrSol, cp - 1, dmsn)

Next dmsn

End Sub

Public Shared Function UniMutat() As Single

Dim GausOdd As DoubleDim SIG As Single = 0.1Dim odd As Single

GausOdd = create rndNr(0, 1, 2)

If GausOdd < 0.34 Thenodd = 1 * SIG

ElseIf GausOdd >= 0.34 And GausOdd < 0.68 Thenodd = -1 * SIG

ElseIf GausOdd >= 0.68 And GausOdd < 0.82 Thenodd = 2 * SIG

ElseIf GausOdd >= 0.82 And GausOdd < 0.96 Thenodd = -2 * SIG

ElseIf GausOdd >= 0.96 And GausOdd < 0.98 Thenodd = 3 * SIG

ElseIf GausOdd >= 0.98 And GausOdd < 1 Thenodd = -3 * SIG

End If

UniMutat = odd

End Function

Sub determine cpx(ByVal u As Integer, ByVal dmsn As Integer)

Dim sumrankx As DoubleDim rangex(nrSol) As DoubleDim sol As IntegerDim rnd1 As DoubleDim rnd2 As Double

sumrankx = 1 * (nrSol - 1)rangex(0) = 0

For sol = 1 To nrSolrangex(sol) = rangex(sol - 1) + 1 / sumrankx

Next

rnd1 = create rndNr(0, 1, 3)If rnd1 <= rangex(1) Then

limit1 = tcp(1, u - 1, dmsn)ElseIf rnd1 > rangex(1) And rnd1 <= rangex(2) Then

limit1 = tcp(2, u - 1, dmsn)ElseIf rnd1 > rangex(2) And rnd1 <= rangex(3) Then

limit1 = tcp(3, u - 1, dmsn)ElseIf rnd1 > rangex(3) And rnd1 <= rangex(4) Then

limit1 = tcp(4, u - 1, dmsn)ElseIf rnd1 > rangex(4) And rnd1 <= rangex(5) Then

limit1 = tcp(5, u - 1, dmsn)ElseIf rnd1 > rangex(5) And rnd1 <= rangex(6) Then

limit1 = tcp(6, u - 1, dmsn)ElseIf rnd1 > rangex(6) And rnd1 <= rangex(7) Then

limit1 = tcp(7, u - 1, dmsn)ElseIf rnd1 > rangex(7) And rnd1 <= rangex(8) Then

limit1 = tcp(8, u - 1, dmsn)ElseIf rnd1 > rangex(8) And rnd1 <= rangex(9) Then

limit1 = tcp(9, u - 1, dmsn)ElseIf rnd1 > rangex(9) And rnd1 <= rangex(10) Then

limit1 = tcp(10, u - 1, dmsn)End If

137

Page 156: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX C. HYBRID ALGORITHM

rnd2 = create rndNr(0, 1, 3)If rnd2 <= rangex(1) Then

limit2 = tcp(1, u + 1, dmsn)ElseIf rnd2 > rangex(1) And rnd2 <= rangex(2) Then

limit2 = tcp(2, u + 1, dmsn)ElseIf rnd2 > rangex(2) And rnd2 <= rangex(3) Then

limit2 = tcp(3, u + 1, dmsn)ElseIf rnd2 > rangex(3) And rnd2 <= rangex(4) Then

limit2 = tcp(4, u + 1, dmsn)ElseIf rnd2 > rangex(4) And rnd2 <= rangex(5) Then

limit2 = tcp(5, u + 1, dmsn)ElseIf rnd2 > rangex(5) And rnd2 <= rangex(6) Then

limit2 = tcp(6, u + 1, dmsn)ElseIf rnd2 > rangex(6) And rnd2 <= rangex(7) Then

limit2 = tcp(7, u + 1, dmsn)ElseIf rnd2 > rangex(7) And rnd2 <= rangex(8) Then

limit2 = tcp(8, u + 1, dmsn)ElseIf rnd2 > rangex(8) And rnd2 <= rangex(9) Then

limit2 = tcp(9, u + 1, dmsn)ElseIf rnd2 > rangex(9) And rnd2 <= rangex(10) Then

limit2 = tcp(10, u + 1, dmsn)End If

End Sub

Sub improve new solution(ByVal mutationStrength As Double, ByVal rank() As Integer, ByVal nodeAs Integer, ByVal Node1 As Integer, ByVal Node2 As Integer, ByVal totalworst As Integer)

Dim u, uu As IntegerDim dmsn As IntegerDim stepsize As Single

Dim pert0, pert2 As IntegerDim mutation0, mutation2 As SingleDim increaseStepSize As Integer

Dim beam As Integer

’appply mutation per node

For u = 2 To lastcpFor increaseStepSize = 0 To maxStepSize

For pert0 = 0 To 2For pert2 = 0 To 2

newSolution = Falsestepsize = 80stepsize = CSng(stepsize / (2 ^increaseStepSize))

’copy initial geometryFor uu = 0 To cp + 1

For dmsn = 0 To 3tcp(nrSol + 1, uu, dmsn) = tcp(nrSol, uu, dmsn)

NextNext

’apply perturbation, analyse each modification andput in arrayIf pert0 >= 1 Then

mutation0 = CSng((pert ^pert0) / stepsize)ElseIf pert0 = 0 Then

mutation0 = 0End IfIf pert2 >= 1 Then

mutation2 = CSng((pert ^pert2) / stepsize)ElseIf pert2 = 0 Then

mutation2 = 0End If

tcp(nrSol + 1, u, 0) += mutation0tcp(nrSol + 1, u, 2) += mutation2

’if mutation is reset, then pert0 and pert2 are notreset.

138

Page 157: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

’the corresponding E s is equal to the initialgeometry,’implying this solution will never be chosen.’hence, pert0 and pert2 can be used to determine thefinal geometry.

’calculate accompanying phantom nodesFor dmsn = 0 To 2

tcp(nrSol + 1, 0, dmsn) = 2 * tcp(nrSol + 1, 1, dmsn)- tcp(nrSol + 1, 2, dmsn)tcp(nrSol + 1, cp + 1, dmsn) =2 * tcp(nrSol + 1, cp, dmsn) -tcp(nrSol + 1, cp - 1, dmsn)

Next

For uu = 0 To cp + 1For dmsn = 0 To 3

tcp(nrSol + 1, uu, dmsn) =CSng(Math.Round(tcp(nrSol + 1, uu, dmsn), 4))

NextNext

calc nodes(nrSol + 1, mutationStrength, rank, node,Node1, Node2, totalworst)

If LoopExists = True Thenrelease solution(nrSol + 1, mutationStrength, rank,node, Node1, Node2, totalworst)SA SE(u, increaseStepSize, pert0, pert2)CSng(pop fitness(nrSol, 0, 1))

ElseIf LoopExists = False Thencalc exp(nrSol + 1)gsaObj.Analyse()For beam = 1 To nrBeams

SA SE(u, increaseStepSize, pert0, pert2) +=CSng(gsaObj.Arg(3, CStr(gsaObj.GwaCommand("GET,STRAIN ENERGY," & beam & ",1"))))

Next beamgsaObj.Delete("results")End If

Next pert2Next pert0

Next increaseStepSizeNext u

End Sub

Sub new local solution(ByVal sol As Integer, ByVal mutationStrength As Double, ByVal rank() AsInteger, ByVal node As Integer, ByVal Node1 As Integer, ByVal Node2 As Integer, ByVal totalworstAs Integer)

’modify the variable that yield the most improvementDim u As IntegerDim dmsn As IntegerDim pert0, pert2 As IntegerDim strainEnergy As SingleReDim valueStepSize(lastcp)Dim lowestStrainEnergy(lastcp) As SingleDim pert0 (lastcp), pert2 (lastcp) As IntegerDim increaseStepSize As IntegerDim stepsize As Single

newSolution = True

’voor u kijken wat richting het beste is geweest, en welke stapgrootte daarbij hoort

For u = 2 To lastcpstrainEnergy = 9999999999For increaseStepSize = 0 To maxStepSize

For pert0 = 0 To 2For pert2 = 0 To 2

If SA SE(u, increaseStepSize, pert0, pert2) <

139

Page 158: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX C. HYBRID ALGORITHM

strainEnergy ThenstrainEnergy = SA SE(u, increaseStepSize, pert0, pert2)pert0 (u) = pert0pert2 (u) = pert2valueStepSize(u) = increaseStepSizelowestStrainEnergy(u) = strainEnergy

End IfNext

NextNext

Next

’copy initial geometryFor u = 0 To cp + 1

For dmsn = 0 To 3tcp(nrSol + 1, u, dmsn) = tcp(nrSol, u, dmsn)

NextNext

’NOTE even if pert0 or pert2=0, to the power yields 1For u = 2 To lastcp

stepsize = 80stepsize = CSng(stepsize / (2 ^valueStepSize(u)))If pert0 (u) <> 0 Then

tcp(nrSol + 1, u, 0) += CSng((pert ^pert0 (u)) / stepsize)End IfIf pert2 (u) <> 0 Then

tcp(nrSol + 1, u, 2) += CSng((pert ^pert2 (u)) / stepsize)End If

Next

’calculate new phantom nodesFor dmsn = 0 To 2

tcp(nrSol + 1, 0, dmsn) = 2 * tcp(nrSol + 1, 1, dmsn) -tcp(nrSol + 1, 2, dmsn)tcp(nrSol + 1, cp + 1, dmsn) = 2 * tcp(nrSol + 1, cp, dmsn) -tcp(nrSol + 1, cp - 1,dmsn)

Next

For u = 0 To cp + 1For dmsn = 0 To 3

tcp(nrSol + 1, u, dmsn) =CSng(Math.Round(tcp(nrSol + 1, u, dmsn), 4))

NextNext

’analyse new modified solutioncalc nodes(nrSol + 1, mutationStrength, rank, node, Node1, Node2,totalworst)If LoopExists = True Then

LowestStepSize = 0For u = 0 To lastcp

If valueStepSize(u) > LowestStepSize ThenLowestStepSize = valueStepSize(u)

End IfNextrelease solution(sol, mutationStrength, rank, node, Node1, Node2,totalworst)

ElseIf LoopExists = False Thencalc exp(nrSol + 1)fitness(nrSol + 1)replace if better(sol, mutationStrength, rank, node, Node1, Node2,iter, total, totalworst)

End If

End Sub

Sub replace if better(ByVal sol As Integer, ByVal mutationStrength As Double, ByVal rank() As Integer,ByVal node As Integer, ByVal Node1 As Integer, ByVal Node2 As Integer, ByRef iter As Integer,ByRef total As Integer, ByVal totalworst As Integer)

Dim u As IntegerDim dmsn As Integer

140

Page 159: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

Dim fittype As IntegerDim beam As Integer

’replace solution if modified one is better

If pop fitness(nrSol + 1, 0, 1) < pop fitness(nrSol, 0, 1) ThenImprovement = (pop fitness(nrSol + 1, 0, 1) - pop fitness(nrSol, 0, 1)) /pop fitness(nrSol, 0, 1) * 100For u = 0 To cp + 1

For dmsn = 0 To 3tcp(nrSol, u, dmsn) = tcp(nrSol + 1, u, dmsn)

NextNextFor fittype = 0 To 9

For beam = 1 To nrBeamspop fitness(nrSol, fittype, beam)= pop fitness(nrSol + 1, fittype, beam)

NextNextwriting file(nrSol + 1, totalworst)

ElseIf maxStepSize > 0 Then

LowestStepSize = 0For u = 0 To lastcp

If valueStepSize(u) > LowestStepSize ThenLowestStepSize = valueStepSize(u)

End IfNextLowestStepSize -= 1If maxStepSize > LowestStepSize Then

maxStepSize = LowestStepSizeElse

maxStepSize -= 1End Ifnew local solution(sol, mutationStrength, rank, node, Node1,Node2, totalworst)

ElseNoImprovement = TrueImprovement = (pop fitness(nrSol + 1, 0, 1) -pop fitness(nrSol, 0, 1)) /pop fitness(nrSol, 0, 1) * 100

End IfEnd If

End Sub

Public Sub replace if better than worst(ByRef totalworst As Integer)

If pop fitness(nrSol, fitType, 1) < pop fitness(worst, fitType, 1)Then

Dim dmsn, u, node As IntegerDim type, beam As IntegerDim ws As Integerws = 3oSheet = DirectCast(oWB.Worksheets(ws), Excel.Worksheet)totalworst += 1

For dmsn = 0 To 2For u = 0 To cp + 1

tcp(worst, u, dmsn) = tcp(nrSol, u, dmsn)Next uFor node = 1 To nrNodes

coor(worst, node, dmsn) = coor(nrSol, node, dmsn)Next

Next dmsn

For type = 0 To 9For beam = 1 To nrBeams

pop fitness(worst, type, beam) =pop fitness(nrSol, type, beam)

NextNext

For u = 1 To cp

141

Page 160: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX C. HYBRID ALGORITHM

oSheet.Cells(worst, u) = tcp(nrSol, u, 0)oSheet.Cells(worst, u + cp) = tcp(nrSol, u, 2)

Next

oSheet.Cells(worst, 2 * cp + 1) = pop fitness(nrSol, 0, 1)gsaObj.SaveAs(spath & sfilename & sFolder & "solution " & worst& ".gwb")

If pop fitness(nrSol, fitType, 1) = bestValue ThengsaObj.Close()ReleaseGsa()gsaObj.Open(spath & sfilename & sFolder & "solution " & best& ".gwb")OutputGSAViews()

End If

End If

End Sub

Sub OutputGSAViews()

gsaObj.SaveViewToFile("yElevation 1:200", "PNG")

End Sub

Public Sub writing file(ByVal sol As Integer, ByVal totalWorst AsInteger)

Dim ws, fitt, u, beam As Integer

If GeneticAlgorithm = True Then

ws = 1oSheet = DirectCast(oWB.Worksheets(ws), Excel.Worksheet)

oSheet.Cells(totalWorst, 1) = iteroSheet.Cells(totalWorst, 2) = bestoSheet.Cells(totalWorst, 3) = bestValueoSheet.Cells(totalWorst, 4) = worstoSheet.Cells(totalWorst, 5) = worstValueoSheet.Cells(totalWorst, 6) = range(0)oSheet.Cells(totalWorst, 7) = ImprovementBestValue ’diffOptimumoSheet.Cells(totalWorst, 8) = ImprovRng

oSheet.Cells(iter, 9) = pop fitness(nrSol, fitType, 1)

If pop fitness(nrSol + 1, 0, 1) = bestValue Thentotal += 1For u = 1 To cp

oSheet.Cells(total, 9 + u) = tcp(sol, u, 0)oSheet.Cells(total, 9 + u + (cp + 2)) = tcp(sol, u, 2)oSheet.Cells(total, 9 + u + 2 * (cp + 2)) = tcp(sol, u, 3)

Next

For fitt = 1 To 2oSheet.Cells(fitt + (total - 1) * nrBeams, 11 + 3 * (cp))

= pop fitness(sol, fitt, 1)NextFor fitt = 3 To 9

For beam = 1 To nrBeamsoSheet.Cells(3 + (total - 1) * (nrBeams + 1) + beam,10 + 3 * (cp)) = beamoSheet.Cells(3 + (total - 1) * (nrBeams + 1) + beam,10 + 3 * (cp) + (fitt - 2)) = pop fitness(sol, fitt, beam)

NextNext fittOutputGSAViews()

End If

ws = 3oSheet = DirectCast(oWB.Worksheets(ws), Excel.Worksheet)

142

Page 161: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

For u = 1 To cpoSheet.Cells(nrSol + 1, u) = tcp(nrSol, u, 0)oSheet.Cells(nrSol + 1, u + cp) = tcp(nrSol, u, 2)

NextoSheet.Cells(nrSol + 1, cp * 2 + 1) = pop fitness(nrSol, 0, 1)

If newGeneticSolution = True Then

If iter = 1 ThengsaObj.Close()ReleaseGsa()gsaObj.Open(spath & sfilename & sFolder & "solution " & best &".gwb")OutputGSAViews()

ws = 1oSheet = DirectCast(oWB.Worksheets(ws), Excel.Worksheet)

For u = 1 To cpoSheet.Cells(iter, 9 + u) = tcp(best, u, 0)oSheet.Cells(iter, 9 + u + (cp + 2)) = tcp(best, u, 2)oSheet.Cells(iter, 9 + u + 2 * (cp + 2)) = tcp(best, u, 3)

NextEnd If

ws = 3oSheet = DirectCast(oWB.Worksheets(ws), Excel.Worksheet)For u = 1 To cp

oSheet.Cells(nrSol + 1, u) = tcp(nrSol, u, 0)oSheet.Cells(nrSol + 1, u + cp) = tcp(nrSol, u, 2)

NextoSheet.Cells(nrSol + 1, cp * 2 + 1) = pop fitness(nrSol, 0, 1)

’get correct worksheetws = 2oSheet = DirectCast(oWB.Worksheets(ws), Excel.Worksheet)

total LS += 1

oSheet.Cells(total LS, 1) = iteroSheet.Cells(total LS, 2) = pop fitness(sol, fitType, 1)oSheet.Cells(total LS, 3) = Improvement

For u = 0 To cp + 1oSheet.Cells(total LS, 4 + u) = tcp(sol, u, 0)oSheet.Cells(total LS, 4 + u + (cp + 2)) = tcp(sol, u, 2)oSheet.Cells(total LS, 4 + u + 2 * (cp + 2)) = tcp(sol, u, 3)

Next

End If

ElseIf GeneticAlgorithm = False Then

’get correct worksheetws = 2oSheet = DirectCast(oWB.Worksheets(ws), Excel.Worksheet)

total LS += 1

oSheet.Cells(total LS, 1) = iteroSheet.Cells(total LS, 2) = pop fitness(sol, fitType, 1)oSheet.Cells(total LS, 3) = Improvement

Foru = 0 To cp + 1oSheet.Cells(total LS, 4 + u) = tcp(sol, u, 0)oSheet.Cells(total LS, 4 + u + (cp + 2)) = tcp(sol, u, 2)oSheet.Cells(total LS, 4 + u + 2 * (cp + 2)) = tcp(sol, u, 3)

Next

For fitt = 1 To 2oSheet.Cells(fitt + (total LS - 1) * nrBeams, 11 + 3 * (cp + 2))= pop fitness(sol, fitt, 1)

143

Page 162: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX C. HYBRID ALGORITHM

Next

For fitt = 3 To 9For beam = 1 To nrBeams

oSheet.Cells(3 + (total LS - 1) * (nrBeams + 1) + beam,10 + 3 * (cp + 2)) = beamoSheet.Cells(3 + (total LS - 1) * (nrBeams + 1) + beam,10 + 3 * (cp + 2) + (fitt - 2)) = pop fitness(sol, fitt, beam)

NextNext fitt

End If

End Sub

End Class

144

Page 163: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

Appendix D

Improved Steepest DescentHill Climbing

Option Strict OnImports Excel = Microsoft.Office.Interop.ExcelImports Gsa 8 5

Public Class Form1Public Shared oXL As Excel.ApplicationPublic Shared oWB As Excel.WorkbookPublic Shared oSheet As Excel.WorksheetPublic Shared oRange As Excel.Range

Dim myGSAObject As Gsa 8 5.ComAuto

Dim PositionLoads(,,) As StringDim nrOfPointLoad As IntegerDim nr LoadBeamPoint As IntegerDim nr TotalBeamUDL As IntegerDim nr TotalLoadBeamPoint As IntegerDim nr TotalLoadNode As Integer

Dim nrSolutions As Integer = 1Dim StrainEnergy(nrSolutions) As SingleDim SensitivityAnalysisValues(,,,) As Single

Dim nrLoadCases As IntegerDim StrainEnergyLoadCases(,) As SingleDim rankLoadCases() As IntegerDim SensitivityLoadCases() As Single

Dim PropertiesLoad(,,) As StringDim LengthUDL(1) As DoubleDim NodeRestraint(,,) As DoubleDim nrRestrains As Integer

Dim RoundingEdge() As SingleDim wf(3, 10) As DoubleDim tcp(,,) As DoubleDim MoveSpace(,,) As DoubleDim OrigLimitDesignSpace(,,) As DoubleDim LimitDesignSpace(,,) As DoubleDim coor(,,) As Double

Dim origNrControlPoints As IntegerDim nrControlPoints As IntegerDim cp As IntegerDim lastControlPoint As IntegerDim nrControlPointsIsEven As BooleanDim nrSegments As Integer

145

Page 164: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX D. IMPROVED STEEPEST DESCENT HILL CLIMBING

Dim nrNodes As IntegerDim nrBeams As Integer

Const parts As Integer = 10Const nrDimensions As Integer = 2Dim symmetry As BooleanDim xMin, xMax, zMin, zMax, xMid As Double

Dim iteration As Integer

Dim direction(,) As IntegerDim lowestStrainEnergy() As SingleDim ValueStepsize() As IntegerDim rankControlPoints() As IntegerDim MutationRatio As Boolean = FalseDim MutationValue(,) As Single

Dim LoopExists As BooleanDim maxStepSize As IntegerDim LowestStepSize As Integer

Dim newSolution As BooleanConst pert As Integer = -1Dim total As Integer = 1Dim no improv As Boolean

Public Function gsaObj() As Gsa 8 5.ComAuto

Static bExistsAlready As Boolean

If Not bExistsAlready Or myGSAObject Is Nothing ThenmyGSAObject = New ComAutobExistsAlready = True

End If

If Not myGSAObject Is Nothing ThengsaObj = myGSAObject

End If

End Function

Public Sub ReleaseGsa()

gsaObj.Close()myGSAObject = Nothing

End Sub

Sub OpenExcel()

’start Excel and get Application objectoXL = New Excel.Application’set some propertiesoXL.Visible = TrueoXL.DisplayAlerts = False

End Sub

Sub ReleaseExcel()

’ Save the sheet and closeoSheet = NothingoRange = NothingoWB.Close()oWB = NothingoXL.Quit()

’ Clean up’ NOTE: When in release mode, this does the trickGC.WaitForPendingFinalizers()

146

Page 165: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

GC.Collect()GC.WaitForPendingFinalizers()GC.Collect()

End Sub

Private Sub BttnBrowse Click(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesBttnBrowse.Click

Select Case OpenFileDialog1.ShowDialog()Case System.Windows.Forms.DialogResult.Cancel

Exit SubEnd Select

TxtFileToOpen.Text = OpenFileDialog1.FileName

End Sub

Private Sub BttnBestSolution Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles BttnBestSolution.Click

Dim Variables(nrControlPoints + 1, 1) As IntegerDim count As Integer

’gsaObj.Open(TxtFileToOpen.Text)gsaObj.Open(TxtFileToOpen.Text)

gsaObj.Delete("results")OpenExcel()oWB = oXL.Workbooks.Add

DefineNumberAndPropertiesRestrains()DefineNumberAndPropertiesPointLoads()Rank PropertiesRestrainsAndLoads()Initialization()SetPropeperties()

coordinates(0)OutputGSAViews()’bereken optimum op basis van enkel de lastenDetermineOptimumControlPoints(Variables)

nrNodes = (nrControlPoints - 1) * 10 + 1nrBeams = nrNodes - 1ReDim coor(nrSolutions, nrNodes, nrDimensions)

’ReadExcel()gsaObj.Analyse()nrLoadCases = gsaObj.HighestCase("A")ReDim StrainEnergyLoadCases(nrLoadCases, 1)ReDim rankLoadCases(nrLoadCases)ReDim SensitivityLoadCases(nrLoadCases)

coordinates(0)export(0)GetStrainEnergy(0)

oSheet = DirectCast(oWB.Worksheets(1), Excel.Worksheet)oSheet.Cells(1, 3) = StrainEnergy(0)

OutputGSAViews()gsaObj.Delete("results")

HillClimbing(Variables, count)

Dim ExcelFile As StringExcelFile = Replace(TxtFileToOpen.Text, ".gwb", " BestSolution.xlsx")oWB.SaveAs(ExcelFile)gsaObj.Delete("results")Dim NewGsaFile As StringNewGsaFile = Replace(TxtFileToOpen.Text, ".gwb", " BestSolution.gwb")gsaObj.SaveAs(NewGsaFile)

147

Page 166: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX D. IMPROVED STEEPEST DESCENT HILL CLIMBING

ReleaseGsa()ReleaseExcel()

End Sub

Sub ReadExcel()

oWB = oXL.Workbooks.Open(<Path Excel file>)

Dim row As Integer = 17origNrControlPoints = nrControlPointscp = nrControlPoints + 1nrSegments = nrControlPoints - 1nrBeams = (nrControlPoints - 1) * 10nrNodes = nrBeams + 1

oSheet = DirectCast(oWB.Worksheets(1), Excel.Worksheet)

For u = 1 To nrControlPointstcp(0, u, 0) = oSheet.Cells(row, 2 + u).valuetcp(0, u, 2) = oSheet.Cells(row, 2 + nrControlPoints + u).value

Next

For dmsn = 0 To 2tcp(0, 0, dmsn) = 2 * tcp(0, 1, dmsn) - tcp(0, 2, dmsn)tcp(0, nrControlPoints + 1, dmsn) = 2 * tcp(0, nrControlPoints, dmsn) -tcp(0, nrControlPoints - 1, dmsn)

Next

ReleaseExcel()OpenExcel()oWB = oXL.Workbooks.Add

End Sub

Sub ContinueFromExistingGSAFile(ByVal dummmyControlPointsArray(,) As Double)

MutationRatio = TruegsaObj.Close()gsaObj.Open(<Path GSA file>)

ReadGsaFile(dummmyControlPointsArray)GetStrainEnergy(0)

oSheet = DirectCast(oWB.Worksheets(1), Excel.Worksheet)oSheet.Cells(1, 1) = 0oSheet.Cells(1, 2) = StrainEnergy(0).tostring("e4")

OutputGSAViews()gsaObj.Delete("results")

End Sub

Sub DefineNumberAndPropertiesRestrains()

Dim node As IntegerDim Load As IntegerDim restrains As IntegerDim argument, argument As IntegerDim highestNode As Integer = CInt(gsaObj.GwaCommand("highest,node"))Dim nrOfLoadBeam As Integer =CInt(gsaObj.GwaCommand("highest,load beam"))Dim nrOfLoadNode As Integer =CInt(gsaObj.GwaCommand("highest,load node"))

oSheet = DirectCast(oWB.Worksheets(3), Excel.Worksheet)’get number of restraints

For node = 1 To highestNodeDim existince As StringCStr(gsaObj.GwaCommand("exist, node.1," & node))

148

Page 167: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

If existince = "1" ThenIf gsaObj.Arg(6, CStr(gsaObj.GwaCommand("get,node.1," & node)))= "1" Or gsaObj.Arg(8, CStr(gsaObj.GwaCommand("get,node.1," & node))) = "1" Then

nrRestrains += 1End If

End IfNext

ReDim PropertiesLoad(nrOfLoadBeam + nrOfLoadNode + nrRestrains, 1, 7)oSheet = DirectCast(oWB.Worksheets(3), Excel.Worksheet)

’get restrain propertiesoSheet.Cells(9, 1) = "restraint"oSheet.Cells(9, 2) = "x"oSheet.Cells(9, 3) = "y"oSheet.Cells(9, 4) = "z"oSheet.Cells(9, 5) = "Rx"oSheet.Cells(9, 6) = "Ry"oSheet.Cells(9, 7) = "Rz"Load = nrOfPointLoad

ReDim NodeRestraint(nrRestrains, nrDimensions, 2)

For node = 1 To highestNode

Dim existince As String = CStr(gsaObj.GwaCommand("exist, node.1," & node))If existince = "1" Then

If CDbl(gsaObj.Arg(6, CStr(gsaObj.GwaCommand("get,node.1," & node)))) > 0 OrCDbl(gsaObj.Arg(8, CStr(gsaObj.GwaCommand("get,node.1," & node)))) > 0 Then

argument = 0Load += 1restrains += 1

For dmsn = 0 To 2NodeRestraint(restrains, dmsn, 0) = CDbl(gsaObj.Arg(2 + dmsn,CStr(gsaObj.GwaCommand("get,node.1," & node))))NodeRestraint(restrains, dmsn, 1) = CDbl(gsaObj.Arg(6 + dmsn,CStr(gsaObj.GwaCommand("get,node.1," & node))))oSheet.Cells(9 + restrains, 1) = restrainsoSheet.Cells(9 + restrains, 2 + dmsn) = NodeRestraint(restrains, dmsn, 0)oSheet.Cells(9 + restrains, 5 + dmsn) = NodeRestraint(restrains, dmsn, 1)

Next

PropertiesLoad(Load, 0, 0) = "REACT FORCE"

For argument = 1 To 8If argument <> 5 Then

argument += 1PropertiesLoad(Load, 0, argument ) = gsaObj.Arg(argument,CStr(gsaObj.GwaCommand("get,node.1," & node)))

End IfNext

PropertiesLoad(Load, 1, 0) = PropertiesLoad(Load, 0, 2)PropertiesLoad(Load, 1, 2) = PropertiesLoad(Load, 0, 4)

End IfEnd If

Next

End Sub

Sub DefineNumberAndPropertiesPointLoads()

Dim nrOfLoadBeam As Integer =CInt(gsaObj.GwaCommand("highest,load beam"))Dim nrOfLoadNode As Integer =CInt(gsaObj.GwaCommand("highest,load node"))

Dim Load As IntegerDim Load As IntegerDim nrLoad As Integer = nrRestrainsDim SameNode As Boolean

149

Page 168: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX D. IMPROVED STEEPEST DESCENT HILL CLIMBING

Dim node As IntegerDim position As DoubleDim d(nrDimensions) As DoubleDim positionLoad(nrDimensions) As Double

Dim sol As Integer = 0Dim PositionUDL(1) As Double

oSheet = DirectCast(oWB.Worksheets(3), Excel.Worksheet)’get load propertiesoSheet.Cells(1, 1) = "Load"oSheet.Cells(2, 1) = "Type"oSheet.Cells(3, 1) = "List"oSheet.Cells(4, 1) = "Proj"oSheet.Cells(5, 1) = "Dir"oSheet.Cells(6, 1) = "Val"oSheet.Cells(7, 1) = "Multi"

’set the properties of load

For Load = 1 To nrOfLoadBeamIf gsaObj.Arg(0, CStr(gsaObj.GwaCommand("get,load beam," & Load))) ="LOAD BEAM POINT" Then

nr TotalLoadBeamPoint += 1nrLoad += 1For argument = 0 To 7

PropertiesLoad(nrLoad, 0, argument) = gsaObj.Arg(argument,CStr(gsaObj.GwaCommand("get,load beam," & Load)))

Next

node = CInt(PropertiesLoad(nrLoad, 0, 1))

’load is fixed in position, thus unnecessary to define newcoordinates or export new coordinatesposition = Math.Round(CDbl(PropertiesLoad(nrLoad, 0, 6)), 3)PropertiesLoad(nrLoad, 0, 6) = CStr(position)

d(0) = CDbl(gsaObj.Arg(2, CStr(gsaObj.GwaCommand("get,node.1," & node + 1)))) -CDbl(gsaObj.Arg(2, CStr(gsaObj.GwaCommand("get,node.1," & node))))

d(2) = CDbl(gsaObj.Arg(4, CStr(gsaObj.GwaCommand("get,node.1," & node + 1)))) -CDbl(gsaObj.Arg(4, CStr(gsaObj.GwaCommand("get,node.1," & node))))

positionLoad(0) = Math.Round(CDbl(position) + CDbl(gsaObj.Arg(2,CStr(gsaObj.GwaCommand("get,node.1," & node)))), 5)

positionLoad(2) = Math.Round(CDbl(position) * d(2) / d(0) +CDbl(gsaObj.Arg(4, CStr(gsaObj.GwaCommand("get,node.1," & node)))), 5)

PropertiesLoad(nrLoad, 1, 0) = CStr(positionLoad(0))PropertiesLoad(nrLoad, 1, 2) = CStr(positionLoad(2))

For dmsn = 0 To nrDimensionsPropertiesLoad(nrLoad, 1, 3) = PropertiesLoad(nrLoad, 0, 5)PropertiesLoad(nrLoad, 1, 4) = PropertiesLoad(nrLoad, 0, 7)

NextPropertiesLoad(nrLoad, 1, 5) = PropertiesLoad(nrLoad, 1, 3)

’count the number of unique position of loadsIf nrLoad = 1 Then

nr LoadBeamPoint += 1ElseIf nrLoad > 1 Then

SameNode = FalseFor Load = 1 To nrLoad - 1

If (PropertiesLoad(nrLoad, 0, 1) = PropertiesLoad(Load , 0, 1)) And(PropertiesLoad(nrLoad, 0, 6) = PropertiesLoad(Load , 0, 6)) Then

PropertiesLoad(nrLoad, 1, 5) = "MULTIPLE LOAD"PropertiesLoad(Load , 1, 5) = "MULTIPLE DIRECTIONS"SameNode = TrueExit For

End IfNext

150

Page 169: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

If SameNode = False Thennr LoadBeamPoint += 1

End If

End If

ElseIf gsaObj.Arg(0, CStr(gsaObj.GwaCommand("get,load beam," & Load))) = "LOAD BEAM UDL" Then

nrLoad += 1nr TotalBeamUDL += 1

For argument = 0 To 6PropertiesLoad(nrLoad, 0, argument) = gsaObj.Arg(argument,CStr(gsaObj.GwaCommand("get,load beam," & Load)))

Next

PropertiesLoad(nrLoad, 1, 3) = PropertiesLoad(nrLoad, 0, 5)PropertiesLoad(nrLoad, 1, 4) = PropertiesLoad(nrLoad, 0, 6)

PropertiesLoad(1, 1, 3) = "UDL present"

oSheet.Cells(4, 1 + Load) = PropertiesLoad(Load, 0, 4)End If

oSheet.Cells(1, 1 + Load) = nrLoadoSheet.Cells(2, 1 + Load) = PropertiesLoad(nrLoad, 0, 0)oSheet.Cells(3, 1 + Load) = PropertiesLoad(nrLoad, 0, 1)oSheet.Cells(5, 1 + Load) = PropertiesLoad(nrLoad, 1, 3)oSheet.Cells(6, 1 + Load) = PropertiesLoad(nrLoad, 1, 4)oSheet.Cells(7, 1 + Load) = PropertiesLoad(nrLoad, 1, 5)

Next

For Load = 1 To nrOfLoadNode

nrLoad += 1For argument = 0 To 5

PropertiesLoad(Load, 0, argument) = gsaObj.Arg(argument,CStr(gsaObj.GwaCommand("get,load node," & Load - nrOfLoadBeam)))

Next

node = CInt(PropertiesLoad(nrLoad, 0, 1))

PropertiesLoad(nrLoad, 1, 0) = gsaObj.Arg(2, CStr(gsaObj.GwaCommand("get,node.1," & node)))PropertiesLoad(nrLoad, 1, 2) = gsaObj.Arg(4, CStr(gsaObj.GwaCommand("get,node.1," & node)))

PropertiesLoad(nrLoad, 1, 3) = PropertiesLoad(nrLoad, 0, 4)PropertiesLoad(nrLoad, 1, 4) = PropertiesLoad(nrLoad, 0, 5)

If Load = nrRestrains + nrOfLoadBeam + 1 Thennr TotalLoadNode += 1

ElseIf Load > nrRestrains + nrOfLoadBeam + 1 ThenSameNode = FalseFor Load = nrOfLoadBeam + 1 To Load - 1

If (gsaObj.Arg(1, CStr(gsaObj.GwaCommand("get,load node,"& Load))) =PositionLoads(Load , 0, 0)) And(gsaObj.Arg(2, CStr(gsaObj.GwaCommand("get,load node," & Load))) =PositionLoads(Load , 1, 0)) Then

SameNode = TrueExit For

End IfNextIf SameNode = False Then

nr TotalLoadNode += 1End If

End IfoSheet.Cells(1, 1 + Load) = nrLoadoSheet.Cells(2, 1 + Load) = PropertiesLoad(nrLoad, 0, 0)oSheet.Cells(3, 1 + Load) = PropertiesLoad(nrLoad, 0, 1)oSheet.Cells(5, 1 + Load) = PropertiesLoad(nrLoad, 1, 3)oSheet.Cells(6, 1 + Load) = PropertiesLoad(nrLoad, 1, 4)oSheet.Cells(7, 1 + Load) = PropertiesLoad(nrLoad, 1, 5)

Next

151

Page 170: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX D. IMPROVED STEEPEST DESCENT HILL CLIMBING

nrOfPointLoad = nr LoadBeamPoint + nr TotalLoadNode

End Sub

Sub Rank PropertiesRestrainsAndLoads()

Dim r As IntegerDim nr As IntegerDim HighestNode As Integer = CInt(gsaObj.GwaCommand("highest,node"))Dim list As IntegerDim nrOfLoadBeam As Integer = CInt(gsaObj.GwaCommand("highest,load beam"))Dim nrOfLoadNode As Integer = CInt(gsaObj.GwaCommand("highest,load node"))

For r = 1 To (nrRestrains + nrOfLoadBeam + nrOfLoadNode)If PropertiesLoad(r, 0, 0) <> "LOAD BEAM UDL" Then

list = HighestNodenr = 0For list = 1 To (nrRestrains + nrOfLoadBeam + nrOfLoadNode)

If PropertiesLoad(list , 0, 0) <> "LOAD BEAM UDL" ThenIf CInt(PropertiesLoad(list , 0, 1)) <= list AndCInt(PropertiesLoad(list , 1, 6)) = 0 Then

list = CInt(PropertiesLoad(list , 0, 1))nr = list

End IfEnd If

NextPropertiesLoad(nr, 1, 6) = CStr(r)

End IfNext

End Sub

Sub Initialization()

Dim nrOfLoadBeam As Integer = CInt(gsaObj.GwaCommand("highest,load beam"))Dim nrOfLoadNode As Integer = CInt(gsaObj.GwaCommand("highest,load node"))

ReDim RoundingEdge(nrOfLoadBeam + nrOfLoadNode + nrRestrains)

Dim u, dmsn As Integer

nrBeams = CInt(gsaObj.GwaCommand("highest,el"))nrNodes = nrBeams + 1

cp = CInt(nrBeams / 10 + 1) + 1

Dim dummmyControlPointsArray(cp, nrDimensions) As Double

ReadGsaFile(dummmyControlPointsArray)

origNrControlPoints = nrControlPointscp = nrControlPoints + 1nrBeams = ((nrControlPoints - 1) * 10)nrNodes = nrBeams + 1nrSegments = nrControlPoints - 1

ReDim tcp(nrSolutions, cp, nrDimensions)ReDim coor(nrSolutions, nrNodes, nrDimensions)ReDim MoveSpace(nrControlPoints, nrDimensions, 1)ReDim LimitDesignSpace(nrControlPoints, nrDimensions, 1)ReDim OrigLimitDesignSpace(nrControlPoints, nrDimensions, 1)

For u = 0 To cpFor dmsn = 0 To nrDimensions

tcp(0, u, dmsn) = dummmyControlPointsArray(u, dmsn)Next

Next

For dmsn = 0 To nrDimensionstcp(0, 0, dmsn) = Math.Round(2 * tcp(0, 1, dmsn) - tcp(0, 2, dmsn), 3)tcp(0, cp, dmsn) = Math.Round(2 * tcp(0, nrControlPoints, dmsn) -tcp(0, nrControlPoints - 1, dmsn), 3)

Next

152

Page 171: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

End Sub

Sub ReadGsaFile(ByRef dummmyControlPointsArray(,) As Double

Dim nrNodes1 As IntegerDim node As IntegerDim dmsn As IntegerDim u As Integer

nrNodes1 = CInt((Val(gsaObj.GwaCommand("HIGHEST,NODE"))))

nrControlPoints = 0

For node = (nrNodes + 1) To nrNodes1Dim existince As String = CStr(gsaObj.GwaCommand("exist, node.1," & node))If existince = "1" Then

nrControlPoints += 1For dmsn = 0 To 2

dummmyControlPointsArray(nrControlPoints, dmsn) =Math.Round(CDbl(gsaObj.Arg(dmsn + 2, CStr(gsaObj.GwaCommand("get,node.1," & node)))), 3)

NextEnd If

Next

For dmsn = 0 To nrDimensionsdummmyControlPointsArray(0, dmsn) =Math.Round(2 * dummmyControlPointsArray(1, dmsn)- dummmyControlPointsArray(2, dmsn), 3)dummmyControlPointsArray(nrControlPoints + 1, dmsn)= Math.Round(2 * dummmyControlPointsArray(nrControlPoints, dmsn) -dummmyControlPointsArray(nrControlPoints - 1, dmsn), 3)

Next

’use directcast to convert to or from data type ObjectoSheet = DirectCast(oWB.Worksheets(1), Excel.Worksheet)For u = 1 To nrControlPoints

oSheet.Cells(1, 2 + u) = dummmyControlPointsArray(u, 0)oSheet.Cells(1, 2 + u + nrControlPoints) = dummmyControlPointsArray(u, 2)

Next

End Sub

Sub SetPropeperties()

Dim load As IntegerDim nrOfLoadBeam As Integer = CInt(gsaObj.GwaCommand("highest,load beam"))Dim nrOfLoadNode As Integer = CInt(gsaObj.GwaCommand("highest,load node"))’0 <= RoundedEgde <= 1

For load = 1 To nrOfLoadBeam + nrOfLoadNode + nrRestrainsRoundingEdge(load) = CSng(TxtRoundingEdge.Text)

Next

For u = 2 To nrControlPoints - 1MoveSpace(u, 0, 0) = CDbl(TxtMovementValueX.Text)MoveSpace(u, 0, 1) = CDbl(TxtMovementValueX.Text)MoveSpace(u, 2, 0) = CDbl(TxtMovementValueZ.Text)MoveSpace(u, 2, 1) = CDbl(TxtMovementValueZ.Text)

Next

xMin = tcp(0, 1, 0)xMax = tcp(0, nrControlPoints, 0)zMin = tcp(0, 1, 2)zMax = tcp(0, nrControlPoints, 2)xMid = (xMin + xMax) / 2

’define end of loop’controleer op symmetryDim uu As IntegerFor u = 1 To CInt(nrControlPoints / 2)

uu = nrControlPoints - (u - 1)If tcp(0, u, 0) <> tcp(0, uu, 0) And tcp(0, u, 2) <> tcp(0, uu, 2) Then

153

Page 172: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX D. IMPROVED STEEPEST DESCENT HILL CLIMBING

symmetry = FalseEnd If

Next

End Sub

Sub DetermineOptimumControlPoints(ByRef Variables(,) As Integer)

Dim sol As Integer = 0Dim rank List As IntegerDim List As Integer = 0Dim List Prev As IntegerDim List cp As IntegerDim Load As IntegerDim u As IntegerDim dmsn As IntegerDim ExtraControlPoints As IntegerDim SameNode As Boolean = FalseDim nrOfLoadBeam As Integer = CInt(gsaObj.GwaCommand("highest,load beam"))Dim nrOfLoadNode As Integer = CInt(gsaObj.GwaCommand("highest,load node"))

If (PropertiesLoad(1, 1, 3) = Nothing And PropertiesLoad(1, 1, 4) =Nothing) Then

nrControlPoints = 2 + (nrRestrains - 2 + nrOfPointLoad) * 3Else

nrControlPoints = 2 + (nrRestrains - 2 + nrOfPointLoad) * 2 * 3 + 3End If

DefineLastControlPoint()cp = nrControlPoints + 1nrSegments = nrControlPoints - 1

ReDim tcp(nrSolutions, cp, nrDimensions)ReDim Variables(nrControlPoints + 1, nrDimensions + 1)’per u voor iedere richting aangeven of het wel/niet gemuteren+welke kracht erbij hoort?ReDim MoveSpace(nrControlPoints, nrDimensions, 1)ReDim LimitDesignSpace(nrControlPoints, nrDimensions, 1)

For u = 1 To nrControlPoints ’maakt niet uit voor welke variabelen,gebied is vrij

MoveSpace(u, 0, 0) = CDbl(TxtMovementValueX.Text)MoveSpace(u, 0, 1) = CDbl(TxtMovementValueX.Text)MoveSpace(u, 2, 0) = CDbl(TxtMovementValueZ.Text)MoveSpace(u, 2, 1) = CDbl(TxtMovementValueZ.Text)

Next

’define control points based on the listFor rank List = 1 To (nrRestrains + nrOfLoadBeam + nrOfLoadNode)

For Load = 1 To (nrRestrains + nrOfLoadBeam + nrOfLoadNode)

If PropertiesLoad(Load, 0, 0) <> "LOAD BEAM UDL" ThenIf CInt(PropertiesLoad(Load, 1, 6)) = rank List AndPropertiesLoad(Load, 1, 5) <> "MULTIPLE LOAD" Then

List += 1

If List = 1 ThenOptimumEndControlPoints(sol, List, ExtraControlPoints, Load, Variables)

ElseIf List > 1 And List < (nrRestrains + nrOfPointLoad) ThenIf List = 2 Then

List cp = ListList Prev = List + 1

ElseList cp = ListList Prev = List

End IfIf (PropertiesLoad(1, 1, 3)) = Nothing Then

ExtraControlPoints += 1Else

ExtraControlPoints += 4End IfOptimumInbetweenPointLoadControlPoints(sol, List,ExtraControlPoints, Load, Variables)

154

Page 173: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

OptimumInbetweenUDLControlPoints(sol, List, List Prev,List cp, ExtraControlPoints, Load, Variables)

ExtraControlPoints += 1ElseIf List = (nrRestrains + nrOfPointLoad) Then

If (PropertiesLoad(1, 1, 3)) <> Nothing ThenExtraControlPoints += 3

End IfOptimumEndControlPoints(sol, List, ExtraControlPoints,Load, Variables)List cp = List + 1List Prev = List + 1 ’mathematical trickOptimumInbetweenUDLControlPoints(sol, List, List Prev,List cp, ExtraControlPoints, Load, Variables)

End If

Exit ForEnd If

End If

NextNext

Load = 2 ’want, de twee buitenste restrains hebben geen extra controle punten, andere restrains en loads wel, uitgaande dat er geen uitkragingen zijnFor u = 2 To nrControlPoints - 1

If Variables(u, 3) > 0 ThenLoad += 1

For dmsn = 0 To 2tcp(sol, u - 1, dmsn) = Math.Round(tcp(sol, u, dmsn) +(1 - RoundingEdge(Load)) * ((1 / 2) * tcp(sol, u - 2, dmsn) -(1 / 2) * tcp(sol, u, dmsn)), 3)tcp(sol, u + 1, dmsn) = Math.Round(tcp(sol, u, dmsn) +(1 - RoundingEdge(Load)) * ((1 / 2) * tcp(sol, u + 2, dmsn) -(1 / 2) * tcp(sol, u, dmsn)), 3)

NextEnd If

Next

For dmsn = 0 To 2tcp(sol, 0, dmsn) = Math.Round(2 * tcp(sol, 1, dmsn) -tcp(sol, 2, dmsn), 3)tcp(sol, cp, dmsn) = Math.Round(2 * tcp(sol, nrControlPoints, dmsn) -tcp(sol, nrControlPoints - 1, dmsn), 3)

Next

End Sub

Sub OptimumEndControlPoints(ByVal sol As Integer, ByVal List AsInteger, ByVal ExtraControlPoints As Integer, ByVal Load As Integer,ByRef Variables(,) As Integer)

For dmsn = 0 To nrDimensionstcp(sol, List + ExtraControlPoints, dmsn) = CDbl(PropertiesLoad(Load, 1, dmsn))LimitDesignSpace(List + ExtraControlPoints, dmsn, 0) =tcp(sol, List + ExtraControlPoints, dmsn)LimitDesignSpace(List + ExtraControlPoints, dmsn, 1) =tcp(sol, List + ExtraControlPoints, dmsn)

Next

Variables(List + ExtraControlPoints, 3) = Load

End Sub

Sub OptimumInbetweenPointLoadControlPoints(ByVal sol As Integer, ByVal List As Integer, ByValExtraControlPoints As Integer, ByVal Load As Integer, ByRef Variables(,) As Integer)

For dmsn = 0 To nrDimensionstcp(sol, List + ExtraControlPoints, dmsn) = CDbl(PropertiesLoad(Load, 1, dmsn))

Next

’the following code limits the variables to vary in z onlyVariables(List + ExtraControlPoints, 2) = 1

155

Page 174: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX D. IMPROVED STEEPEST DESCENT HILL CLIMBING

Variables(List + ExtraControlPoints, 0) = 0Variables(List + ExtraControlPoints, 3) = Load

LimitDesignSpace(List + ExtraControlPoints, 0, 0) = tcp(sol, List + ExtraControlPoints, 0)LimitDesignSpace(List + ExtraControlPoints, 0, 1) = tcp(sol, List + ExtraControlPoints, 0)LimitDesignSpace(List + ExtraControlPoints, 2, 0) = Math.Round(tcp(sol, List + ExtraControlPoints,2) - MoveSpace(List + ExtraControlPoints, 2, 0), 3)LimitDesignSpace(List + ExtraControlPoints, 2, 1) = Math.Round(tcp(sol, List + ExtraControlPoints,2) + MoveSpace(List + ExtraControlPoints, 2, 1), 3)

End Sub

Sub OptimumInbetweenUDLControlPoints(ByVal sol As Integer, ByVal List As Integer, ByVal List PrevAs Integer, ByVal List cp As Integer, ByVal ExtraControlPoints As Integer, ByVal Load As Integer,ByRef Variables(,) As Integer)

If PropertiesLoad(1, 1, 3) = "UDL present" Then

For UdlControlPoint = 1 To 3tcp(sol, List cp + ExtraControlPoints - 5 + UdlControlPoint, 0) =UdlControlPoint * ((tcp(sol, List + ExtraControlPoints, 0)- tcp(sol, List Prev + ExtraControlPoints - 6, 0)) / 4)+ tcp(sol, List Prev + ExtraControlPoints - 6, 0)

For node = 1 To nrNodes - 1If tcp(sol, List cp + ExtraControlPoints - 5 + UdlControlPoint, 0) >=coor(0, node, 0)And tcp(sol, List cp + ExtraControlPoints - 5 + UdlControlPoint, 0) < coor(0, node + 1, 0) Then

tcp(sol, List cp + ExtraControlPoints - 5 + UdlControlPoint, 2) = coor(0, node, 2)Exit For

End IfNext

Variables(List cp + ExtraControlPoints - 5 + UdlControlPoint, 0) = 1Variables(List cp + ExtraControlPoints - 5 + UdlControlPoint, 2) = 1

LimitDesignSpace(List cp + ExtraControlPoints - 5 + UdlControlPoint, 0, 0) =Math.Round(tcp(sol, List Prev + ExtraControlPoints - 5 + UdlControlPoint, 0) -MoveSpace(List Prev + ExtraControlPoints - 5 + UdlControlPoint, 0, 0), 3)

LimitDesignSpace(List cp + ExtraControlPoints - 5 +UdlControlPoint, 0, 1) = Math.Round(tcp(sol, List Prev +ExtraControlPoints - 5 + UdlControlPoint, 0) +MoveSpace(List Prev + ExtraControlPoints - 5 + UdlControlPoint,0, 1), 3)

LimitDesignSpace(List cp + ExtraControlPoints - 5 + UdlControlPoint, 2, 0) =Math.Round(tcp(sol, List Prev + ExtraControlPoints - 5 + UdlControlPoint, 2) -MoveSpace(List Prev + ExtraControlPoints - 5 + UdlControlPoint, 2, 0), 3)

LimitDesignSpace(List cp + ExtraControlPoints - 5 + UdlControlPoint, 2, 1) =Math.Round(tcp(sol, List Prev + ExtraControlPoints - 5 + UdlControlPoint, 2) +MoveSpace(List Prev + ExtraControlPoints - 5 + UdlControlPoint, 2, 1), 3)

Next

End If

End Sub

Sub CharacterModel(ByRef ExtraControlPoints As Integer, ByRefCPwithExtraCP(,,) As Integer)

Dim sol As Integer = 0Dim u, dmsn As IntegerDim Load As IntegerDim posLoad As DoubleDim SameNode As BooleanDim nrOfLoadBeam As Integer = CInt(gsaObj.GwaCommand("highest,load beam"))Dim nrOfLoadNode As Integer = CInt(gsaObj.GwaCommand("highest,load node"))Dim posRestrain As Double

ReDim CPwithExtraCP(nrControlPoints, 0, 1)

156

Page 175: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

For Load = 1 To (nrOfPointLoad + nr TotalBeamUDL)If PropertiesLoad(Load, 0, 0) = "LOAD BEAM POINT" Or

PropertiesLoad(Load, 0, 0) = "LOAD NODE" Then’string must be exact, also capital lettersposLoad = Math.Round(CDbl(PropertiesLoad(Load, 1, 0)), 5)’insert if control point does not exists yet at location loadFor u = 1 To nrControlPoints - 1

If (tcp(sol, u, 0) < posLoad And tcp(sol, u + 1, 0) > posLoad) Or(tcp(sol, u, 0) > posLoad And tcp(sol, u + 1, 0) < posLoad) Then

If Load = 1 ThenExtraControlPoints += 1CPwithExtraCP(u, 0, 0) = 1CPwithExtraCP(u, 0, 1) += 1PropertiesLoad(Load, 1, 3) = CStr(u)PropertiesLoad(Load, 1, 4) = CStr(1)

ElseIf Load > 1 ThenFor Load = 1 To Load - 1

If posLoad = Math.Round(CDbl(PropertiesLoad(Load , 1, 0)), 5) ThenSameNode = TrueExit For

ElseSameNode = False

End IfNextIf SameNode = True Then

PropertiesLoad(Load, 1, 3) = CStr(u)PropertiesLoad(Load, 1, 4) = CStr(1)

ElseIf SameNode = False ThenExtraControlPoints += 1CPwithExtraCP(u, 0, 0) = 1CPwithExtraCP(u, 0, 1) += 1PropertiesLoad(Load, 1, 3) = CStr(u)PropertiesLoad(Load, 1, 4) = CStr(1)

End IfEnd IfExit For

ElseIf tcp(sol, u, 0) = posLoad ThenIf Load = 1 Then

CPwithExtraCP(u, 0, 0) = 2PropertiesLoad(Load, 1, 3) = CStr(u)PropertiesLoad(Load, 1, 4) = CStr(2)

ElseIf Load > 1 ThenFor Load = 1 To Load - 1

If posLoad <> Math.Round(CDbl(PropertiesLoad(Load , 1, 0)), 5) Then

CPwithExtraCP(u, 0, 0) = 2PropertiesLoad(Load, 1, 3) = CStr(u)PropertiesLoad(Load, 1, 4) = CStr(2)

ElsePropertiesLoad(Load, 1, 3) = CStr(u)PropertiesLoad(Load, 1, 4) = CStr(2)

End IfNext

End IfExit For

End IfNext

End IfNext

For Load = (nrOfPointLoad + nr TotalBeamUDL + 1) To (nrOfPointLoad +nr TotalBeamUDL + nrRestrains)posRestrain = Math.Round(CDbl(PropertiesLoad(Load, 1, 0)), 5)

For u = 2 To nrControlPoints - 1’geen extra controle punten tpv eindopleggingen!

If (tcp(sol, u, 0) < posRestrain And tcp(sol, u + 1, 0) >posRestrain) Or (tcp(sol, u, 0) > posRestrainAnd tcp(sol, u + 1, 0) < posRestrain) Then

ExtraControlPoints += 1CPwithExtraCP(u, 0, 0) = 1CPwithExtraCP(u, 0, 1) += 1PropertiesLoad(Load, 1, 3) = CStr(u)PropertiesLoad(Load, 1, 4) = CStr(1)

157

Page 176: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX D. IMPROVED STEEPEST DESCENT HILL CLIMBING

ElseIf tcp(sol, u, 0) = posRestrain ThenCPwithExtraCP(u, 0, 0) = 2PropertiesLoad(Load, 1, 3) = CStr(u)PropertiesLoad(Load, 1, 4) = CStr(2)

End IfNext

Next

For u = 1 To nrControlPointsFor dmsn = 0 To 2

LimitDesignSpace(u, dmsn, 0) = Math.Round(tcp(0, u, dmsn) - MoveSpace(u, dmsn, 0), 5)LimitDesignSpace(u, dmsn, 1) = Math.Round(tcp(0, u, dmsn) + MoveSpace(u, dmsn, 1), 5)

NextNext

End Sub

Sub InsertControlPoints 1(ByRef ExtraControlPoints As Integer, ByVal CPwithExtraCP(,,) As Integer,ByRef CPwith2ExtraCP(,) As Integer, ByRef nrOfExtraPoints As Integer)

’if a control point does not exists underneath the point load, then insert a control pointDim sol As Integer = 0Dim u, dmsn As IntegerDim Load As IntegerDim SameNode As BooleanDim nrOfLoadBeam As Integer = CInt(gsaObj.GwaCommand("highest,load beam"))Dim nrOfLoadNode As Integer = CInt(gsaObj.GwaCommand("highest,load node"))

Dim Storetcp(nrControlPoints, nrDimensions) As DoubleDim StoreLDS(nrControlPoints, nrDimensions, 1) As DoubleDim coorPt(2) As Double

For u = 1 To nrControlPointsFor dmsn = 0 To 2

Storetcp(u, dmsn) = tcp(sol, u, dmsn)StoreLDS(u, dmsn, 0) = LimitDesignSpace(u, dmsn, 0)StoreLDS(u, dmsn, 1) = LimitDesignSpace(u, dmsn, 1)

NextNext

nrControlPoints += ExtraControlPointscp = nrControlPoints + 1ExtraControlPoints = 0

ReDim tcp(nrSolutions, nrControlPoints, 2)ReDim LimitDesignSpace(nrControlPoints, nrDimensions, 1)ReDim CPwith2ExtraCP(nrControlPoints, 1)

For u = 1 To origNrControlPointsIf CPwithExtraCP(u, 0, 0) = 0 Then

’geen last tpv bestaande controle punt

For dmsn = 0 To 2tcp(sol, u + ExtraControlPoints, dmsn) = Storetcp(u, dmsn)LimitDesignSpace(u + ExtraControlPoints, dmsn, 0) = StoreLDS(u, dmsn, 0)LimitDesignSpace(u + ExtraControlPoints, dmsn, 1) = StoreLDS(u, dmsn, 1)

Next

’last tpv bestaande controle punt’steunpunt tpv bestaande controle puntElseIf CPwithExtraCP(u, 0, 0) = 2 Then

For dmsn = 0 To 2tcp(sol, u + ExtraControlPoints, dmsn) = Storetcp(u, dmsn)LimitDesignSpace(u + ExtraControlPoints, dmsn, 0) = StoreLDS(u, dmsn, 0)LimitDesignSpace(u + ExtraControlPoints, dmsn, 1) = StoreLDS(u, dmsn, 1)

Next

CPwith2ExtraCP(u + ExtraControlPoints, 0) = 2

For Load = 1 To nrOfLoadBeam + nrOfLoadNodeIf PropertiesLoad(Load, 1, 3) = CStr(u) Then

CPwith2ExtraCP(u + ExtraControlPoints, 1) = Load

158

Page 177: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

’maar 1 puntlast op 1 controle punt mogelijkEnd If

Next

For restrain = 1 To nrRestrainsIf NodeRestraint(restrain, 0, 2) = CDbl(u) Then

CPwith2ExtraCP(u + ExtraControlPoints, 0) = 2CPwith2ExtraCP(u + ExtraControlPoints, 1) = restrain

End IfNextnrOfExtraPoints += 2

’last tussen bestaande controle punten’steunpunt tussen bestaande controle puntenElseIf CPwithExtraCP(u, 0, 0) = 1 Then

For Load = 1 To nrOfPointLoad + nrRestrainsIf PropertiesLoad(Load, 1, 3) = CStr(u) Then

If Load > 1 ThenFor Load = 1 To Load - 1

If PropertiesLoad(Load, 1, 0) = PropertiesLoad(Load , 1, 0)And PropertiesLoad(Load, 1, 2) =PropertiesLoad(Load , 1, 2) Then

SameNode = True ’only if two loads exist on the same nodeEnd If

NextEnd IfIf SameNode = True Then

Exit ForEnd If

’als voorgaande punt geen last heeft’als voorgaande punt geen restrain heeftIf CPwith2ExtraCP(u + ExtraControlPoints, 0) = 0 Then

For dmsn = 0 To 2tcp(sol, u + ExtraControlPoints, dmsn) = Storetcp(u, dmsn)LimitDesignSpace(u + ExtraControlPoints, dmsn, 0) = StoreLDS(u, dmsn, 0)LimitDesignSpace(u + ExtraControlPoints, dmsn, 1) = StoreLDS(u, dmsn, 1)

NextEnd IfExtraControlPoints += 1

For dmsn = 0 To 2tcp(sol, u + ExtraControlPoints, dmsn) = CDbl(PropertiesLoad(Load, 1, dmsn))

NextLimitDesignSpace(u + ExtraControlPoints, 0, 0) = CDbl(PropertiesLoad(Load, 1, 0))LimitDesignSpace(u + ExtraControlPoints, 0, 1) = CDbl(PropertiesLoad(Load, 1, 0))

If PropertiesLoad(Load, 0, 0) <> "REACT FORCE" ThenLimitDesignSpace(u + ExtraControlPoints, 2, 0) = CDbl(PropertiesLoad(Load, 1, 2)) - 0.5 *(MoveSpace(u, 2, 0) + MoveSpace(u + 1, 2, 0))LimitDesignSpace(u + ExtraControlPoints, 2, 1) = CDbl(PropertiesLoad(Load, 1, 2)) + 0.5 *

(MoveSpace(u, 2, 1) + MoveSpace(u + 1, 2, 1))End If

CPwith2ExtraCP(u + ExtraControlPoints, 0) = 1CPwith2ExtraCP(u + ExtraControlPoints, 1) = Load

nrOfExtraPoints += 2

End IfNext

End IfNext

End Sub

Sub InsertControlPoints 2(ByVal ExtraControlPoints As Integer, ByVal CPwithExtraCP(,,) As Integer,ByVal CPwith2ExtraCP(,) As Integer, ByRef Variables(,) As Integer, ByVal nrOfExtraPoints As Integer)

Dim sol As Integer = 0Dim u, dmsn As Integer

159

Page 178: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX D. IMPROVED STEEPEST DESCENT HILL CLIMBING

Dim Load As IntegerDim nrOfLoad As IntegerDim prevControlPoints As Integer = nrControlPointsDim Storetcp(prevControlPoints, nrDimensions) As DoubleDim StoreLDS(prevControlPoints, nrDimensions, 1) As DoubleDim ControlPoint As Integer = 0Dim support As Integer

For u = 1 To nrControlPointsFor dmsn = 0 To 2

Storetcp(u, dmsn) = tcp(sol, u, dmsn)StoreLDS(u, dmsn, 0) = LimitDesignSpace(u, dmsn, 0)StoreLDS(u, dmsn, 1) = LimitDesignSpace(u, dmsn, 1)

NextNext

nrOfLoad = CInt(gsaObj.GwaCommand("highest,load beam")) +CInt(gsaObj.GwaCommand("highest,load node"))nrControlPoints += nrOfExtraPointscp = nrControlPoints + 1’niet iedere last krijgt extra punten:alleen puntlasten,

en alleen als puntlasten niet dezelfde knoop belastenExtraControlPoints = 0

ReDim tcp(nrSolutions, cp, nrDimensions)ReDim LimitDesignSpace(nrControlPoints, nrDimensions, 1)ReDim Variables(nrControlPoints + 1, 3)’per u voor iedere richting aangeven of het wel/niet gemuteren+welke kracht erbij hoort

For u = 1 To prevControlPoints

If CPwith2ExtraCP(u, 0) = 0 ThenIf u = support Then ’this allows the support to be varied in heightVariables(u + ExtraControlPoints, 2) = 1

For dmsn = 0 To 2tcp(sol, u + ExtraControlPoints, dmsn) = Storetcp(u, dmsn)LimitDesignSpace(u + ExtraControlPoints, dmsn, 0) = StoreLDS(u, dmsn, 0)LimitDesignSpace(u + ExtraControlPoints, dmsn, 1) = StoreLDS(u, dmsn, 1)

NextElse ’this allows the other control pointswithout loads to be varied in both directions

For dmsn = 0 To 2Variables(u + ExtraControlPoints, dmsn) = 1tcp(sol, u + ExtraControlPoints, dmsn) = Storetcp(u, dmsn)LimitDesignSpace(u + ExtraControlPoints, dmsn, 0) = StoreLDS(u, dmsn, 0)LimitDesignSpace(u + ExtraControlPoints, dmsn, 1) = StoreLDS(u, dmsn, 1)

NextEnd If

’load or restrain is presentElseIf CPwith2ExtraCP(u, 0) > 0 Then

ExtraControlPoints += 1Load = CPwith2ExtraCP(u, 1)If PropertiesLoad(Load, 0, 0) = "LOAD BEAM POINT" Or PropertiesLoad(Load, 0, 0) = "LOAD NODE" Then

Variables(u + ExtraControlPoints, 2) = 1Variables(u + ExtraControlPoints, 3) = CPwith2ExtraCP(u, 1)

ElseIf PropertiesLoad(Load, 0, 0) = "REACT FORCE" Then

Variables(u + ExtraControlPoints, 3) = CPwith2ExtraCP(u, 1)

End If

For dmsn = 0 To 2tcp(sol, u + ExtraControlPoints, dmsn) = Storetcp(u, dmsn)LimitDesignSpace(u + ExtraControlPoints, dmsn, 0) = StoreLDS(u, dmsn, 0)LimitDesignSpace(u + ExtraControlPoints, dmsn, 1) = StoreLDS(u, dmsn, 1)

tcp(sol, u + ExtraControlPoints - 1, dmsn) = Storetcp(u, dmsn) +(1 - RoundingEdge(Load)) * ((1 / 2) * Storetcp(u - 1, dmsn) -(1 / 2) * Storetcp(u, dmsn))

Next

160

Page 179: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

ExtraControlPoints += 1For dmsn = 0 To 2

tcp(sol, u + ExtraControlPoints, dmsn) = Storetcp(u, dmsn) +(1 - RoundingEdge(Load)) * ((1 / 2) * Storetcp(u + 1, dmsn) -(1 / 2) * Storetcp(u, dmsn))

Next

End IfNext

For dmsn = 0 To 2tcp(sol, 0, dmsn) = 2 * tcp(0, 1, dmsn) - tcp(0, 2, dmsn)tcp(sol, cp, dmsn) = 2 * tcp(0, nrControlPoints, dmsn) -tcp(0, nrControlPoints - 1, dmsn)

Next

End Sub

Sub DefineLastControlPoint()

If symmetry = False ThenlastControlPoint = nrControlPoints

ElseIf symmetry = True ThenIf Int(nrControlPoints / 2) * 2 - nrControlPoints = -1 Then

nrControlPointsIsEven = FalselastControlPoint = CInt(Int(nrControlPoints / 2) + 1)

ElsenrControlPointsIsEven = TruelastControlPoint = CInt(Int(nrControlPoints / 2))

End IfEnd If

End Sub

Public Shared Sub setupwf()

Dim a As Integer

For a = 0 To 10Dim t As Doublet = a * 0.1wf(0, a) = (1 / 6) * (1 - 3 * t + 3 * t ^2 - t ^3)wf(1, a) = (1 / 6) * (4 - 6 * t ^2 + 3 * t ^3)wf(2, a) = (1 / 6) * (1 + 3 * t + 3 * t ^2 - 3 * t ^3)wf(3, a) = (1 / 6) * t ^3

Next a

End Sub

Sub coordinates(ByVal sol As Integer)

Dim last As IntegerDim node As IntegerDim a, b, ,segment, dmsn As Integer

setupwf() LoopExists = False

For segment = 0 To nrSegmentsb = segmentsIf b = nrSegments Then

last = 10Else

last = 9End If

For a = 0 To lastFor dmsn = 0 To 2

’Coordinate nodes P(t)=(P i*w i)coor(sol, 1 + a + (segment - 1) * 10, dmsn) = Math.Round((wf(0, a) * tcp(sol, b - 1, dmsn) +

161

Page 180: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX D. IMPROVED STEEPEST DESCENT HILL CLIMBING

wf(1, a) * tcp(sol, b, dmsn) +wf(2, a) * tcp(sol, b + 1, dmsn) +wf(3, a) * tcp(sol, b + 2, dmsn)), 5)

Next dmsnnode += 1ChkIntersection(sol, node)If LoopExists = True Then

Exit SubEnd If

Next aNext segment

End Sub

Sub ChkIntersection(ByVal sol As Integer, ByVal node As Integer, ByVal iter As Integer, ByValdiffOptimum As Single)

’disallow intersections of polygonal edgesDim gradient(node) As DoubleDim b(nrBeams) As DoubleDim beam As IntegerDim intersection As DoubleDim lowx, upx As DoubleDim low1x, up1x As Double

If node >= 2 ThenIf coor(sol, node, 0) = coor(sol, node - 1, 0)And coor(sol, node, 2) = coor(sol, node - 1, 2) Then

LoopExists = TrueExit Sub

End IfEnd If

If node >= 4 Thengradient(0) = (coor(sol, node, 2) - coor(sol, node - 1, 2)) /(coor(sol, node, 0) - coor(sol, node - 1, 0))b(0) = coor(sol, node, 2) - (gradient(0) * coor(sol, node, 0))’segment boundaries of last segmentIf coor(sol, node, 0) < coor(sol, node - 1, 0) Then

lowx = coor(sol, node, 0)upx = coor(sol, node - 1, 0)

Elselowx = coor(sol, node - 1, 0)upx = coor(sol, node, 0)

End If

For beam = 1 To node - 3gradient(beam) = Math.Round((coor(sol, beam + 1, 2) -coor(sol, beam, 2)) /(coor(sol, beam + 1, 0) - coor(sol, beam, 0)), 5)b(beam) = Math.Round(coor(sol, beam, 2) - (gradient(beam) *coor(sol, beam, 0)), 5)

Next

For beam = 1 To node - 3’if both lines are not parallel, intersection could occurIf gradient(beam) <> gradient(0) Then’segment boundaries of segment to be checked

If coor(sol, beam, 0) < coor(sol, beam + 1, 0) Thenlow1x = coor(sol, beam, 0)up1x = coor(sol, beam + 1, 0)

Elselow1x = coor(sol, beam + 1, 0)up1x = coor(sol, beam, 0)

End Ifintersection = (b(beam) - b(0)) / (gradient(0) -gradient(beam))’if intersection is in both x-interval-->determine new cpsIf intersection >= lowx And intersection <= upx And

intersection >= low1x And intersection <= up1x ThenLoopExists = TrueExit Sub

162

Page 181: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

End IfEnd If

NextEnd If

End Sub

Sub export(ByVal sol As Integer)

Dim x, y, z As StringDim Rx, Ry, Rz As StringDim node As IntegerDim DistanceToRestrain As DoubleDim NodeToRestrain As Integer

Dim beam As IntegerDim posBeam As DoubleDim load As IntegerDim u As IntegerDim posLoad As Double

Dim HighestNode As Integer = CInt(gsaObj.GwaCommand("highest,node"))Dim HighestBeam As Integer = CInt(gsaObj.GwaCommand("highest,el"))Dim nrOfLoadBeam As Integer = CInt(gsaObj.GwaCommand("highest,load beam"))Dim nrOfLoadNode As Integer = CInt(gsaObj.GwaCommand("highest,load node"))

Dim beamList As StringDim case As StringDim axis As StringDim projected As StringDim direction As StringDim position As StringDim value As String’verwijder allesgsaObj.Delete("results")gsaObj.GwaCommand("delete,node,1," & HighestNode)gsaObj.GwaCommand("delete,el,1," & HighestBeam)gsaObj.GwaCommand("delete,load beam,1," & nrOfLoadBeam)gsaObj.GwaCommand("delete,load node,1," & nrOfLoadNode)

’exporteer knopenFor node = 1 To nrNodes

x = CStr(coor(sol, node, 0))y = CStr(0)z = CStr(coor(sol, node, 2))gsaObj.GwaCommand("SET,NODE.1," & node & "," &

x & "," &y & "," &z & ",GLOBAL,0,1,0,1,0,1")

Next

For restraint = 1 To nrRestrainsDistanceToRestrain = 9999999For node = 1 To nrNodes

If Math.Abs(NodeRestraint(restraint, 0, 0) - coor(sol, node, 0)) <=DistanceToRestrain Then

DistanceToRestrain = Math.Abs(NodeRestraint(restraint, 0, 0) -coor(sol, node, 0))NodeToRestrain = node

End IfNextx = CStr(coor(sol, NodeToRestrain, 0))y = CStr(0)z = CStr(coor(sol, NodeToRestrain, 2))Rx = CStr(NodeRestraint(restraint, 0, 1))Ry = CStr(NodeRestraint(restraint, 1, 1))Rz = CStr(NodeRestraint(restraint, 2, 1))gsaObj.GwaCommand("SET,NODE.1," & NodeToRestrain & "," &

x & "," &y & "," &z & ",GLOBAL," &Rx & "," &Ry & "," &

163

Page 182: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX D. IMPROVED STEEPEST DESCENT HILL CLIMBING

Rz & ",1,0,1")Next

’exporteer alle controle puntenFor u = 1 To nrControlPoints

node += 1x = CStr(tcp(sol, u, 0))y = CStr(0)z = CStr(tcp(sol, u, 2))gsaObj.GwaCommand("SET,NODE.1," & node & "," &

x & "," &y & "," &z & ",GLOBAL,0,1,0,1,0,1")

Next

’exporteer elementenFor beam = 1 To nrBeams

gsaObj.GwaCommand("SET,EL BEAM," & beam & ",1,1," &beam & "," & beam + 1 & ",0,90")

Next beam

’exporteer belasting

’bepaal de posities waar de belastingen zitten en zet op de juiste positie’begin bij load=nrrestrains+1, want vanaf hier zijn de loads gedefinieerdFor load = 1 To nrOfLoadBeam + nrOfLoadNode + nrRestrains

If PropertiesLoad(load, 0, 0) = "LOAD BEAM UDL" ThenbeamList = PropertiesLoad(load, 0, 1)case = PropertiesLoad(load, 0, 2)axis = PropertiesLoad(load, 0, 3)projected = PropertiesLoad(load, 0, 4)direction = PropertiesLoad(load, 0, 5)value = PropertiesLoad(load, 0, 6)

gsaObj.GwaCommand("SET,LOAD BEAM UDL," & beamList & "," & case &"," & axis & "," & projected & "," & direction & "," & value)

ElseIf PropertiesLoad(load, 0, 0) = "LOAD BEAM POINT" ThenposLoad = CDbl(PropertiesLoad(load, 1, 0))For node = 1 To nrNodes - 1

If coor(sol, node, 0) <= posLoad And coor(sol, node + 1, 0) > posLoad ThenposBeam = posLoad - coor(sol, node, 0)beam = nodeExit For

End IfNextbeamList = CStr(beam)case = PropertiesLoad(load, 0, 2)axis = PropertiesLoad(load, 0, 3)projected = PropertiesLoad(load, 0, 4)direction = PropertiesLoad(load, 0, 5)position = CStr(posBeam)value = PropertiesLoad(load, 0, 7)

gsaObj.GwaCommand("SET,LOAD BEAM POINT," & beamList & "," & case & "," &axis & "," & projected & "," & direction & "," & position & "," & value)

ElseIf PropertiesLoad(load, 0, 0) = "LOAD NODE" Then

posLoad = CDbl(PropertiesLoad(load, 1, 0))For node = 1 To nrNodes - 1

If coor(sol, node, 0) <= posLoad Andcoor(sol, node + 1, 0) > posLoad Then

posBeam = posLoad - coor(sol, node, 0)beam = nodeExit For

End IfNextbeamList = CStr(beam)case = PropertiesLoad(load, 0, 2)axis = PropertiesLoad(load, 0, 3)projected = "NO"direction = PropertiesLoad(load, 0, 4)position = CStr(posBeam)

164

Page 183: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

value = PropertiesLoad(load, 0, 5)gsaObj.GwaCommand("SET,LOAD BEAM POINT," & beamList & "," & case & "," &axis & "," & projected & "," & direction & "," & position & "," & value)

End If

Next

End Sub

Sub HillClimbing(ByRef Variables(,) As Integer, ByRef count As Integer)

Dim DirectionStepsizeSeperated As Boolean = True

Dim value As Integer

Dim SensitivityAnalysisScale(2) As DoubleDim BestDirection As IntegerDim HighestPoint As DoubleDim HighestControlPoint As Integer

ReDim direction(nrControlPoints, nrDimensions)ReDim lowestStrainEnergy(nrControlPoints)ReDim ValueStepsize(nrControlPoints)ReDim rankControlPoints(nrControlPoints)ReDim MutationValue(cp, nrDimensions)

For u = 1 To nrControlPointsFor dmsn = 0 To 2

If Variables(u, dmsn) > 0 Thenvalue += 1Exit For

End IfNext

Next

Dono improv = False’na iedere nieuwe oplossing weer tot maxStepSize zoeken,zodat maximale stapgroootte ook weer kan!maxStepSize = 6 ’leegmaken, anders erbij opgeteldReDim SensitivityAnalysisValues(nrControlPoints, maxStepSize, 2, 2)

SensitivityAnalysisAndDetermineDirection(Variables, value)SensitivityAnalysisStepSize(Variables, value)DetermineStepSizesNewSolution()

If MutationRatio = True Thenrank ControlPoints(Variables, value)

End IfDetermineMutation(value)newLocalSolution(Variables, value)

ScaleFinalSolution(count, BestDirection, HighestPoint,HighestControlPoint,SensitivityAnalysisScale)

Loop Until no improv = True And count = -1

End Sub

Sub release solution(ByVal Variables(,) As Integer, ByVal value As Integer)

Dim u, dmsn As Integer

If newSolution = False ThenFor u = 0 To nrControlPoints + 1

For dmsn = 0 To 2tcp(1, u, dmsn) = tcp(0, u, dmsn)

NextNext

ElseIf newSolution = True ThenIf maxStepSize > 0 And LowestStepSize > 0 Then

165

Page 184: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX D. IMPROVED STEEPEST DESCENT HILL CLIMBING

LowestStepSize -= 1If maxStepSize > LowestStepSize Then

maxStepSize = LowestStepSizeElse

maxStepSize -= 1End If

gsaObj.Delete("results")DetermineStepSizesNewSolution()If MutationRatio = True Then

rank ControlPoints(Variables, value)End IfDetermineMutation(value)newLocalSolution(Variables, value)

ElseIf MutationRatio = False And maxStepSize = 0 ThenmaxStepSize = 6MutationRatio = True

gsaObj.Delete("results")DetermineStepSizesNewSolution()rank ControlPoints(Variables, value)DetermineMutation(value)newLocalSolution(Variables, value)

ElseIf MutationRatio = True And maxStepSize = 0 ThenFor u = 0 To nrControlPoints + 1

For dmsn = 0 To 2tcp(1, u, dmsn) = tcp(0, u, dmsn)

NextNextreplaceIfBetter(Variables, value)

End IfEnd If

End Sub

Sub SensitivityAnalysisAndDetermineDirection(ByVal Variables(,) As Integer, ByVal value As Integer)

Dim u As IntegerDim lowestValue As DoubleDim pert0, pert2 As IntegerDim increaseStepSize As Integer = 2

’appply mutation per node

For u = 1 To nrControlPoints

If Variables(u, 0) = 1 And Variables(u, 2) = 1 Then

lowestValue = 999999999For pert0 = 0 To 2

For pert2 = 0 To 2Analysis(Variables, value, u, increaseStepSize, pert0, pert2)If SensitivityAnalysisValues(u, increaseStepSize, pert0, pert2) <lowestValue Then

lowestValue = SensitivityAnalysisValues(u, increaseStepSize, pert0, pert2)direction(u, 0) = pert0direction(u, 2) = pert2

End IfNext

Next

ElseIf Variables(u, 0) = 0 And Variables(u, 2) = 1 Then

lowestValue = 999999999For pert2 = 0 To 2

pert0 = 0Analysis(Variables, value, u, increaseStepSize, pert0, pert2)If SensitivityAnalysisValues(u, increaseStepSize, pert0, pert2)< lowestValue Then

lowestValue = SensitivityAnalysisValues(u, increaseStepSize, pert0, pert2)direction(u, 2) = pert2

End IfNext

166

Page 185: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

ElseIf Variables(u, 0) = 1 And Variables(u, 2) = 0 Then

lowestValue = 999999999For pert0 = 0 To 2

pert2 = 0Analysis(Variables, value, u, increaseStepSize, pert0, pert2)If SensitivityAnalysisValues(u, increaseStepSize, pert0, pert2)< lowestValue Then

lowestValue = SensitivityAnalysisValues(u, increaseStepSize, pert0, pert2)direction(u, 0) = pert0

End IfNext

End If

Next

End Sub

Sub SensitivityAnalysisStepSize(ByVal Variables(,) As Integer, ByVal value As Integer)

Dim u As IntegerDim PerformAnalysis As Boolean = FalseDim increaseStepSize As Integer

’appply mutation per node

For u = 1 To nrControlPoints

If Variables(u, 0) = 1 And Variables(u, 2) = 1 ThenFor increaseStepSize = 0 To maxStepSize

If increaseStepSize <> 2 ThenAnalysis(Variables, value, u, increaseStepSize, direction(u, 0), direction(u, 2))

End IfNext increaseStepSize

ElseIf Variables(u, 0) = 0 And Variables(u, 2) = 1 ThenFor increaseStepSize = 0 To maxStepSize

If increaseStepSize <> 2 ThenAnalysis(Variables, value, u, increaseStepSize, 0, direction(u, 2))

End IfNext increaseStepSize

End IfNext u

End Sub

Sub Analysis(ByVal Variables(,) As Integer, ByVal value As Integer, ByVal u As Integer, ByValincreasestepsize As Integer, ByVal pert0 As Integer, ByVal pert2 As Integer)

Dim uu As IntegerDim dmsn As IntegerDim PerformAnalysis As BooleanDim stepsize As SingleDim mutation0, mutation2 As SingleDim Load As IntegerDim nrOfLoad As Integer = CInt(gsaObj.GwaCommand("highest,load beam")) + CInt(gsaObj.GwaCommand("highest,load node"))Dim LoadCase As Integer

newSolution = Falsestepsize = 80stepsize = CSng(stepsize / (2 ^increasestepsize))

’copy initial geometry

For uu = 0 To cpFor dmsn = 0 To 2

tcp(1, uu, dmsn) = Math.Round(tcp(0, uu, dmsn), 3)Next

Next

’apply perturbation, analyse each modification andput in array

167

Page 186: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX D. IMPROVED STEEPEST DESCENT HILL CLIMBING

If pert0 >= 1 Thenmutation0 = CSng((pert ^pert0) / stepsize)

ElseIf pert0 = 0 Thenmutation0 = 0

End IfIf pert2 >= 1 Then

mutation2 = CSng((pert ^pert2) / stepsize)ElseIf pert2 = 0 Then

mutation2 = 0End Iftcp(1, u, 0) += mutation0

tcp(1, u, 2) += mutation2

’bepalen of de gemuteerde waarde nog binnen de vastgestelde grenzen valtPerformAnalysis = FalseIf (LimitDesignSpace(u, 0, 0) <> LimitDesignSpace(u, 0, 1)) Then

If Variables(u, 0) <> 0 ThenIf (tcp(1, u, 0) > LimitDesignSpace(u, 0, 1)) Or (tcp(1, u, 0) <LimitDesignSpace(u, 0, 0)) Then

tcp(1, u, 0) = tcp(0, u, 0)direction(u, 0) = 0

ElsePerformAnalysis = True

End IfEnd If

End If

If (LimitDesignSpace(u, 2, 0) <> LimitDesignSpace(u, 2, 1)) ThenIf Variables(u, 2) <> 0 Then

If tcp(1, u, 2) > LimitDesignSpace(u, 2, 1) Or tcp(1, u, 2) <LimitDesignSpace(u, 2, 0) Then

tcp(1, u, 2) = tcp(0, u, 2)direction(u, 2) = 0

ElsePerformAnalysis = True

End IfEnd If

End If

If PerformAnalysis = True Then

’geen puntlast op de knoopIf Variables(u, 3) = 0 Then

If u > 1 Then’puntlast op naastliggende knoopIf Variables(u - 2, 3) > 0 And (u - 2) > 1 Then

Load = CInt(Variables(u - 2, 3))For dmsn = 0 To 2

tcp(1, u - 1, dmsn) = tcp(1, u - 2, dmsn) +(1 - RoundingEdge(Load)) * ((1 / 2) * tcp(1, u, dmsn) -(1 / 2) * tcp(1, u - 2, dmsn))

NextEnd If

End If

If u < nrControlPoints Then’puntlast op naastliggende knoopIf Variables(u + 2, 3) > 0 And (u + 2) < nrControlPoints Then

Load = CInt(Variables(u + 2, 3))For dmsn = 0 To 2

tcp(1, u + 1, dmsn) = tcp(1, u + 2, dmsn) +(1 - RoundingEdge(Load)) * ((1 / 2) * tcp(1, u, dmsn) -(1 / 2) * tcp(1, u + 2, dmsn))

NextEnd If

End If

ElseIf Variables(u, 3) > 0 Then’puntlast op knoopLoad = CInt(Variables(u, 3))For dmsn = 0 To 2

tcp(1, u - 1, dmsn) = tcp(1, u, dmsn) + (1 - RoundingEdge(Load)) *((1 / 2) * tcp(1, u - 2, dmsn) - (1 / 2) * tcp(1, u, dmsn))

168

Page 187: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

tcp(1, u + 1, dmsn) = tcp(1, u, dmsn) + (1 - RoundingEdge(Load)) *((1 / 2) * tcp(1, u + 2, dmsn) - (1 / 2) * tcp(1, u, dmsn))

NextEnd If

’if mutation is reset, then pert2 is not reset.’the corresponding strain energy is equal to the initial,implying this solution will never be chosen.’hence, pert2 can be used to determine the final geometry.

’calculate accompanying phantom nodesFor dmsn = 0 To 2

tcp(1, 0, dmsn) = 2 * tcp(1, 1, dmsn) - tcp(1, 2, dmsn)tcp(1, cp, dmsn) = 2 * tcp(1, nrControlPoints, dmsn) -tcp(1, nrControlPoints - 1, dmsn)

Next

’round offFor uu = 0 To cp

For dmsn = 0 To 2tcp(1, uu, dmsn) = Math.Round(tcp(1, uu, dmsn), 3)

NextNext

coordinates(1)End If

If LoopExists = True Or PerformAnalysis = False Then

release solution(Variables, value)SensitivityAnalysisValues(u, increasestepsize, pert0, pert2) =StrainEnergy(0)

ElseIf LoopExists = False And PerformAnalysis = True Then

export(1)gsaObj.Analyse()

For LoadCase = 1 To nrLoadCasesStrainEnergyLoadCases(LoadCase, 1) = 0For beam = 1 To nrBeams

StrainEnergyLoadCases(LoadCase, 1) += CSng(gsaObj.Arg(3, CStr(gsaObj.GwaCommand("GET,STRAIN ENERGY," & beam &"," & LoadCase))))

Next beamStrainEnergyLoadCases(LoadCase, 1) =CSng(StrainEnergyLoadCases(LoadCase, 1).ToString("e4"))

Next

rank LoadCases()For LoadCase = 1 To nrLoadCases

SensitivityAnalysisValues(u, increasestepsize, pert0, pert2) +=CSng(SensitivityLoadCases(LoadCase))

Next

SensitivityAnalysisValues(u, increasestepsize, pert0, pert2) =CSng(SensitivityAnalysisValues(u, increasestepsize, pert0, pert2).ToString("e4"))gsaObj.Delete("results")

End If

End Sub

Sub rank LoadCases()

Dim LoadCase As Integer

’negative sensitivity implies a reduction in strain energy

For LoadCase = 1 To nrLoadCasesrankLoadCases(LoadCase) = 0’lagere sensitivity is gunstiger

169

Page 188: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX D. IMPROVED STEEPEST DESCENT HILL CLIMBING

SensitivityLoadCases(LoadCase) = StrainEnergyLoadCases(LoadCase, 1) -StrainEnergyLoadCases(LoadCase, 0)

Next

End Sub

Sub DetermineStepSizesNewSolution()

Dim E s As SingleDim increaseStepSize As Integer

’voor u kijken wat richting het beste is geweest, en welke stapgrootte daarbij hoort

For u = 1 To nrControlPointsE s = 99999999999For increaseStepSize = 0 To maxStepSize

If SensitivityAnalysisValues(u, increaseStepSize,direction(u, 0), direction(u, 2)) < E s Then

E s = SensitivityAnalysisValues(u, increaseStepSize,direction(u, 0), direction(u, 2))lowestStrainEnergy(u) = E sValueStepsize(u) = increaseStepSize

End IfNext

Next

End Sub

Sub rank ControlPoints(ByVal Variables(,) As Integer, ByVal value As Integer)

Dim r As IntegerDim E s As SingleDim nr As Integer

’rank(u) = 1 geeft de hoogste strain energy waarde, dus de slechtste oplossingReDim rankControlPoints(nrControlPoints)

Forr = 1 To valueE s = -999999999999999For u = 1 To nrControlPoints

If Variables(u, 0) = 1 Or Variables(u, 1) = 1 Or Variables(u, 2) =1 Then

If lowestStrainEnergy(u) > E s And rankControlPoints(u) = 0Then

E s = lowestStrainEnergy(u)nr = u

End IfEnd If

NextrankControlPoints(nr) = r Next

End Sub

Sub DetermineMutation(ByVal value As Integer)

Dim u, dmsn As IntegerDim stepsize As Single

’NOTE even if direction(u,dmsn)=0, to the power yields 1ReDim MutationValue(cp, nrDimensions)

For u = 1 To nrControlPointsstepsize = CSng(80 / (2 ^ValueStepsize(u)))For dmsn = 0 To 2

If dmsn <> 1 And direction(u, dmsn) <> 0 ThenIf MutationRatio = False Then

MutationValue(u, dmsn) =CSng(((pert ^direction(u, dmsn)) / stepsize))

ElseIf MutationRatio = True ThenMutationValue(u, dmsn) =CSng(((pert ^direction(u, dmsn)) / stepsize) *rankControlPoints(u) * (1 / (value)))

End IfEnd If

NextNext

170

Page 189: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

End Sub

Sub newLocalSolution(ByVal Variables(,) As Integer, ByVal value As Integer)

Dim u, dmsn As IntegerDim Load As Integer

newSolution = True

’copy initial geometry and mutate

For u = 0 To cpFor dmsn = 0 To 2

tcp(1, u, dmsn) = tcp(0, u, dmsn) + MutationValue(u, dmsn)Next

Next

Load = 2For u = 2 To nrControlPoints - 1

If Variables(u, 3) > 0 Then ’puntlast op knoopLoad += 1For dmsn = 0 To 2

tcp(1, u - 1, dmsn) = tcp(1, u, dmsn) + (1 - RoundingEdge(Load)) *((1 / 2) * tcp(1, u - 2, dmsn) - (1 / 2) * tcp(1, u, dmsn))tcp(1, u + 1, dmsn) = tcp(1, u, dmsn) + (1 - RoundingEdge(Load)) *((1 / 2) * tcp(1, u + 2, dmsn) - (1 / 2) * tcp(1, u, dmsn))

NextEnd If

Next

’calculate new phantom nodesFor dmsn = 0 To 2

tcp(1, 0, dmsn) = 2 * tcp(1, 1, dmsn) - tcp(1, 2, dmsn)tcp(1, nrControlPoints + 1, dmsn) = 2 * tcp(1, nrControlPoints, dmsn) -tcp(1,nrControlPoints - 1, dmsn)

Next

For u = 0 To cpFor dmsn = 0 To 2

tcp(1, u, dmsn) = Math.Round(tcp(1, u, dmsn), 3)Next

Next

’analyse new modified solutioncoordinates(1)

If LoopExists = True ThenLowestStepSize = 0For u = 0 To nrControlPoints - 1

If ValueStepsize(u) > LowestStepSize ThenLowestStepSize = ValueStepsize(u)

End IfNextrelease solution(Variables, value)

ElseIf LoopExists = False Thenexport(1)GetStrainEnergy(1)replaceIfBetter(Variables, value)

End If

End Sub

Sub replaceIfBetter(ByVal Variables(,) As Integer, ByVal value AsInteger)

Dim u As IntegerDim dmsn As IntegerDim count As Integer

’replace solution if modified one is betteriteration += 1

171

Page 190: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX D. IMPROVED STEEPEST DESCENT HILL CLIMBING

If StrainEnergy(1) < StrainEnergy(0) Then

count += 1total += 1For u = 0 To cp

For dmsn = 0 To 2tcp(0, u, dmsn) = tcp(1, u, dmsn)

NextNext

StrainEnergy(0) = StrainEnergy(1)For loadcase = 1 To nrLoadCases

StrainEnergyLoadCases(loadcase, 0) = StrainEnergyLoadCases (loadcase, 1)Next

If count = 1 ThenOutputGSAViews()

ElseIf count = 10 Thencount = 0

End If

gsaObj.Delete("results")writing file(1)

’this assures mutation based on ratio are only performed once, to search for a new path’it is set back to apply maximal mutations, as this is faster,’and is capable of escaping from the local optimumMutationRatio = False

Else

If maxStepSize > 0 ThenLowestStepSize = 0For u = 0 To nrControlPoints - 1

If ValueStepsize(u) > LowestStepSize ThenLowestStepSize = ValueStepsize(u)

End IfNext

If LowestStepSize > 0 ThenLowestStepSize -= 1

End If

If maxStepSize > LowestStepSize ThenmaxStepSize = LowestStepSize

ElsemaxStepSize -= 1

End If

gsaObj.Delete("results")DetermineStepSizesNewSolution()If MutationRatio = True Then

rank ControlPoints(Variables, value)End IfDetermineMutation(value)newLocalSolution(Variables, value)

ElseIf MutationRatio = False And maxStepSize = 0 Then

maxStepSize = 6MutationRatio = True

gsaObj.Delete("results")DetermineStepSizesNewSolution()rank ControlPoints(Variables, value)DetermineMutation(value)newLocalSolution(Variables, value)

ElseIf (MutationRatio = True And maxStepSize = 0) Or StrainEnergy(1) = StrainEnergy(0) Thenno improv = TrueExit Sub

End If

End If

172

Page 191: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

End Sub

Sub writing file(ByVal sol As Integer)

Dim ws, u, columnNr As Integerws = 1

’get correct worksheetoSheet = DirectCast(oWB.Worksheets(ws), Excel.Worksheet)oSheet.Cells(total, 1) = iterationoSheet.Cells(total, 2) = StrainEnergy(sol)

columnNr = 2

For dmsn = 0 To 2If dmsn <> 1 Then

For u = 1 To nrControlPointscolumnNr += 1oSheet.Cells(total, columnNr) = tcp(sol, u, dmsn)

NextEnd If

NextcolumnNr += 1oSheet.Cells(total, columnNr) = "Hill Climbing"

ws = 2oSheet = DirectCast(oWB.Worksheets(ws), Excel.Worksheet)For loadcase = 1 To nrLoadCases

oSheet.Cells(total, loadcase) = StrainEnergyLoadCases(loadcase, sol)Next

End Sub

Sub ScaleFinalSolution(ByRef count As Integer, ByRef BestDirection As Integer, ByRef HighestPointAs Double, ByRef HighestControlPoint As Integer, ByRef SensitivityAnalysisScale() As Double)

Dim SensitivityAnalysisBestDirection As SingleDim ScaleDirection As Integer

count = -1

If no improv = False Then

SensitivityAnalysisBestDirection = 999999999BestDirection = 0For ScaleDirection = 1 To 2

SearchForOptimumHeight(ScaleDirection, SensitivityAnalysisScale)If StrainEnergy(1) < StrainEnergy(0) Then

If SensitivityAnalysisScale(ScaleDirection) <SensitivityAnalysisBestDirection Then

BestDirection = ScaleDirectionEnd If

End IfgsaObj.Delete("results")

NextEnd If

If BestDirection > 0 ThenIf total > 1 Then

total += 1End If

’replace solution 0For u = 1 To nrControlPoints

tcp(0, u, 2) = Math.Round(tcp(0, u, 2) * (1 + (pert ^BestDirection * 0.05)), 5)Nexttcp(0, 0, 2) = Math.Round(2 * tcp(0, 1, 2) - tcp(0, 2, 2), 5)tcp(0, cp, 2) = Math.Round(2 * tcp(0, nrControlPoints, 2) - tcp(0, nrControlPoints - 1, 2), 5)

StrainEnergy(0) = StrainEnergy(1)SensitivityAnalysisScale(0) = SensitivityAnalysisScale(BestDirection)

173

Page 192: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX D. IMPROVED STEEPEST DESCENT HILL CLIMBING

DoSearchForOptimumHeight(BestDirection, SensitivityAnalysisScale)ReplaceByScaledSolution(BestDirection, SensitivityAnalysisScale, count)

Loop Until count = -1 Or count = 1

End If

End Sub

Sub SearchForOptimumHeight(ByVal ScaleDirection As Integer,ByRef SensitivityAnalysisScale() As Double)

For u = 0 To cpFor dmsn = 0 To nrDimensions

tcp(1, u, dmsn) = tcp(0, u, dmsn)Next

Next

For u = 2 To nrControlPoints - 1tcp(1, u, 2) = Math.Round(tcp(1, u, 2) *(1 + (pert ^ScaleDirection * 0.05)), 5)

Nexttcp(1, 0, 2) = Math.Round(2 * tcp(1, 1, 2) - tcp(1, 2, 2), 3)tcp(1, cp, 2) = Math.Round(2 * tcp(1, nrControlPoints, 2) -tcp(1, nrControlPoints - 1, 2), 3)

coordinates(1)If LoopExists = True Then

’het is onmogelijk dat dit optreedt als de coordinaten verschaaldworden’het kan wel als de controle punten verschaald wordenStrainEnergy(1) = StrainEnergy(0)

Elseexport(1)gsaObj.Analyse()StrainEnergy(1) = 0For loadcase = 1 To nrLoadCases

StrainEnergyLoadCases(loadcase, 1) = 0For beam = 1 To nrBeams

StrainEnergyLoadCases(loadcase, 1) +=CSng(gsaObj.Arg(3, CStr(gsaObj.GwaCommand("GET,STRAIN ENERGY,"& beam & "," & loadcase))))

Next beamStrainEnergyLoadCases(loadcase, 1) =CSng(StrainEnergyLoadCases(loadcase, 1).ToString("e4"))StrainEnergy(1) += StrainEnergyLoadCases(loadcase, 1)

Nextrank LoadCases()

SensitivityAnalysisScale(ScaleDirection) = 0For =LoadCase = 1 To nrLoadCases

SensitivityAnalysisScale(ScaleDirection) += CSng(SensitivityLoadCases(LoadCase))Next

End If

End Sub

Sub ReplaceByScaledSolution(ByVal ScaleDirection As Integer, ByVal SensitivityAnalysisScale()As Double, ByRef count As Integer)

Dim loadcase As IntegerDim columnNr As IntegerDim count As Integer

If StrainEnergy(1) < StrainEnergy(0) Thencount += 1no improv = FalseMutationRatio = False

For u = 0 To cptcp(0, u, 2) = tcp(1, u, 2)

Next

SensitivityAnalysisScale(0) = SensitivityAnalysisScale(ScaleDirection)

174

Page 193: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

StrainEnergy(0) = StrainEnergy(1)For loadcase = 1 To nrLoadCases

StrainEnergyLoadCases(loadcase, 0) = StrainEnergyLoadCases(loadcase, 1)Next

If count = -1 Thencount = 0

End If

count += 1If count = 1 Then

OutputGSAViews()ElseIf count = 10 Then

count = 0End If

gsaObj.Delete("results")

total += 1

oSheet = DirectCast(oWB.Worksheets(1), Excel.Worksheet)oSheet.Cells(total, 1) = iterationoSheet.Cells(total, 2) = StrainEnergy(0)

columnNr = 2For dmsn = 0 To 2

If dmsn <> 1 ThenFor u = 1 To nrControlPoints

columnNr += 1oSheet.Cells(total, columnNr) = tcp(0, u, dmsn)

NextEnd If

Next

oSheet = DirectCast(oWB.Worksheets(2), Excel.Worksheet)For loadcase = 1 To nrLoadCases

oSheet.Cells(total, loadcase) = StrainEnergyLoadCases(loadcase, 0)Next

Else

count = -1

End If

End Sub

Sub GetStrainEnergy(ByVal sol As Integer)

Dim beam As IntegerDim LoadCase As Integer

StrainEnergy(sol) = 0

For LoadCase = 1 To nrLoadCasesStrainEnergyLoadCases(LoadCase, sol) = 0

NextgsaObj.Delete("results")gsaObj.Analyse()

For LoadCase = 1 To nrLoadCasesFor beam = 1 To nrBeams

StrainEnergy(sol) += CSng(gsaObj.Arg(3, CStr(gsaObj.GwaCommand("GET,STRAIN ENERGY," & beam & "," & LoadCase))))StrainEnergyLoadCases(LoadCase, sol) += CSng(gsaObj.Arg(3,CStr(gsaObj.GwaCommand("GET,STRAIN ENERGY," & beam & "," & LoadCase))))

Next beamNextStrainEnergy(sol) = CSng(StrainEnergy(sol).ToString("e4"))

For LoadCase = 1 To nrLoadCasesStrainEnergyLoadCases(LoadCase, sol) = CSng(StrainEnergyLoadCases (LoadCase, sol).ToString("e4"))

Next

175

Page 194: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

APPENDIX D. IMPROVED STEEPEST DESCENT HILL CLIMBING

End Sub

Sub OutputGSAViews()

’gsaObj.SaveViewToFile("ALL SGV", "PNG")gsaObj.SaveViewToFile("1:300 geometry", "PNG")

End Sub

Private Sub Form1 Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

TxtMovementValueX.Text = "999"TxtMovementValueZ.Text = "999"TxtRoundingEdge.Text = "1"

End Sub

End Class

176

Page 195: Eindhoven University of Technology MASTER Structural design support of free … · Structural design support of free forms Linh, S.L. Award date: 2012 Link to publication Disclaimer

References

[1] K. Saitou, K. Izui, S. Nishiwaki, and P. Papalambros. A

survey of Structural Optimization in Mechanical Product

Development. Journal of Computing and Information Science

in Engineering, 5:214--226, 2005.

[2] J. Dro. Shortest Path Find by an Ant Colony, May 2006.

[3] E. de Villiers.

[4] J. Redmond, editor. Generative Design: a Paradigm for

Design Research. Design Research Society, Melbourne,

2004.

[5] T.S. Kuhn. The Structure of Scientific Revolutions.

University of Chicago Press, Chicago, 1996.

[6] A. Domingo and C. Lazaro, editors. About the Freedom of

Free Forms, 2009.

[7] G. Nordenson, editor. Seven Structural Engineers: the

Felix Candela Lectures. The Museum of Modern Art, New

York, 2008.

[8] M. Burry, S. Datta, A. Dawson, and A.J. Rollo, editors.

The Analytical and Numerical Definition of the Geometry

of the British Museum Great Court Roof. Mathematics &

Design, Deakin University, Geelong, Victoria, Australia,

2001.

[9] D. Salomon. Curves and Surfaces for Computer Graphics.

Springer Science+Business Media, Inc., New York, 2006.

[10] P. Y. Papalambros and D.J. Wilde. Principles of Optimal

Desgn: Modeling and Computation. Cambridge University

Press, New York, 2000.

[11] J.E. Gordon. Structures: Or Why Things Don’t Fall Down.

Da Capo Press, 1981.

[12] T. Kimura and H. Ohmori. Computational Morphogenesis

of Free Form Shells. Journal of the International

Association for Shell and Spatial Structures,

49:175--180, 2008.

[13] Singiresu S. Rao. Engineering Optimization: Theory and

Practice. Wiley-Interscience, Chichester, 1996.

[14] D. Herremans. Tabu Search voor de Optimalisatie van

Muzikale Fragmenten. PhD thesis, Universiteit Antwerpen,

Faculteit Toegepaste Economische Wetenschappen, 2005.

[15] E. Alba, editor. Parallel Metaheuristics: A New Class

of Algorithms. John Wiley & Sons, Inc., Hoboken, New

Jeersey, 2005.

[16] N.D. Lagaros, M. Papadrakakis, and G. Kokossalakis.

Structural Optimizationg Using Evolutionary Algorithms.

Computer and Structures, 80:571--589, 2002.

[17] F. van Keulen, R.T. Haftka, and N.H. Kim. Review of

Options for Structural Design Sensivitiy Analysis. Part

1: Linear Systems. Computation Methods in Applied

Mechanics and Engineering, 194:3213--3243, 2005.

[18] P. Gray, W. Hart, L. Painton, C. Phillips, M. Trahan, and

J. Wagner. A Survey of Global Optimization Methods, March

1997.

[19] Y.M. Xie and G.P. Steven. Evolutionary Structural

Optimization. Springer, Berlin, 1997.

[20] A.E. Eiben and J.E. Smith. Introduction to Evolutionary

Computing. Springer, 2003.

[21] T. Back, D.B. Fogel, and Z. Michalewicz, editors.

Handbook of Evolutionary Computation. Taylor & Francis

Group, 1997.

[22] M. Gendreau and J.Y Potvin. Handbook of Metaheuristics.

Springer Science+Business Media, Boston MA, 2010.

[23] E.O. Wilson. The New Synthesis. Cambridge, MA: Belknap,

1975.

[24] A. Tomas and P. Marti. Shape and Size Optimisation of

Concrete Shells. Engineering Structures, 32:1650--1658,

2010.

[25] A. Pugnale and M. Sassone. Morphogenesis and Structural

Optimization of Shell Structures With the Aid of a

Genetic Algorithm. Journal of the International

Association for Shell and Spatial Structures,

48:161--166, 2007.

[26] B. Pham. Offset Approximation of Uniform B-splines.

Computer-Aided Design, 20:471--474, 1988.

[27] Q. Li, G.P. Steven, and Y.M. Xie. An Evolutionart

Shape Optimization for Elastic Contact Problems Subject

to Multiple Load Cases. Computer Methods in Applied

Mechanics and Engineering, 194:3394--3415, 2005.

[28] Q. Li, G.P. Steven, and Y.M. Xie. Evolutionary

Thickness Design with Stiffness Maximization and Stress

Minimization Criteria. International Journal for

Numerical Methods in Engineering, 52:979--995, 2001.

177