CHEG 3145 is arguable the most well known and talked-about class in the junior curriculum for chemical engineers at UConn due to how challenging it is. I took it my fall semester of junior year, and this past fall semester, I had the pleasure of being a TA for it.
Assuming a student has no prior coding experience, this course could be a daunting endeavour, so I wanted to make it my goal to help the younger students grasp the concepts easily.
The class is centered around MATLAB in which students would apply complex algorithms and write a livescript (.mlx file) in MATLAB to solve numerical analysis problems with chemical engineering applications. Upon submission of each homework, students would have a pdf of written work for the problems and their live code.
The lecturing portion of the class was the duty of our professor, Dr. Stuber, and then the rest was up to my fellow TA's and I. I was tasked with grading 5 homeworks a week, in which I would give the student the appropriate grade and provide sufficient feedback to the learner. The next task I had was hosting office hours, where I had 4 office hours per week, spread out over Mondays, Wednesdays, and Thursdays. These were very well received by the students and they seemed to get a lot out of it. During office hours, students could ask another TA and myself anything from conceptual questions on the material to finding where errors were occuring in their code. With not every student approaching the code the same way, fixing their code became one of the more fun tasks, as you could see how things like their indexing affected their outputs and how to change that based on their method. Lastly, we the TA's, would host review sessions the class before the exams. We gave them practice problems related to their exam material, walked them through solutions, and even offered Kahoot games to encourage more interaction.
With MATLAB utilizing arrays for its computation, the first concepts learned were some basic linear algebra. Students quickly began to solve linear systems using Gauss Elimination with and without partial pivoting. They were taught to understand the lengthy code behind this before we finally let them use the backslash operator for Gauss Elimination.
From there, we taught:
-Non linear equations (Newton's Method)
-Non linear systems (Newton Raphson)
- Ordinary Differential Equations including systems
IVP's with Explicit Euler, Implicit Euler, Predictor Corrector, and Runge-Kutta (RK4) methods
BVP's with same methods, Dirichlet, Neumann, and Robin boundary conditions, fictitious nodes, and appending/interlacing variables
-Partial Differential Equations using method of lines
-KKT Optimization
All of these problems had applications involving chemical engineering like heat/mass transfer, reaction kinetics, and mass balances.
In this homework problem, students had to solve this Poisson equation where the summation of two 2nd spatial derivatives is 0. The dependent variable is concentration, so we want to see how concentration varies along the x and y axis.
The following conditions were present:
No flux boundary conditions at x = 0 and x = 1
Constant concentration c = 1 at y = 1
Mixed Dirichlet and Neumann conditions at y = 0 boundary: c = 0 for x in [0,0.05] U [0.3, 0.75] and no-flux conditions evrywhere else
Assuming discretization of x and y are the same allows the second derivatives to be combined, and a new indexing scheme of k is adopted in place of i,j indexing. Thus, equations were developed for the top, bottom, left, and right boundaries, and for the corners. The interior nodes have their own set of equations that do not involve the boundary conditions.
Using the sparse Gauss Elimination, students solved the linear system Ax = b representing this Poisson equation. From there, the x vector could be unpacked to obtain vectors to plot on each axis.
The 3D concentration plot looks as follows: