
Explore optimization problems through regression modeling and neural networks, using weight, height, and walking time to predict blood pressure. Apply MATLAB optimization to minimize error and tune coefficients and weights.
Select benchmark optimization problems to study the firefly optimization algorithm, using the sphere function and Rozum Brok function, and implement selected functions in Matlab for the next lecture.
Write MATLAB functions for the sphere cost and a second optimization function, using preallocation and a for loop, then save as scripts for the Firefly algorithm.
Firefly algorithm models optimization by light-based attraction, where fireflies communicate with intensity tied to distance via the inverse square law, with linear or surface light source assumptions.
Explore the firefly algorithm for optimization, where fireflies are attracted to brighter peers based on distance and light intensity, iterating with MATLAB to find the best solutions.
Define the optimization problem in Matlab and import the function parameters into the Firefly optimization code, organizing user inputs and variable ranges in a single structure.
Define each firefly as a four-dimensional solution within the -20 to 20 range, compute its cost from its position, and prepare to initialize fireflies for the main optimization loop.
Initialize the firefly algorithm in Matlab by creating a population structure, setting the number of fireflies, and randomly assigning positions within a defined range; compute costs with the function.
Apply a simple matlab firefly rule: after generating positions, save the lowest-cost firefly as the best. Initialize the best cost to infinity.
Present the attractiveness formulation for fireflies, combining inverse square law with gamma absorption. Use this final equation to drive the matlab firefly optimization.
Derive the final firefly attraction equation to compute the new position of firefly x from firefly y using attractiveness, distance, gamma, and a random movement epsilon, then implement in Matlab.
Implement the firefly attraction equation in Matlab by defining coefficients, computing distances with norm, updating positions, and preallocating new fireflies for efficiency.
We define how fireflies interact and clamp new positions to a specified range in Matlab, ensuring all fireflies stay within [-20, 24] after movement.
Explore how the MATLAB firefly optimization iterates to update positions, compare costs, and keep the best firefly through preallocated loops and sorting.
Learn how damping the randomization parameter in the firefly optimization algorithm implemented in MATLAB reduces exploration over iterations to boost performance.
Display the results of the firefly optimization algorithm by plotting the best firefly cost per iteration. Pre-allocate a semilog plot and show convergence toward zero with a sphere example.
I’m very glad to have opportunity to teach you one of the most popular and powerful optimization algorithms in this course.
If you search FireFly optimization algorithm in google scholar, it could be seen that there are many vast range of papers has been published by implementing this optimization algorithm in different fields of science.
In this course, after presenting the mathematical concept of each part of the considered optimization algorithm, I write its code immediately in matlab.
All of the written codes are available, however, I strongly suggest to write the codes with me. Notice that, if you don’t have matlab or you know another programming language, don’t worry at all. You can simply write the codes in your own programming language because the behind concepts about all of the written codes are presented completely.
We have a lot to cover in this course, so, let’s start it.