Design Optimization Using MATLAB and SOLIDWORKS 1st Edition Suresh Download
Design Optimization Using MATLAB and SOLIDWORKS 1st Edition Suresh Download
https://textbookfull.com/product/design-optimization-using-
matlab-and-solidworks-1st-edition-suresh/
https://textbookfull.com/product/linear-programming-using-matlab-
springer-optimization-and-its-applications-127-ploskas/
https://textbookfull.com/product/design-and-optimization-of-
thermal-systems-with-matlab-applications-yogesh-jaluria/
https://textbookfull.com/product/regularized-image-
reconstruction-in-parallel-mri-with-matlab-1st-edition-joseph-
suresh-paul/
https://textbookfull.com/product/compact-heat-exchangers-
analysis-design-and-optimization-using-fem-and-cfd-approach-1st-
edition-c-ranganayakulu/
MATLAB Optimization Toolbox User s Guide The Mathworks
https://textbookfull.com/product/matlab-optimization-toolbox-
user-s-guide-the-mathworks/
https://textbookfull.com/product/fundamentals-of-graphics-using-
matlab-1st-edition-ranjan-parekh/
https://textbookfull.com/product/programming-mathematics-using-
matlab-1st-edition-lisa-a-oberbroeckling/
https://textbookfull.com/product/programming-mathematics-using-
matlab-1st-edition-oberbroeckling-lisa-a/
https://textbookfull.com/product/programming-mathematics-using-
matlab-1st-edition-oberbroeckling-lisa-a-2/
Design Optimization
using MATLAB® and
®
SOLIDWORKS
Krishnan Suresh
Design Optimization using MATLAB® and SOLIDWORKS®
Krishnan Suresh
University of Wisconsin–Madison
University Printing House, Cambridge CB2 8BS, United Kingdom
One Liberty Plaza, 20th Floor, New York, NY 10006, USA
477 Williamstown Road, Port Melbourne, VIC 3207, Australia
314–321, 3rd Floor, Plot 3, Splendor Forum, Jasola District Centre,
New Delhi – 110025, India
79 Anson Road, #06–04/06, Singapore 079906
www.cambridge.org
Information on this title: www.cambridge.org/suresh
DOI: 10.1017/9781108869027
© Krishnan Suresh 2021
This publication is in copyright. Subject to statutory exception
and to the provisions of relevant collective licensing agreements,
no reproduction of any part may take place without the written
permission of Cambridge University Press.
First published 2021
Printed in the United Kingdom by TJ Books Limited, Padstow Cornwall
A catalogue record for this publication is available from the British Library.
Library of Congress Cataloging-in-Publication Data
Names: Suresh, Krishnan, 1970– author.
Title: Design optimization using MATLAB and SOLIDWORKS / Krishnan Suresh.
Description: Cambridge, United Kingdom ; New York, NY : Cambridge University Press, 2021. |
Series: Cambridge texts in biomedical engineering | Includes bibliographical references and index.
Identifiers: LCCN 2020052134 | ISBN 9781108491600 (hardback) | ISBN 9781108869027 (ebook)
Subjects: LCSH: MATLAB. | SolidWorks. | Engineering design – Data processing – Textbooks. |
Mathematical optimization – Textbooks.
Classification: LCC TA174 .S925 2021 | DDC 620/.00420285536–dc23
LC record available at https://lccn.loc.gov/2020052134
ISBN 978-1-108-49160-0 Hardback
Additional resources for this publication at www.cambridge.org/highereducation/suresh
Cambridge University Press has no responsibility for the persistence or accuracy of
URLs for external or third-party internet websites referred to in this publication
and does not guarantee that any content on such websites is, or will remain,
accurate or appropriate.
Dedicated to my family.
They mean the world to me.
Contents
1 Introduction 1
1.1 An Example of Optimization 1
1.2 Challenges 1
1.3 MATLAB Code 3
1.4 Organization of Text 3
2 Modeling 7
2.1 Standard Optimization Formulation 7
2.2 Illustrative Examples 9
2.3 Geometry Problems 10
2.4 Analytical Design Problems 16
2.5 Structural Analysis 18
2.6 Structural Optimization 23
2.7 Conclusions and Observations 25
2.8 Exercises 26
3 Introduction to MATLAB 30
3.1 Basics 30
3.2 MATLAB Code Resource 33
3.3 Memory Pre-allocation and Vectorization 34
3.4 MATLAB Script Files 34
3.5 Linear Algebra 36
3.6 Complex Numbers 37
3.7 Plots 37
3.8 Symbolic Operations 39
3.9 User-Defined Functions 40
3.10 Variable Arguments 41
3.11 Solving Non-linear Equations 42
3.12 Modules 44
3.13 Sampling Algorithm 45
3.14 Polynomial Class 47
3.15 Extending the Polynomial Class 51
3.16 Exercises 52
vii
viii Contents
References 375
Index 377
Preface
Target Audience
The primary audience for this text includes senior undergraduate students, junior
graduate students and practicing engineers. Given this wide audience, prerequis-
ites are kept to a minimum. Basic undergraduate-level mathematics is assumed,
but no prior background in optimization is required. Prior experience in pro-
gramming, especially MATLAB, is helpful.
Topics Covered
This text covers three complementary topics in optimization: (1) the underlying
mathematics, (2) numerical methods and nuances and (3) engineering
applications.
On the first topic, we will recall basic results from single- and multi-variable
calculus. Emphasis is given to conceptual understanding of theorems rather than
to elaborate proofs (which can be found in mathematically oriented texts).
The second topic, numerical methods, lies at the heart of optimization. It is
impossible to understand optimization without a good grasp of numerical
methods. Therefore, this text encourages the reader to implement simple opti-
mization methods “from scratch,” before delving into MATLAB’s optimization
toolbox. This will provide a good understanding of how optimization algorithms
work, or sometimes fail! Besides the generic class of constrained non-linear
optimization problems, we will also discuss special types of problems, including
linear-programming problems, least-squares problems and multi-objective prob-
lems, that require special treatment. Finally, we will briefly explore global opti-
mization methods that are becoming increasingly important in engineering.
xiii
xiv Preface
Software Resources
This text assumes that the reader has access to MATLAB® (www.mathworks.com).
The MATLAB code accompanying this text is an integral part of student learning,
and can be downloaded from the author’s website at www.ersl.wisc.edu under the
“Research” tab. The MATLAB code is object-oriented; it teaches the basic concepts
of data encapsulation, inheritance and code reuse. Through exercises, the reader will
learn to extend the code to address various optimization problems.
In the last couple of chapters, we will create and analyze 3D designs using
SOLIDWORKS® (www.solidworks.com). It is assumed that the reader is famil-
iar with creating simple models in SOLIDWORKS. Basic finite element analysis
using SOLIDWORKS is covered in the text. Then a toolbox, namely
SOLIDLAB, which serves as an interface between SOLIDWORKS and
MATLAB, is presented; SOLIDLAB was developed by the author’s research
group. Through SOLIDLAB, one can, for example, modify feature dimensions
of SOLIDWORKS models, query mass properties, carry out a finite element
analysis and optimize, all from within the comfort of MATLAB.
Acknowledgments
Textbook writing inevitably takes time away from family, and I would like to
acknowledge the support of my dear wife, Vanitha, for her constant encouragement
to finish this text. Meanwhile, our two sons, Sanjay and Arjun, have smartly learned
to work around my busy schedule. I would also like to thank my graduate students:
Preface xv
1.2 Challenges
There are numerous such “simple” optimization examples in engineering.
However, in the author’s experience, while solving such problems engineers
often run into several challenges: (1) How does one translate the above problem
1
2 1 Introduction
After reading through this text, and completing the exercises, the author
sincerely believes that the reader will be able to answer such questions confi-
dently, and also extend the concepts to his/her field of study.
Study of optimization can be fun and enriching. However, for most effective
learning, engineers should study optimization within the context of a relevant and
familiar application. Learning to code sophisticated optimization methods, with-
out understanding why these different methods exist in the first place, is both
meaningless and counterproductive. Therefore, this text introduces fundamental
optimization concepts through concrete applications.
For example, to introduce the important concept of numerical scaling, we will
consider optimizing a truss system. We will observe that, without numerical
scaling, even the best optimization method will not converge correctly. By con-
sidering a variety of such applications, fundamental optimization concepts can be
assimilated easily.
No prior background in optimization is assumed in this text; basic undergradu-
ate-level mathematics is sufficient. Prior experience in programming, especially
MATLAB programming [2], is helpful. For this text, we will rely entirely on
MATLAB programming, basics of which are covered in Chapters 3, 6 and 7.
Applications
Engineering
Optimization
Mathematics Numerics
Figure 1.4 Engineering optimization encompasses three topics: mathematics, numerics and
applications.
Highlights
1. This chapter discusses modeling, the first step in optimization. Modeling is the
process of converting a loosely worded optimization problem into a formal
mathematical statement.
2. Several modeling examples from geometry and structural mechanics are
considered, and each example is converted into the standard formulation.
3. Through these examples, relevant optimization terminology is also
explained.
4. Finally, important observations are made about modeling; these include:
(1) introducing appropriate design variables, (2) exploiting optimality criteria
for simplification and (3) the iterative nature of modeling.
minimize f ðxÞ
x
s:t: hi ðxÞ ¼ 0; i ¼ 1; 2; …
gj ðxÞ ≤ 0; j ¼ 1; 2; …
xmin ≤ x ≤ xmax
x ¼ fx1 x2 . . . xN g (2.1)
7
8 2 Modeling
where
• f ðxÞ is the single objective that we are trying to minimize. Given a loosely
worded problem statement, the first task is to identify and quantify the object-
ive. In structural design problems, the objective is typically the volume or
weight of a part, or the maximum deflection, or the maximum stress, and so
on. Two points are worth noting here: (1) Often, an engineer may be interested
in multiple objectives (for example, minimize weight and minimize stress); such
multi-objective problems are briefly considered in Section 6.7, but are not the
main focus of this text; further, it is often possible to interpret one or more of
these objectives as constraints. (2) If we desire to maximize an objective (for
example, maximize the stiffness of a part), it is easy to convert this into
a minimization problem in multiple ways, as discussed later on.
• x are the optimization or design variables. These are the free parameters that
can be modified to meet the objective. In structural design problems, these
could be geometric parameters (thickness of a truss member, the location
and size of a hole, topology), or material properties (Young’s modulus,
yield strength), and so on. In this text, we will assume that the optimization
variables are continuously varying (such as the radius of a hole). Discrete
variables, such as the number of holes in a design, are not explicitly treated
in this text; however, references and examples are provided on how such
integer problems can be handled.
• xmin and xmax are the lower and upper bounds on the optimization variables; for
example, a lower bound and/or upper bound on a hole radius. It is not essential
for optimization variables to exhibit lower and upper bounds. However, if such
bounds exist, it is important to include them in the problem statement.
• hi ðxÞ are the equality constraints; for example, “the diameter of truss member
A must be exactly equal to three times the diameter of truss member B.” While
we are not distinguishing here between linear and non-linear constraints in the
formulation, such differences can be important in numerical analysis. They are
highlighted later on.
• gj ðxÞ are the inequality constraints; for example, “the diameter of truss
member A must be less than three times the diameter of truss member B.”
Again, we are not distinguishing here between linear and non-linear inequal-
ity constraints, but such differences can be important in numerical analysis.
One can also impose an equality constraint linking the two variables:
8 qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi 2 1 qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi 2 9
>
<1 100 >
u þ ð1 þ vÞ 1 þ 50
2 2
u þ ð1 vÞ 1 =
2 2
minimize 2 2
fu;vg >
: >
;
ð10u þ 8vÞ
s:t: v u3 ¼ 0 (2.8)
The physical meaning behind such constraints is discussed later in this chapter,
and such constraints can completely change the complexity of the problem.
10 2 Modeling
y
y mx
q
p (x 0 , y0 )
(cont.)
that function vanishes at that point. Thus, differentiating the objective DðαÞ with
respect to α and setting it equal to zero will yield the value of α:
i.e.,
x0 þ my0
α¼ (2.12)
ð1 þ m2 Þ
Thus, the closest point is
x0 þ my0 mx0 þ m2 y0
q¼ ; (2.13)
ð1 þ m2 Þ ð1 þ m2 Þ
and the shortest distance is
jðx0 m y0 Þj
D ¼ pffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi (2.14)
ð1 þ m2 Þ
Caveat: We have not formally established that Equation (2.11) yields a minimum; we
shall address this in later chapters.
Verification: Verify whether the above solution yields the “expected answer.” For
example, suppose the straight line is the x axis, and p ¼ ð0; 1Þ: do you recover the
expected solution? Verification, if possible, is highly recommended in order to catch
modeling errors.
( xi , yi )
1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must,
at no additional cost, fee or expense to the user, provide a copy,
a means of exporting a copy, or a means of obtaining a copy
upon request, of the work in its original “Plain Vanilla ASCII” or
other form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.
• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.F.
Most people start at our website which has the main PG search
facility: www.gutenberg.org.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
textbookfull.com