New Post
Find Maxima of Function using PSO Method || Numerical Example || ~xRay Pixy
- Get link
- Other Apps
Problem: Find the Maxima of the function
f(x)=x2+2x+112in the range -2<=x<=2 using PSO method. Use 4 particles (N = 4) with the initial
positions x1 = -1.5, x2 = 0.0, x3 = 0.5 and x4 =1.25. Show detailed computation
for iteration 1. Assume w = 0.8 and C1 = C2 = 2.05.
Calculation for Iteration 01
Initial Positions: x1 = -1.5, x2 = 0.0, x3 = 0.5, x4 = 1.25
Initial Velocities: v1 = v2 = v3 = v4 = 0
Weight Inertia (w) = 0.8
Acceleration Coefficients c1 = c2 = 2.05
f(x1) = -(-1.5)^2 + 2 (-1.5) + 11 = 5.75
f(x2) = -(0.0)^2 + 2(0.0) + 11 = 11
f(x3) = -(0.5)^2 + 2(0.5) + 11 = 11.75
f(x4) = -(1.25) ^2 + 2(1.25) + 11 = 11.93Pbest(x1) = -1.5
Pbest(x2) = 0.0
Pbest(x3) = 0.5
Pbest(x4) = 1.25Particle (x1) New Velocity
v1 = 0.8 * 0 + 0.3 * 2.05 * (-1.5 - (-1.5)) + 0.6 (2.05)*(1.25-(-1.5))
v1 = 3.3825
Particle (x1) New Position
x(1) = -1.5 + 3.3825= 1.88Particle (x2) New Velocity
v2 = 0.8 * 0 + 0.2 * 2.05 * (0.0 - 0.0) + 0.6 * (2.05)*(1.25-0.0)
v2 = 1.537
Particle (x2) New Position
x(2) = 0.0 + 1.537 = 1.537Particle (x3) New Velocity
v3 = 0.8 * 0 + 0.4 * 2.05 * (0.5 - 0.5) + 0.1 * (2.05)*(1.25-0.5))
v3 = 0.1537
Particle (x3) New Position
x(3) = 0.5 + 0.1537 = 0.6537Particle (x4) New Velocity
v4 = 0.8 * 0 + 0.9 * 2.05 * (1.25 - 1.25) + 0.2 * (2.05)*(1.25-1.25))
v4 = 0
Particle (x4) New Position
x(4) = 1.25 - 0 = 1.25f(x1) = -(1.88)^2 + 2 (1.88) + 11 = 11.23
f(x2) = -(1.53)^2 + 2(1.53) + 11 = 11.72
f(x3) = -(0.65)^2 + 2(0.65) + 11 = 11.87
f(x4) = -(1.25) ^2 + 2(1.25) + 11 = 11.9Pbest(x1) = 1.88
Pbest(x2) = 1.53
Pbest(x3) = 0.65
Pbest(x4) = 1.25Gbest = (x4) = 1.25 Check Fitness (Old_Gbest) > Fitness (New_Gbest)
Check (11.93) > (11.23)
(11.93) > (11.72)
(11.93) > (11.87)
(11.93) > (11.93)Check (Current_itr <= Max_iter)
Repeat Steps from Step 6 to Step 11- Get link
- Other Apps
Comments
Post a Comment