These are lecture notes and homeworks for a course taught at the University of Rochester by Andrew White in the Chemical Engineering Department. The course is taught using Jupyter Notebooks.
This course provides an introduction to numerical methods and engineering statistics for chemical engineers. Students learn to use computer models and statistics to understand engineering systems. The focus of numerical methods is translating engineering problems into nalgorithms and implementing them in a spreadsheet or programming language. Topics covered include basic data structures, programming flow control, plotting, function minimization, integration and differential equations. The statistics portion teaches students basic probability theory, the central limit theorem, hypothesis testing, confidence intervals, regression, model fitting and basic error analysis.
Unit 1 — Introduction
Lecture 1: Sample Spaces, Probability Algebra of Samples, Events, Jupyter Notebook, Python Arithmetic, Markdown, Equations in LaTeX
Unit 2 — Probability
Lecture 1: Combinations & Permutations, Multidimensional Sample Spaces, Random Variables, Joints, Marginals, Conditionals
Lecture 2: Working with Joints/Marginals/Conditionals Example, Bayes' Theorem, Independence, Compound Conditionals, Conditional Independence, Table of Useful Equations
Unit 3 — Python Basics
Lecture 1: Floating Point Representation, Python Variables, String Formatting
Lecture 2: Python Booleans, Default Booleans, Floating Point Booleans, Lists, Slicing, Range, For loops, Numpy Arrays, Basic Plotting
Unit 4 — Jupyter Basics & Probability Distributions
Lecture 1: Python Data Types (dictionaries, tuples, ints, floats), Function Arguments, Jupter Notebook Format, IPython Magic, Updating/Installing New Packages, Exporting Notebooks, Notebook Extensions, Python Tutor in Notebooks,
Lecture 2:Bernoulli Distribution, Support, Binomial Distribution, Poisson Distribution, Exponential Distribution, Normal Distribution I, Discrete Probability Intervals, Continuous Probability Intervals, Prediction Intervals Introduced
Lecture 3: Plotting Bargraphs, Style Files, Plotting Discrete vs Continuous, Visualzing Probability Distributions, LaTeX in Plots, Vertical/Horizontal Lines
Unit 5 — Working with Probability Distributions
Lecture 1: Break Statement, While Loops, Discrete Distribution Prediction Intervals, Defining Functions, Named Arguments, Default Function Arguments, Documenting Functions, Scipy Stats, Sampling from Discrtete Distributions, Histogramming,
Lecture 2: Normal Distribution, Cumulative Distribution Functions, Intervals on Normal Distribution, Standard Normal Distribution (Z-Values), Visualizing the Normal Distribution, Sampling from a Model, Defining Numpy Functions
Unit 6 — Working with Data & the t-Distribution
Lecture 1: Sample Mean, Sample Variance, Sample Covariance, Sample Correlation, Median, Mode
Lecture 2: Computung Sample Covariance, Sample Correlation, and setting DDOF.
Lecture 3: Central Limit Theorem, Computing Confidence Intervals, T-values, t-distribution
Unit 7 — Linear Algebra in Python
Lecture 1: Matrix Algebra (linalg
), Solving Systems of Equations, Eigenvector/Eigenvalue, Matrix Rank, Widgets (Button, Text, Interactive), Matplotlib Interactive
Lecture 2: Numerical Differentiation, Numerical Integration via Trapezoidal Rule, Numerical Integration in Scipy, Anonymous Functions (lambda
), Debugging Functions
Unit 8 — Optimization
Lecture 1: Common mistakes with functions, Scope, Root Finding in 1D, Minimization in 1D, Convexity
Lecture 2: Root finding in multiple dimensions, Minimization in multiple dimensions, Bounded Optimization, Non-convex Optimization
Unit 9: — Hypothesis Testing
Lecture 1: Introduction to Hypothesis Testing, the zM and Student's t-Test
Lecture 2: Non-Parametric Statistics, Wilcoxon Sum of Ranks, Wilcoxon Signed Rank, Poisson Test
Unit 10: — MATLAB and Excel
Lecture 1: An overview of MATLAB, the Jupyter Hub server and Excel
Unit 11: — Regression
Lecture 1: Shapiro-Wilk Normality Test, Ordinary Least-Squares Linear Regression in 1- (OLS-1D) and N dimensions (OLS-ND), Standard error, Uncertainty in OLS-1D, OLS-ND, Fit coefficient hypothesis tests, Fit coefficient confidence intervals, Overview of steps to justify and perform regression (bottom of lecture)
Lecture 2: Non-linear regression and error analysis. Deconvoluting spectrum example.
Lecture 3: Regressing categorical data with discrete domains
Lecture 4: Regressing with constant uncertainty/measurement error in independent and/or dependent variables
Lecture Review: Examples and overview of the regression unit
Unit 12: — Differential Equations & Uncertainty Propagation
Lecture 1: Standard form and categorizing differential equations, Solving ODEs
Lecture 2: Error propagation through numerical derivatives, statistical fallacies
Unit 13: — Applied Python - Working with Data and Creating Modules
Lecture 1: Dealing with duplicate, missing, NaN, non-contiguous, out of order data, Joining datasets, Using Pandas, Using Seaborn, Computing Running Means
Lecture 2: Packaging and documenting python functions in a module
Unit 14: — User Interfaces
Lecture 1: Creating and writing animations
Lecture 2: Introduction to HTML, CSS, JS and modifying notebook style
Unit 15: — What to do now
Lecture 1: Next steps to learn more about numerical methods, statistics, and programming