Week 2: Optimization Algorithms And Riparian Buffers
Welcome back to my senior project blog. This week in my internship, I finished coding my heat optimization problem and began a new one–a genetic, or evolutionary, algorithm. Genetic algorithms are optimization methods where, in each generation, the best ‘individuals’ (data sets) are kept and their ‘chromosomes’ (characteristics/values) mixed to form new individuals. A ‘fitness’ measure (cost function) determines which individuals survive to the next generation. I also added ‘mutations’ (random changes in values within the data sets) to try to achieve a fitter individual and get characteristics not present in the original population. Genetic algorithms are useful, for example, in optimizing the shape of an airplane wing (the cost function would be related to air resistance) to see which shapes were best. As any programmer knows, most of the time spend coding is finding and fixing bugs in the code, which can be frustrating but also rewarding. Did you know that ‘bugs’ are so named because in the first computers, actual insects would get into the machine and cause errors, and programmers had to go in, find them, and remove them? I’m glad all the errors I face in my code today are of my own doing, and therefore solvable through logic, not taking apart my computer.
I included a picture of a simulated simple car in a wind tunnel showing the air velocity around the car. I couldn’t resist; I find the models fascinating and want to share them with you.
I also began reading some of the many articles that will teach me all about rainfall, stormwater, pollution, and runoff models. Right now, I am reading about riparian buffers. I learned that they are best at mitigating nutrients in surface water, but not groundwater. There have been many efforts at establishing or maintaining riparian buffers, but Lee et al. argue that efforts to measure their effectiveness have not been as plentiful (Lee, S., McCarty, G. W., Moglen, G. E., Li, X., & Wallace, C. W. (2020). Assessing the effectiveness of riparian buffers for reducing organic nitrogen loads in the Coastal Plain of the Chesapeake Bay watershed using a watershed model. Journal of Hydrology, 585, 124779. doi:10.1016/j.jhydrol.2020.12). Since field evaluation of conservation practices is cost-, labor-, and time-intensive, models of water flow and nutrient flow and absorption have been the main focus recently in determining ‘best management practices’ of pollutants and conservation efforts. There are many of these tools, including the Soil and Water Assessment Tool that Lee et al. used, and I will study them in more depth and tell you more about them next week.
This is an example plot of the genetic optimization code that I wrote and plotted. From one generation (curve) to the next, the observed characteristics (blue=best individual; green=worst individual) get closer to the desired characteristics (orange).
Photo credit: Dr. Löhner did most of the CAD to display this car. From George Mason University, Center for Computational Fluid Dynamics. Notice the lower velocity areas in front of and behind the car on the ground (pinkest=fastest-moving air).