代写 C algorithm math matlab Introduction to design optimization

Introduction to design optimization
ME 564/SYS 564 Wed Aug 29, 2018 Steven Hoffenson
Goal of Week 1: To become familiar with the concept of mathematical optimization, see some applications, & begin forming teams and topics
1

Optimization is trendy
Usage of the word “optimization” in books, as a percentage of all words
Source: Google ngrams
2

What is design optimization? Improving a design
Finding a solution that satisfies everyone
Increasing efficiency
Finding the best possible solution
Strictly speaking, design optimization is about mathematically finding the best possible design solution for given models and an objective
3

Every real-life problem is an optimization problem
4

Design an optimal automobile for you
• Speed
• Efficiency
• Safety
• Capacity (people) • Capacity (cargo) • Sales
5

How to optimize
1.
Formulate the problem
a) Define system boundaries
b) Develop analytical models
c) Explore/reduce the problem space
d) Formalize optimization problem
(Weeks 1-2, 4, 9-12)
2.
Solve the problem
a) Choose the right approach/algorithm
b) Solve (by hand, code, or software)
c) Interpret the results
d) Iterate if needed
(Weeks 3, 5-8, 12)
𝐱𝑘+1 = 𝐱𝑘 − 𝐇(𝐱𝑘) −1𝛁𝑓 𝐱0
6

1. Formulate the problem
a)
b) c) d)
Define system boundaries
What are we including? What are we assuming fixed? What are our objectives, constraints, variables, and parameters?
Develop analytical models
Are they theoretical (equation-based) or empirical (data-based)? Do they take a long time to evaluate? Can we use surrogate models?
Explore/reduce the problem space
Is there a feasible solution? Can we reduce the number of variables or constraints? Is the space convex? Are there local optima?
Formalize optimization problem
Write it out mathematically. Then, ask and adjust based on: Is it multi- disciplinary? Is it multi-objective? Is there uncertainty?
7

a) Define system boundaries
Air
Gas
Heat/fuel
Air
Combustor
Compressor
 Power to compressor 
Turbine
Power
Where you draw your box defines the problem space and ultimately the design solution
8

Objectives, constraints, variables, parameters
Managers might say…
Designers might say…
What it means
Car examples
Key performance indicators (KPIs/KPPs)
Objectives
What we want to maximize/minimize
Seek best possible cost or performance (e.g., speed, efficiency)
Requirements
Hard constraints
Must-haves, with specific thresholds
Must pass FMVSS government crash test
Desirements, Targets
Soft constraints
Wants, with specific thresholds
At least 36 miles per gallon (35 wouldn’t invalidate the project)
Decisions
Variables
Things we can change and want the optimizer to change
Sizes, material choices, layout, capacity
Environment
Parameters
Quantities that we can’t or won’t change
Material properties, e.g., strength of steel
9

Example: Stigler diet
What is the lowest possible cost of a diet for a moderately-active, 154-pound male, that meets the National Research Council’s 1943 Recommended Dietary Allowances (RDA) of 9 nutrients?
• Objective: Minimize cost
• Constraints: Meet 9 nutrients’ RDAs
• Variables: Amounts of each food
• Parameters: 77 foods included; nutrient content and cost of each food; moderately active 154-lb man
• Models: Linear equations of nutrients and costs per unit of food
Stigler, G. J. (1945). The cost of subsistence. Journal of farm economics, 27(2), 303-314.
10

Example: Crash safety
What is the lowest probability of serious injury that we can achieve through structural and restraint system design for a mid-sized male crash test dummy in a 35-mph crash with a rigid barrier?
• Objective: Minimize injury probability
• Constraints: Pass FMVSS tests
• Variables: Thicknesses of structural elements; stiffness of seat belt; airbag inflation rate
• Parameters: Vehicle shape; material properties; size of mid-size male dummy; definition of “serious injury” on Abbreviated Injury Scale (AIS); crash test specs
• Models: Physics-based simulations
Hoffenson, S., Reed, M. P., Kaewbaidhoon, Y., & Papalambros, P. Y. (2013). On the impact of the regulatory frontal crash test speed on optimal vehicle design and road traffic injuries. International Journal of Vehicle Design, 63(1), 39-60.
11

Example: Topology of a chair
How can we design the shape of a fixed-mass chair to hold the maximum weight possible?
• Objective: Maximize stiffness
• Constraints: Mass
• Variables: Material in each coordinate position (yes/no)
• Parameters: Material properties; loading direction of weight • Model: Finite element simulation
http://mocosubmit.com/generico-chair/
12

Quantity
What it means
Battery examples
Objectives Objectives
What we want to
What we want to maximize/minimize
Maximize capacity in kWh
Hard constraints Hard constraints
Soft constraints Soft constraints
maximize/minimize Must-haves, with specific
Mthuressth-hoaldvess, with specific
Must meet safety standards
thresholds
Wants, with specific Wants, with specific
thresholds thresholds
Weigh no more than 200 lb; Capacity of at least 30 kWh; Volume no more than 15 ft3; Cost no more than $3,000
Variables Variables
Things we can change Things we can change
Dimensions, material choice, layout
Parameters Parameters
Quantities that we can’t or wQuoann’tticthieasntgheat we can’t or won’t change
Material properties, e.g., density of a particular lithium-ion battery; thresholds of soft constraints
Note: This is what you need to do for the “optimization in the real world” assignment!
Exercise
In groups, come up with an objective, constraints, variables, and parameters for designing a battery pack for an electric car
13

1. Formulate the problem
a)
b)
c) d)
Define system boundaries
What are we including? What are we assuming fixed? What are our objectives, constraints, variables, and parameters?
Develop analytical models
Are they theoretical (equation-based) or empirical (data-based)? Do they take a long time to evaluate? Can we use surrogate models?
Explore/reduce the problem space
Is there a feasible solution? Can we reduce the number of variables or constraints? Is the space convex? Are there local optima?
Formalize optimization problem
Write it out mathematically. Then, ask and adjust based on: Is it multi- disciplinary? Is it multi-objective? Is there uncertainty?
14

b) Develop analytical models
• How do we represent our system mathematically? • Inputs: Variables & parameters
• Outputs: Objectives & constraints
• Three ways to do this
1. Chemical/physical/mathematical equations
2. Simulation models (FEA, CFD, etc.)
3. Experimental data
• Design of experiments • Metamodeling
15

Design of Experiments (DOE)
When we have experimental or computationally expensive simulation data, we need to sample the space efficiently
Week 4
16

Metamodeling
Fit an analytical model to data
Week 4
17

1. Formulate the problem
a) b) c) d)
Define system boundaries
What are we including? What are we assuming fixed? What are our objectives, constraints, variables, and parameters?
Develop analytical models
Are they theoretical (equation-based) or empirical (data-based)? Do they take a long time to evaluate? Can we use surrogate models?
Explore/reduce the problem space
Is there a feasible solution? Can we reduce the number of variables or constraints? Is the space convex? Are there local optima?
Formalize optimization problem
Write it out mathematically. Then, ask and adjust based on: Is it multi- disciplinary? Is it multi-objective? Is there uncertainty?
18

c) Explore/reduce the problem space
Once we’ve framed the problem and defined the models, we can ask:
• Does an optimal solution exist? • Is the problem well-bounded?
• Are the constraints active?
• Are the functions monotonic?
• Are the functions differentiable? • Are the functions convex?
• Can the formulation be simplified?
Week 2
Answering these questions can help detect formulation errors, save time, and potentially find the solution!
19

1. Formulate the problem
a) b) c) d)
Define system boundaries
What are we including? What are we assuming fixed? What are our objectives, constraints, variables, and parameters?
Develop analytical models
Are they theoretical (equation-based) or empirical (data-based)? Do they take a long time to evaluate? Can we use surrogate models?
Explore/reduce the problem space
Is there a feasible solution? Can we reduce the number of variables or constraints? Is the space convex? Are there local optima?
Formalize optimization problem
Write it out mathematically. Then, ask and adjust based on: Is it multi- disciplinary? Is it multi-objective? Is there uncertainty?
20

d) Formulate optimization problem
Objective function
Constraints
Variables
Parameters
“negative null” form
21

2. Solve the problem
a)
Choose the right approach/algorithm
What are the different types of algorithms (pattern search, gradient-based, population-based)? How do they work? When do we apply each?
Solve (by hand, code, or software)
Apply the chosen algorithm to the formulated problem
Interpret the results
Do the outputs make sense? How do we choose among multi-objective results?
Iterate if needed
Use findings to update the formulation or algorithm
b) c)
d)
22

Why do we need algorithms?
• We don’t always know the shape of a function • Too many dimensions to visualize
• Not enough data points
• Most algorithms take us from a starting point or points, and then move in directions of improvement
𝑓𝑓(𝑥𝑥)
x
23
f(x)

Two-variable contour map
Variable 2
24
Variable 1

Gradient-based algorithms
Use derivatives to find the optimal solution
Weeks 5-7
𝑓
𝑥∗
increasing slope
zero slope
𝑥
Extension to multi-variable problems:
First-order: 𝛁𝑓 𝑥∗ = 𝟎
Second-order: 𝐇 𝑥∗ is positive definite
Optimality conditions (min)
First-order: 𝜕𝑓 𝑥∗ = 0 𝜕𝑥
Second-order: 𝜕2𝑓 𝑥∗ > 0 𝜕𝑥2
25

Gradient-free algorithms
Pattern search
Population-based
e.g., Hooke-Jeeves direct search, DIRECT, Nelder-Meade
Week 3
e.g., genetic/evolutionary algorithms, particle swarm, ant colony
Week 8
26

Business-oriented optimization
What is the most common objective in design?
product attributes
maxπ =𝑄 𝛼,𝑃 𝑃−𝐶 𝛼 𝛼,𝑃
profit sales quantity
price cost
We need 2 models:
1. cost, C
2. demand, Q
27

Multi-objective optimization
Week 9
fmin
gmin
xopt x
xopt x
min𝑓 𝑥 𝑥
Pareto frontier
, 𝑔(𝑥)
This is useful for trade-off analysis
f(x)
28
g(x)
f(x)
g(x)

System design
If the system-level problem is difficult to solve all at once, you may need to decompose the problem into subsystems
All In One (AIO)
Decomposition-based Strategy (Partitioning and Coordination)
Week 10
VS.
Body
Powertrain
Electronics
Chassis
Transmission Engine Driveline
Valvetrain Cylinder Block

Handling uncertainty
Ensure the solution isn’t too close to a constraint
Week 11
30

Software support
Week 12
Excel MATLAB Specialty optimization packages
Commercial CAD software integration

Important takeaways
• What is design optimization?
• What are the major steps of formulating
and solving an optimization problem?
• How do we set system boundaries? • What are objectives and constraints? • What are variables and parameters?
• How do we write a formal optimization problem?
32

Questions
33