Numerical Methods and Machine Learning for Chemical Engineering#
Introduction and Syllabus#
Instructor:
Victor Alves, Email: vcunhaal@andrew.cmu.edu, Office: A204 Doherty Hall
Course Assistants:
Megan Walsh, Email: mew2@andrew.cmu.edu, Office: A204 Doherty Hall
Tirtha Vinchurkar, Email: tvinchur@andrew.cmu.edu, Office: 4200 Doherty Hall
Class Schedule:
Lecture Mon/Wed 2:00 - 3:50 PM BH A53
Office Hours Mon/Tue/Wed 5:00 - 7:00 PM DH 4201 (Mon: TAs, Tue: Tutor, Wed: Victor + TAs)
Course Website: Canvas will be used for posting homework and other course materials.
Course Material:
Jupyter Notebooks developed for this class made available on Canvas.
Secondary (Optional, but recommended)
Dorfman, K. D., & Daoutidis, P. (2017). Numerical Methods with Chemical Engineering Applications. Cambridge University Press.
Tutors
The Student Academic Success Center provides tutoring for this course. Appointments for one-on-one tutoring can be booked via the WCOnline schedule. All tutoring begins Tuesday, September \(2^{nd}\).
Welcome to 06-325 Numerical Methods and Machine Learning for Chemical Engineering! In this class we will cover:#
Concepts related to numerical methods to solve chemical engineering problems including:
1.1. Linear and nonlinear equations/system of equations,
1.2. Ordinary differential equations (ODEs),
1.3. Optimization and curve-fitting of chemical engineering systems (without and with constraints)
Machine Learning:
2.1. Regression: Decision Trees, Neural Networks, Gaussian Processes (GPs) - More frequent in chemical engineering applications
2.2. Classification and Clustering - Less frequent (relatively speaking), but we will take a quick look at them.
Some notes and recommendations before we start#
I will assume you already have some (not expert-level) familiarity with Python and the basics of coding. If not, I’d recommend some resources for you:
John Kitchin’s Python Computation in Science and Engineering, available here, for free: https://kitchingroup.cheme.cmu.edu/pycse/intro.html
A very similar version of #1 above also from Prof. Kitchin, that he published as Introduction to Python computations in science and engineering, also available for free: https://pointbreezepubs.gumroad.com/l/pycse-intro?layout=profile .
I recommend you to consult these materials when having questions that involve coding in general, as well as some numerical methods concepts too. These are excellent materials that I still use every day!
If you are not familiar with Python and did not have the chance to familiarize yourself with it before, we will build the necessary skills to use it. We will be using three of the most popular/famous Python packages built for scientific computing:
NumPy, https://numpy.org, which allows us to manipulate arrays, a fundamental concept in scientific computing and numerical methods (more on that later)
SciPy, https://scipy.org, which contains most of the algorithms and numerical methods taught in this class, already coded
Scikit-Learn, https://scikit-learn.org/, maybe the most popular machine learning (ML) Python package; Again, containing most of the numerical methods and machine learning algorithms covered in this class.
What should you expect?#
Expect dynamic classes, in which I will teach you how the numerical methods and machine learning algorithm work. And I will use this interface (Jupyter) as well as some slides eventually to show you both code and theoretical aspects of the class.
The main takeaway of this course is critical thinking regarding which numerical method and ML algorithm applies to each problem.
At the end of this Mini course, the main skills you should develop are:
Identifying to which class of problem you are being presented.
Which numerical method and/or ML algorithm is suitable for solving the problem at hand.
If there is more than one way to solve the problem presented to you, what are the pros and cons of using each alternative?
This should, hopefully, help you in our career to quickly analyze mathematical problems and judge which tool you should use.
What should you not expect?#
This is a Mini course, and time is of essence. I will do my best to strike a balance between providing you the maximum amount of technical content and respecting the fact that our time is limited. Hence, you should not expect that we are going to dive into extremely specific details of each algorithm/numerical method. Rather, I will provide an amount of information that should enable you to solve most typical problems and if needed, to be able to seek more information using the base knowledge provided.
Expectations in Classroom#
The Department of Chemical Engineering supports the community standards of the University(https://www.cmu.edu/student-affairs/theword/community-standards/community-standards.html) that fosters the behavior that provides for every community member to have an opportunity to excel. Each professor within the department may set reasonable classroom behavior standards to ensure a productive learning environment for all students as part of the rights and responsibilities accorded by academic freedom. The following norms are expected from all students, faculty and staff in the department:
By enrolling in a course, each student is agreeing to abide by the course policies of the professor. If anyone has concerns about the policies, the department expects students to communicate directly with their professor. If concerns remain, they can be elevated to your SAC (or ChEGSA/ChEMSA) representative, the Director of Undergraduate Studies (or Director of Graduate Studies), the Department Head, or other administration.
We will conduct ourselves in class in a way that does not interfere with the ability of others to learn. We understand that being active, engaged, and prepared to critically think enables the best in-class learning experience, and will endeavour to reach that mindset.
We will remember that the point is to learn: we will be helpful to one another, asking and answering questions as we are able.
We have the responsibility to protect our own safety and the safety of those around us. We will hold ourselves responsible for our actions and the impact they have on others.
We will act humbly when giving and receiving corrections.
We will treat everyone with respect, valuing each person’s contributions, ideas, and perspectives.
Use of Generative AI#
You are welcome to use generative AI programs (ChatGPT, DALL-E, etc.) in this course. These programs can be powerful tools for learning and other productive pursuits, including completing some assignments in less time, helping you generate new ideas, or serving as a personalized learning tool. However, your ethical responsibilities as a student remain the same. You must follow CMU’s academic integrity policy. Note that this policy applies to all uncited or improperly cited use of content, whether that work is created by human beings alone or in collaboration with a generative AI. If you use a generative AI tool to develop content for an assignment, you are required to cite the tool’s contribution to your work. In practice, cutting and pasting content from any source without citation is plagiarism. Likewise, paraphrasing content from a generative AI without citation is plagiarism. Similarly, using any generative AI tool without appropriate acknowledgement will be treated as plagiarism. Here are some specific expectations for your use of AI generation tools in this course:
You may not use AI tools to bypass learning objectives (e.g., generating full solutions to assignments without doing the analysis yourself).
You may use AI tools to help explain programming concepts and to clarify class examples. However, your question could be someone else’s question too. Let’s bring them to class and discuss :)
You may use AI tools to generate sample/auxiliary code, but you must run, test, and understand the code before including it in your studies/assignments. Cite the tool if you include and/or adapt its output.
You may use AI tools to practice problem-solving (e.g., generating practice ODEs, algebraic equations, or optimization examples) as long as your submitted work clearly identifies AI contributions.
You may use AI tools for writing support (e.g., organizing Markdown explanations, refining technical text, improving clarity), with citation when used.
You may not submit AI-generated content (code, text, or figures) without proper acknowledgement.
You are responsible for validating correctness. If AI-generated code does not run, or AI-generated explanations are incorrect, it will be graded as incorrect.
Finally, it is important that you recognize that generative AI tools may provide users with incorrect information, create professional-looking citations that are not real, generate contradictory statements, incorporate copyrighted material without appropriate attribution, and sometimes integrate biased or offensive concepts. Code generation models may produce inaccurate outputs. Image generation models may create misleading or offensive content. While you may use these tools in the work you create for this class, it is important to note that you understand you are ultimately responsible for the content that you submit. Work that is inaccurate, biased, unethical, offensive, plagiarized, or incorrect will be treated as such during the evaluation of your work.
Adapted from CMU colleagues in the Heinz College of Information Systems and Public Policy and from https://www.cmu.edu/teaching/technology/aitools/academicintegrity/index.html
Grading#
Your grade will be based on assignments, participation and a final project. Assignments will typically be a problem set, and we will usually give you a one-week deadline.
Each lecture will have a participation component. This will usually be an assignment (quiz) in canvas, and may include reflection, quizzes, etc. We will be doing these in class.
We will have a project starting in the second half of the course. The project will have a report due and a presentation at the end of the course. You will get more information about the project in mid-September.
We are not planning to have any exams. Instead, the problems we would normally have in exams will be spread out over the course.
Category |
weight |
|---|---|
Assignments |
30% |
Participation (Mini Quizzes) |
20% |
Project |
50% |
In general, the cutoffs for letter grades are as follows:
\(90\% \,+ \rightarrow\) A
\(80\% \,+ \rightarrow\) B
\(70\% \,+ \rightarrow\) C
\(60\% \,+ \rightarrow\) D
below F
These grades may be curved in your favor. Never against you. However, I don’t expect this (curving) to be necessary.
Homeworks#
I encourage everyone to work with your colleagues on the homeworks. However, please indicate, on the first page of your submitted homework, the names of the people with whom you collaborated. While active collaboration can be a great way to learn, blatant copying or plagiarism is not acceptable.
The homework should be submitted as *.ipynb or *.pdf files exported from the Jupyter Notebook interface. I will provide the homework as jupyter notebooks allowing you work directly on the *.ipynb file. I’ll show you in class how to submit these.
Late homework will be reduced by 50% of the original grade, per day. For example, if you turn in the homework late by one day, It will be worth only 50% of the full grade. On the second day, 50% of the previous day, and so on. Please, submit it on time.
Other Policies and Procedures#
Accommodations for Students with Disabilities: If you have a disability and have an accommodations approval from the Disability Resources office, I encourage you to discuss your accommodations and needs with me as early in the semester as possible. I will work with you to ensure that the appropriate accommodations are provided. If you suspect that you may have a disability and would benefit from accommodations but are not yet registered with the Office of Disability Resources, I encourage you to follow the online procedures for obtaining accommodations at https://www.cmu.edu/disability-resources/students/obtaining-accommodations.html.
Statement of Support for Students’ Health and Well-Being: I understand that, at times, we may be under increased stress and challenges, and I will do my best to be accomodating. All of us benefit from support during stressful times, and I will do my best to help if you choose to come to me with any concerns. There are many helpful resources available on campus and an important part of the college experience is learning how to ask for help. If you or anyone you know experiences any academic stress, difficult life events, or feelings of anxiety or depression, we strongly encourage you to seek support. Counseling and Psychological Services (CaPS) is here to help: Call 412-268-2922 and visit their website at http://www.cmu.edu/counseling/. Consider reaching out to a friend, faculty or family member you trust for help getting connected to the support that can help. If you are feeling desperate, call Re:solve Crisis Network: 888-796-8226 If the situation is life threatening, call the police On campus: CMU Police: 412-268-2323 Off campus: 911
Statement of Support for Our Diverse Campus Community: I am committed to treating every individual with respect, and I expect Carnegie Mellon University students to do the same. I personally recognize that we are diverse in many ways, and I believe that this diversity is reflective of society and brings value to our campus. I agree with the university’s statement that diversity can refer to multiple ways that we identify ourselves, including but not limited to race, color, national origin, language, sex, disability, age, sexual orientation, gender identity, religion, creed, ancestry, belief, veteran status, or genetic information. I am personally committed to ensuring that Carnegie Mellon provides an inclusive and welcoming environment. If you feel that you have not been treated with respect in this course, I encourage you to express that, and I hope you will feel comfortable contacting me directly. If you do not feel comfortable, I would encourage you to reach out to our Chemical Engineering Department Head, Professor Carl Laird, and request anonymity if you prefer. I encourage anyone who experiences or observes unfair or hostile treatment on the basis of identity to speak out for justice and support. Anyone can share these experiences using the following resources:
Center for Student Diversity and Inclusion: csdi@andrew.cmu.edu, (412) 268-2150
Report-It online anonymous reporting platform: www.reportit.net (username: tartans password: plaid). All reports will be documented and deliberated to determine if there should be any following actions. Regardless of incident type, the university will use all shared experiences to transform our campus climate to be more equitable and just.
Academic Policies: Students are expected to adhere to the Carnegie Mellon University policy on academic integrity published online at http://www.cmu.edu/policies/documents/AcademicIntegrity.htm.
Tentative Calendar Per Class#
Week |
Date |
Class # |
Topic |
|---|---|---|---|
Week 1 |
Aug 25 |
1 |
Course Introduction & Python Foundations |
Week 1 |
Aug 27 |
2 |
Nonlinear Functions & Root Finding |
Week 2 |
Sep 1 |
— |
No Class – University Closed (Labor Day) |
Week 2 |
Sep 3 |
3 |
Optimization |
Week 3 |
Sep 8 |
4 |
Differential Equations |
Week 3 |
Sep 10 |
5 |
Differential Equations II |
Week 4 |
Sep 15 |
6 |
ML I – Concepts and Introduction |
Week 4 |
Sep 17 |
7 |
ML II – Regression |
Week 5 |
Sep 22 |
8 |
ML II – Regression |
Week 5 |
Sep 24 |
9 |
ML III – Classification |
Week 6 |
Sep 29 |
10 |
Review and advanced topics (as time permits) |
Week 6 |
Oct 1 |
11 |
Review and advanced topics (as time permits) |
Week 7 |
Oct 6 |
— |
Final Group Project Presentations |
Week 7 |
Oct 8 |
— |
Final Group Project Presentations |