0% found this document useful (0 votes)
6 views8 pages

Lecture 03

Uploaded by

Simon Lavenzer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views8 pages

Lecture 03

Uploaded by

Simon Lavenzer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

AI for Mechanical Engineering

Dr. Arsalan Arif

Artificial Intelligence A Modern Approach


Stuart J. Russell and Peter Norvig

Spring 2023
Optimization
• The action of making the best or most effective use of a situation or resource.
• Trying to do the best thing in the given constraints

Top Favorite Shoes Favorite Shoes Cheap Shoes

Money Constraints
• Trying to do the best you can with what you have
Optimization
Goal: To optimize some thing (function f),
• maximize f or minimize f
• Number of good production in a factory ( we want to maximize it)
• The fuel consumption or production cost in the same factory ( we want to minimize it)
• J = f(x)
• Function f may depend on one or many different variables

Constraints
• Limitation of restriction

Example: Cost to produce a food item Constraints


= amount of ingredient 1, = amount of ingredient 2

(we have unlimited availability of this unit but we cant


exceed this limit)
(we only have 2.5 units available)
(must 0. 5 in order to meet PFA requirements)
2+
Example: Cost to produce a food item
= amount of ingredient 1, = amount of ingredient 2

(we only have 1.75 units available)


(we only have 2.5 units available)
(must 0.5 in order to meet PFA requirements)
2+
+ are the decision variables
X= [ …… 𝒙𝟐

X=
…… are the decision variables 3
F(s)= Feasible Set
= All possible values of decision vector X such that all Infeasible 2
constraints are met Feasible Set
In order to satisfy 1
F(s)= X | all constraints are satisfied constraint 1, we have to
be on the right side
𝒙𝟏
1 2 3
Anything in this region will satisfy all the constraints
Example1: Find the Number whose sum is 60 and its product is maximum

Example2: Find the Number whose difference is 40 and its product is minimum

Example3: Find the dimension of a rectangle with a parameter of 200 ft and an area as large as possible
L
Perameter= 2L+ 200= 2L+ 100= L+ 100-W= L

Area= L* W W

Area= (100-W )* L

Area= (100W- Take its derivate w r t W and equate it to zero

0= (100-

W= 50

L=50

Area= 50* Area= 2500


Example4: Find the point on the line Y=3x+5 that is closest to the origin

Y= mx+

m is slope and C is y intercept of line

d
C=5 For x, put y = 0 in equation 1 x= -1.6 y
x
2 2 2
𝑥 + 𝑦 =𝑑 (2)

Equation should has to be minimized so its our cost function

(𝑥 + 9 𝑥 +15) =0
𝑑′ =
√ 𝑥 2+(3 𝑥 +5)2
1 0 𝑥+15=0 𝑥=−1.5 𝑦 =0.5
Linear Programming Optimization
Z= 2x+
27 P(0,9)

Minimize Z
P(?,?) P(2,3)
Constraints
13
P(8,0) 16

3 𝑥 + 6 𝑦 =24 , 𝑥=8 𝑦 =4
𝑦 =− 3 𝑥 +9 , 𝑥=3 𝑦 =9
3 𝑥 + 6(− 3 𝑥+9)=24 , 3 𝑥 − 18 𝑥 +54=24 , −15 𝑥=− 30 , 𝑥=2 𝑦 =3

Take these vertices put them in objective functions to get the minimum value
Example 2: A company makes 2 type of computers X and Y. This company can make a total of 80 computers per day and has
240 hours available per day. It takes 2 hours to make X and 6 hours to make computer Y. The profit on computer X and 80 $ and
on Computer Y is 120 $. How many of each should be made to maximize the profit.

P= 80x+

Constraints
4 800
P(0,40) 7 200
P(?,?) P(60,20)
0 0 𝑇𝑒𝑠𝑡 𝑓𝑜𝑟 0,0
P(0,0) 6080
2040 100 120
𝑥=120 0 𝑇𝑒𝑠𝑡 𝑓𝑜𝑟 0,0 P(80,0)
6 400
For intersection point solve the 2 equations 0 0

Take these vertices put them in objective functions to get the maximum value

P= 80x+

We need to make 60 of computer X and 20 of Computer Y to maximize our profit (7200 $)

You might also like