Repo to support updated module Introduction to Modelling (CT248), which now uses Python instead of MATLAB.
My main expertise to date is in using R for data science, so I'm looking forward to the opportunity to learning some new skills, and also comparing and contrasting how you can achieve the similar outcomes with both languages.
Here are some of my R resources:
-
Exploring Operations Research with R, my 2024 textbook (CRC Press) on R, and its application to the field of operations research.
-
System Dynamics Modelling with R, my 2016 textbook (Springer) on how you can combine system dynamics modelling with R.
There are three main parts to this course:
-
First, we introduce Python, its data structures, the use of functions, and the NumPy package, which provides support for manipulating matrices.
-
Next, we show how ordinary differential equations can be implemented using SciPy, and focus on a number of interesting models, including exponential growth and decline, logistic growth, and diffusion processes.
-
Finally, using pandas, we introduce exploratory data analysis for a variety of data sets, and also explore a range of statistical methods including correlation and linear regression modelling.
There are a number of books used as reference material, including:
- "Python for Data Analysis, 3rd Edition" by Wes McKinney, published by O'Reilly Media.
- Week 1: Introduction to Python
- Week 2: Exploring arrays using NumPy
- Week 3: Writing Functions in Python
- Week 4: Lambda Functions in Python
- Week 5: Plotting and Visualisation
- Week 6: Introduction to Modelling using Stocks and Flows
- Week 7: Mathematical Modelling with Python's odeint function
- Week 8: Three ODE Modelling Case Studies
You can run all the course code with a google colab account. You may want to install code locally on your machine, and to do this, you can install Miniconda.
For windows, you can download Miniconda from here
When Minconda is installed, you can then install Jupyter Notebook on your machine.
Spyder is a nice IDE for Python, see the following link
Here are some useful Python-related links (thanks to my colleague James McDermott for the pointers).