Creating your own Optimization code using numerical methods
Summary
Students were taught how to use numerical methods such as the Golden Section search, Newton-Raphson and Secant method. These methods take a long time when doing by hand and the complexity of optimization problems once the model is achieved would require a long time to perform these calculations by hand or using Spreadsheet. Since they have access to MATLAB, this activity focuses on teaching students how to develop a code to run all three methods with a simple click. They are encouraged to develop their own code and use it in different settings such as chemical engineering, pharmaceutical or food industry related problems.
Learning Goals
Students are less prone to mistakes once the code is ready and, therefore, can focus on the application of problems.
This encourages them to be more creative and use the code as a template for their own purposes.
The key aspect of doing this in class is so that everyone can be helped in the process. Some students are more motivated to develop their own codes or even simplify or make them more complex. They are encouraged to do it so. At the end of the day, every students has that capability.
Context for Use
Description and Teaching Materials
This activity aims to using MATLAB to simplify and expedite the solution of numerical methods with optimization. They have solved it by hand and with spreadsheet when they reach this point. The purpose is to show them how easy it is to solve other problems using their MATLAB code. This activity started with basic tutorials on the subject and how students understand the concepts better. It also aligns previous MATLAB knowledge from previous classes and it gives a sense of refreshing content and applying them in a more chemical engineering sense. After this activity, students are encouraged to apply the codes on different types of scenarios.
Optimization 1 D tutorial (Acrobat (PDF) 208kB Aug9 22)
Teaching Notes and Tips
Assessment
The exam that follows an activity like this include a series of problems in which they could reuse the code to find quick answers (otherwise, they would not be able to finish the exam on time). I also add a challenge problem in which they need to be creative and bring a chemical engineering related problem (or one related to their daily activities) and develop their own model and code. This is generally a bonus point.
References and Resources
MATLAB session - Golden Search: https://www.youtube.com/watch?v=kvaxt3FyDdA
Numerical methods problem 13.8
https://www.youtube.com/watch?v=GnWJu95vBhs