Inertia weight was initially introduced to balance optimization between the global and local search abilities. In our case, inertia is multiplied by the inertia weight to adjust the swarm speed. Generally, the accepted values range from 0.4 to 1 for this variable. 0.729 is the default value:
The code is as follows:
Swarm[i].Speed[j] = Inertia * Swarm[i].Speed[j]
Inertia = 0.729:
3D Plot
Inertia = 0.4:
3D Plot