Professional Documents
Culture Documents
Engineering Optimization: Lecture
Engineering Optimization: Lecture
Faculty of Engineering
Mechatronics Department
Engineering Optimization
MCT-434
Lecture (05)
Particle Swarm Optimization (PSO)
Lecture (05): Particle Swarm Optimization Engineering Optimization (MCT-434s) – Spring ‘23 -- Dr. Eng. Omar M. Shehata © 1
Outlines
• Swarm Intelligence
• Particle Swarm Optimization (PSO)
• PSO Example
• Next time …
Lecture (05): Particle Swarm Optimization Engineering Optimization (MCT-434s) – Spring ‘23 -- Dr. Eng. Omar M. Shehata © 2
Swarm Intelligence
What is Optimization
• Finding an alternative with the most cost effective or highest achievable
performance under the given constraints, by maximizing desired factors and
minimizing undesired ones.
Lecture (05): Particle Swarm Optimization Engineering Optimization (MCT-434s) – Spring ‘23 -- Dr. Eng. Omar M. Shehata © 3
Swarm Intelligence
Optimization
Solution
A C D B E 1 0 0 1 1 31 23 19 84 21
Lecture (05): Particle Swarm Optimization Engineering Optimization (MCT-434s) – Spring ‘23 -- Dr. Eng. Omar M. Shehata © 4
Swarm Intelligence
Solution Space
Maximum
• What is a Solution-Space? x y value of
All possible values for the decision variables. function (Z)
Value = 8
Value = 2
Value = 0
Solution:
Value = 0
-3
3
1
-1 -3
-1
1
Lecture (05): Particle Swarm Optimization Engineering Optimization (MCT-434s) – Spring ‘23 -- Dr. Eng. Omar M. Shehata © 5
Swarm Intelligence
POPULATION !!!
Value = 0
Value = 2 Value = 2
Value = 0
Value = 0
Value = 1.5 Solution:
3
0
-1 -3
-2
-1
Value = -0.5
Value = -2 -1
3
-2 1
3
0
Value
Value == 00 -3
-2
-1 -3
0
1
Value = -6
-2
-3 3
2
-3
Lecture (05): Particle Swarm Optimization Engineering Optimization (MCT-434s) – Spring ‘23 -- Dr. Eng. Omar M. Shehata © 6
Swarm Intelligence
Introduction
• Particle Swarm Optimization (PSO) is a method for solving optimization problems
based on PARTICLES that move around in the search-space based on
mathematical formulae over the particle's position and velocity.
Lecture (05): Particle Swarm Optimization Engineering Optimization (MCT-434s) – Spring ‘23 -- Dr. Eng. Omar M. Shehata © 7
Particle Swarm Opt. (PSO)
PSO Drivers
• But how does particles fly in the search space ??
Each Particle Speed is
affected by
PSO
Drivers
Personal Global
Inertia
Best Best
Inertia
(i)
(i -1) 𝑮𝒍𝒐𝒃𝒂𝒍𝒃𝒆𝒔𝒕
𝑿𝑶𝒎𝒂𝒓
𝑿𝑶𝒎𝒂𝒓_𝒃𝒆𝒔𝒕
New
𝑷𝒆𝒓𝒔𝒐𝒏𝒂𝒍𝒃𝒆𝒔𝒕 𝑿𝑱𝒐𝒆_𝒃𝒆𝒔𝒕
Velocity (i +1)
Lecture (05): Particle Swarm Optimization Engineering Optimization (MCT-434s) – Spring ‘23 -- Dr. Eng. Omar M. Shehata © 8
Particle Swarm Opt. (PSO)
Solution Number of
No change
Converge Iterations
Lecture (05): Particle Swarm Optimization Engineering Optimization (MCT-434s) – Spring ‘23 -- Dr. Eng. Omar M. Shehata © 9
Particle Swarm Opt. (PSO)
PSO Particle
• Previously we mentioned that optimization solution can be formulated as:
Optimization
Solution
A C D B E 1 0 0 1 1 31 23 19 84 21
Particle
Fitness Function
Lecture (05): Particle Swarm Optimization Engineering Optimization (MCT-434s) – Spring ‘23 -- Dr. Eng. Omar M. Shehata © 10
Particle Swarm Opt. (PSO)
Inertia of particle Personal Best effect term Global Best effect term (𝟎. 𝟐) 𝟎 + (𝟎. 𝟓) 𝟎. 𝟐𝟑𝟓 𝟑𝟓 − 𝟑𝟏
term + (𝟏. 𝟐)(𝟎. 𝟏𝟖𝟗)(𝟐𝟓 − 𝟑𝟏)
𝑐1 is the acceleration 𝑐2 is the acceleration
Velocity @(i+1)
𝑤1 is the weight of coefficient coefficient
this term (user -5.3
defined) 𝑟1 is randomly generated 𝑟2 is randomly
number generated number And REPEAT…
Lecture (05): Particle Swarm Optimization Engineering Optimization (MCT-434s) – Spring ‘23 -- Dr. Eng. Omar M. Shehata © 11
Particle Swarm Opt. (PSO)
Velocity @(i+1)
Update Update -5.3
Velocity Position
𝑑
𝑋𝑖+1 − 𝑋𝑖𝑑 1
𝑋𝑖+1 = 𝟑𝟏 + (−𝟓. 𝟑)
𝑉𝑖+1 =
∆𝑇
Given that ∆𝑇 is equal to 1 iteration (∆𝑇 = 1)
Thus,
𝑑
𝑋𝑖+1 = 𝑋𝑖𝑑 + 𝑉𝑖+1 NEW Particle @(i+1)
25.7
New Velocity of New Position of
Sampling Time
particle particle
And REPEAT…
Lecture (05): Particle Swarm Optimization Engineering Optimization (MCT-434s) – Spring ‘23 -- Dr. Eng. Omar M. Shehata © 12
PSO Example
Decision Variables
Lecture (05): Particle Swarm Optimization Engineering Optimization (MCT-434s) – Spring ‘23 -- Dr. Eng. Omar M. Shehata © 13
PSO Example
Constraints
Performance Equations
Now We Solve it
Lecture (05): Particle Swarm Optimization Engineering Optimization (MCT-434s) – Spring ‘23 -- Dr. Eng. Omar M. Shehata © 14
PSO Example
Lecture (05): Particle Swarm Optimization Engineering Optimization (MCT-434s) – Spring ‘23 -- Dr. Eng. Omar M. Shehata © 15
PSO Example
Lecture (05): Particle Swarm Optimization Engineering Optimization (MCT-434s) – Spring ‘23 -- Dr. Eng. Omar M. Shehata © 16
PSO Example
Lecture (05): Particle Swarm Optimization Engineering Optimization (MCT-434s) – Spring ‘23 -- Dr. Eng. Omar M. Shehata © 17
PSO Example
𝑤1 = 0.2, 𝑉𝑖 = 0
𝑐1 = 0.25, 𝑟1 = 0.25
𝑐2 = 0.6, 𝑟2 = 0.3
(𝟎. 𝟐) 𝟎 + (𝟎. 𝟐𝟓) 𝟎. 𝟐𝟓 𝟕𝟖 − 𝟕𝟖 The only dominant factor will be the Global best,
+ (𝟎. 𝟔)(𝟎. 𝟑)(𝟖 − 𝟕𝟖) and the particles will start moving in its
direction.
Lecture (05): Particle Swarm Optimization Engineering Optimization (MCT-434s) – Spring ‘23 -- Dr. Eng. Omar M. Shehata © 18
PSO Example
Lecture (05): Particle Swarm Optimization Engineering Optimization (MCT-434s) – Spring ‘23 -- Dr. Eng. Omar M. Shehata © 19
PSO Example
Next time
• In the next Lecture we will cover:
– Ant Colony Optimization (ACO) Technique
Lecture (05): Particle Swarm Optimization Engineering Optimization (MCT-434s) – Spring ‘23 -- Dr. Eng. Omar M. Shehata © 21
See you Next time … ☺
Lecture (05): Particle Swarm Optimization Engineering Optimization (MCT-434s) – Spring ‘23 -- Dr. Eng. Omar M. Shehata © 22