MATH 3290 Mathematical Modeling
Overview of the course
Kuang HUANG
January 12, 2024
Department of Mathematics
The Chinese University of Hong Kong
People
Instructor
• Kuang HUANG
• Office: LSB 237A
• Email: kuanghuang@cuhk.edu.hk
• Office hour: by appointment
Teaching Assistant
• Yingjie ZHOU • Zi Him Jason CHOY
• Office: LSB 222C • Office: LSB 222A
• yjzhou@math.cuhk.edu.hk • zhchoy@math.cuhk.edu.hk
Kuang HUANG MATH3290-2023/24 2
Class time and venue
Lecture
• Wednesday 9:30AM - 10:15AM, Science Centre L5;
• Friday 9:30AM - 11:15AM (15-min break), Mong Man Wai Bldg 710.
Tutorial
• Wednesday 8:30AM - 9:15AM, Science Centre L5.
• NO tutorial this week.
Course Webpage
https://www.math.cuhk.edu.hk/course/2324/math3290
Kuang HUANG MATH3290-2023/24 3
Course description
This course is an introduction to mathematical modeling.
We will cover some basic mathematical tools for the quantitative
description of practical problems arising from physics, biology,
economics and engineering. The use of these mathematical models
allows us to quantitatively study and provide solutions to these
problems.
The focus of this course is to give an overview of the mathematical
techniques that are commonly used in practice, and illustrate the
modeling procedure through some elementary examples.
You will get a taste of mathematical modeling.
Kuang HUANG MATH3290-2023/24 4
Textbook
We will follow closely:
A First Course in Mathematical Modeling
by Giordano, Fox, Horton and Weir (5th
Edition).
Lecture slides will be released at the course webpage. We will not
provide hard copies.
Kuang HUANG MATH3290-2023/24 5
Outline of the course
• The Modeling Process
• Modeling Change
• Model Fitting
• Experimental Modeling
• Simulation Modeling
• Optimization of Discrete Models
• Optimization of Continuous Models
• Modeling Using Graph Theory
• Modeling with a Differential Equation
• Modeling with Systems of Differential Equations
Kuang HUANG MATH3290-2023/24 6
Your background
You should be good at
• Linear algebra (e.g. MATH 1030, 2040);
• Multivariable calculus (e.g. MATH 2010, 2020);
• Computing (e.g. MATLAB, Python, C, C++, Excel, · · · ).
Remark: The models we will discuss are deterministic models. We
will skip the discussion on most stochastic models, as these require
knowledge in probability theory which is not assumed in this course,
while stochastic models are widely used too.
Kuang HUANG MATH3290-2023/24 7
Assessment scheme
Your final grade depends on the following.
• Assignment (15%)
• 3-4 assignments in total.
• Both theoretical and computational (MATLAB, Python, Excel or C).
• 1 − 2 problems will be graded for each assignment due to limited
manpower.
• You are encouraged to work on optional problems.
• Submitting your assignments via Blackboard, late submissions are
not allowed.
• Midterm (35%), March 15, a closed-book 90-min exam.
• Final (50%), TBA, a closed-book two-hour exam.
Kuang HUANG MATH3290-2023/24 8
Code of academic honesty
• Very high importance on honesty in
academic work submitted by students.
• Zero tolerance on cheating and plagiarism.
• Any related offense will lead to disciplinary
action including termination of studies.
Honesty in Academic
Work: A Guide for
Students and Teachers
Kuang HUANG MATH3290-2023/24 9
Don’t Panic
• “All models are wrong, but some are useful”
• This is not a pure mathematical course, we will seldom talk about
theorems, lemmas etc.
• Simple models are not always useful, but popular.
• “Rome wasn’t built in a day”
• In most scientific disciplines, mathematical models are ubiquitous.
• The legacy from my own “Mathematical Modeling” course is the
coding ability.
• You may participate in some mathematical modeling contests
(MCM/ICM and CUMCM).
Kuang HUANG MATH3290-2023/24 10
Some suggestions about computing languages/tools
Some assignments need you to write codes. However, computing
performance/efficiency is not in our consideration, while the primary
goal is implementing algorithms and outputting your results in
graphs or tables.
Matlab
(Pros) • Out-of-the-box usage
• A lot of built-in functions
• Easy to draw graphs
• Free student license...
(Cons) • Expensive out of the school
• Limited usages beyond academic areas
• Personally, indexes in Matlab start from 1...
Kuang HUANG MATH3290-2023/24 11
Some suggestions about computing languages/tools
Python (Anaconda)
(Pros) • Popularity, the default choice in machine
learning...
• Anaconda (NumPy + SciPy + Matplotlib)
provides all you needed
• Totally free and open
• It is a general programming language...
(Cons) • Computing performance may not be
satisfying (still at the same level with
Matlab)
Kuang HUANG MATH3290-2023/24 12
Some suggestions about computing languages/tools
Excel
(Pros) • user-friendly
• Easy to perform data analysis (draw
figures)...
(Cons) • Programming on it may not be
straightforward (Excel VBA)...
C/C++, Fortran
(Pros) • Extremely efficient!
(Cons) • Extremely hard to configure for beginners
• It will be too heavy to perform data
visualizations...
Kuang HUANG MATH3290-2023/24 13
Announcements
• Jan 17: a review of Python and MATLAB during tutorial time.
• The slides can be downloaded from the course webpage.
• The assignments should be submitted to Blackboard.
• Please check both the course webpage and Blackboard regularly.
• Midterm: Mar 15, a closed-book 90-min exam.
Kuang HUANG MATH3290-2023/24 14
Timetable
Kuang HUANG MATH3290-2023/24 15
Brief description of contents
Topics:
• Modeling by difference equations
• Model fitting and empirical modeling
• Mathematical tools for big data analysis
• Simulation modeling
• Modeling by graph theory
• Optimization modeling, both discrete and continuous
• Modeling by differential equations
Kuang HUANG MATH3290-2023/24 16
Modeling by difference equations
Use difference equations to describe some behaviors, such as
an+1 = 3an + 2, bn+1 = 2bn + 5bn−1 .
In above, an , bn represent quantities of interest, and n usually
represents time. These are relations of quantities of interest at
various times.
One can use this to model (for example):
• some financial quantities, such as, loan, interest, …
• drug concentration for medical applications,
• voting behaviors,
• ···
Kuang HUANG MATH3290-2023/24 17
For example, we obtain the following model based on observations:
pn+1 = pn + 0.00082(655 − pn )pn ,
where pn is concentration of yeast at time n.
One can use this model for predictions.
Kuang HUANG MATH3290-2023/24 18
Brief description of contents
Topics:
• Modeling by difference equations
• Model fitting and empirical modeling
• Mathematical tools for big data analysis
• Simulation modeling
• Modeling by graph theory
• Optimization modeling, both discrete and continuous
• Modeling by differential equations
Kuang HUANG MATH3290-2023/24 19
Model fitting
To find a mathematical relationship among variables.
Typically, some known mathematical formulas are assumed, and one
needs to determine unknown parameters (also called parameter
identifications).
For example, the variable y depends on the quantities x and w. It is
known that the relation has an expression
y = af (x) + bg(w) + ch(x, w),
where f (x), g(w) and h(x, w) are given functions.
We then use some mathematical principles to find the parameters a,
b and c that best describe the data.
Kuang HUANG MATH3290-2023/24 20
Assume you are interested in finding the relationship between
weights W and lengths l of a certain kind of fish, and the following
observations are obtained.
Note, the weight (precisely, mass)
should be a function of the
volume.
Therefore, one should fit
W = c l3 ,
where c is a parameter.
Kuang HUANG MATH3290-2023/24 21
Empirical modeling
To find a mathematical relationship among variables.
The exact mathematical relations among the variables are not
known.
For example, the variable y depends on the quantities x and w. We
need to find f (x, w) such that
y = f (x, w).
This problem is harder. Typically, one needs to get some
measurement data.
Kuang HUANG MATH3290-2023/24 22
Brief description of contents
Topics:
• Modeling by difference equations
• Model fitting and empirical modeling
• Mathematical tools for big data analysis
• Simulation modeling
• Modeling by graph theory
• Optimization modeling, both discrete and continuous
• Modeling by differential equations
Kuang HUANG MATH3290-2023/24 23
Big data analysis
Given a set of n data points xj ∈ Rd . We typically assume both n and
d are large.
There are two important questions:
• how to get the main feature of the data, and perform data
compression,
• how to divide the data into groups, i.e., data clustering.
Kuang HUANG MATH3290-2023/24 24
Getting main features of data points
How to obtain main features?
How to extract main “directions” in a given data set?
In high dimensions, this is not easy, while principal component
analysis (PCA) is a good tool.
Kuang HUANG MATH3290-2023/24 25
Application
One can perform dimensional reduction (data compression).
a: A given data set in high dimension.
b: There are two main directions, called PC1 and PC2 .
c: One can project the data into a 2D (=two-dimensional) space.
Kuang HUANG MATH3290-2023/24 26
Using different numbers of principal directions:
Kuang HUANG MATH3290-2023/24 27
Future extraction
One can also use PCA to extract important information:
Kuang HUANG MATH3290-2023/24 28
Data clustering
How to divide the data into groups? (i.e. how to cluster the data?)
Not easy in high dimensions.
Kuang HUANG MATH3290-2023/24 29
Species classification
One can use data clustering to classify species.
“If it walks like a duck, quacks like a duck, and looks like a
duck, then it’s probably a duck.”
We have some known clustered (by features) data. Compare the new
one with existing clusters.
Kuang HUANG MATH3290-2023/24 30
Other potential applications of data clustering:
• identifying biological properties;
• classifying credit card transactions;
• categorizing documents (e.g. novel, politics, etc.).
“Pl@ntNet is an application that al-
lows you to identify plants simply by
photographing them with your smart-
phone…”
iOS/Andriod:
PlantNet
Kuang HUANG MATH3290-2023/24 31
Brief description of contents
Topics:
• Modeling by difference equations
• Model fitting and empirical modeling
• Mathematical tools for big data analysis
• Simulation modeling
• Modeling by graph theory
• Optimization modeling, both discrete and continuous
• Modeling by differential equations
Kuang HUANG MATH3290-2023/24 32
Simulation modeling
In empirical modeling, one needs data.
There are situations where experiments are expensive, or even
impossible.
• It is harmful to inject certain drugs in body.
• Tests are expensive in the design of aircraft.
Therefore, one needs to simulate the situation. That is, we use
random numbers to simulate the appearance of certain events.
We will discuss the basic idea of Monte Carlo simulations.
Kuang HUANG MATH3290-2023/24 33
Monte Carlo simulations
• The inputs are modeled by random numbers (with various
distributions).
• The output y is computed by f (which is also a random variable).
• One obtains f by some knowledge such as measurement data.
Kuang HUANG MATH3290-2023/24 34
Brief description of contents
Topics:
• Modeling by difference equations
• Model fitting and empirical modeling
• Mathematical tools for big data analysis
• Simulation modeling
• Modeling by graph theory
• Optimization modeling, both discrete and continuous
• Modeling by differential equations
Kuang HUANG MATH3290-2023/24 35
Modeling by graph theory
Some problems can be modeled by graphs.
A graph G contains 2 sets: a vertex set V(G) & an edge set E(G).
Seven Bridges of Königsberg
Kuang HUANG MATH3290-2023/24 36
Example 1: Social network
A social network can be modeled by a graph:
• Each user is considered as a vertex.
• Two users can form an edge if they
are friends.
• One interesting problem is the
degree of separation, it is the
shortest distance between any 2
users.
• In 2016, the average degree of
separation of Facebook users is 4.57.
Kuang HUANG MATH3290-2023/24 37
Example 2: Route planning
Route planning problem can be modeled by a graph:
• Each road intersection is considered
as a vertex.
• A road between two adjacent
intersections is an edge.
• The problem is to find a path giving
the shortest distance between 2
destinations.
• We see that there is a need to give
weights to edges.
Kuang HUANG MATH3290-2023/24 38
Example 2: Route planning
Route planning problem can be modeled by a graph:
• Each road intersection is considered
as a vertex.
• A road between two adjacent
intersections is an edge.
• The problem is to find a path giving
the shortest distance between 2
destinations.
• We see that there is a need to give
weights to edges.
Kuang HUANG MATH3290-2023/24 38
Brief description of contents
Topics:
• Modeling by difference equations
• Model fitting and empirical modeling
• Mathematical tools for big data analysis
• Simulation modeling
• Modeling by graph theory
• Optimization modeling, both discrete and continuous
• Modeling by differential equations
Kuang HUANG MATH3290-2023/24 39
Optimization modeling
We consider optimization problems: find X ∗ such that
f (X) is optimized,
where X = (x1 , · · · , xn ) are called decision variables.
• Unconstrainted: f is optimized without restrictions on X.
• Constrainted: there are restrictions on X.
• Equalities: gi (X) = bi , for i = 1, 2, · · · , m.
• Inequalities: gi (X) ≤ bi , for i = 1, 2, · · · , m.
• Mixed: both equalities and inequalities.
Kuang HUANG MATH3290-2023/24 40
Example
Find X ∗ such that
f (X) is optimized
subject to gi (X) = bi or gi (X) ≤ bi
• f can be profit to be maximized, gi are some resource
limitations.
• f can be the risk to be minimized, gi are expected earnings.
Classifications
• f and gi are linear. This is linear programming.
• f and gi are linear and X integer. This is integer programming.
• f and gi is/are nonlinear. This is non-linear programming.
Kuang HUANG MATH3290-2023/24 41
Example: integer programming
Suppose:
• net profits of $25 per table, and $30 per bookcase;
• the carpenter has 690 units of wood, and 120 units of labor;
• each table requires 20 units of wood and 5 units of labor;
• each bookcase requires 30 units of wood and 4 units of labor.
We can then formulate the following
maximize 25x1 + 30x2
subjects to
20x1 + 30x2 ≤ 690,
5x1 + 4x2 ≤ 120,
where x1 ≥ 0, x2 ≥ 0 and x1 , x2 are integers.
Kuang HUANG MATH3290-2023/24 42
Example: portfolio optimization
Suppose that there are n assets. You want to invest a fixed amount
of money. How do you allocate your investments?
Let xi be the portion of money invested in the asset i.
Two important factors: return and risk
• Assume µi is the average return of asset i. On average, you have
the following return
µ 1 x1 + µ 2 x2 + · · · + µ n xn
• Risk is typically modeled by a n × n positive definite matrix Q.
The risk is
1 T
x Qx
2
where x = (x1 , x2 , · · · , xn )T . Risk is large if this number is big.
Kuang HUANG MATH3290-2023/24 43
Two common ways
• We find xi so that
1
maximize µ1 x1 + · · · + µn xn − xT Qx
2
(maximize return at the same time minimize risk) subjects to
x1 + · · · + xn = 1, xi ≥ 0.
• Given a fixed number R, we find xi
1
maximize − xT Qx
2
subjects to
x1 + · · · + xn = 1, xi ≥ 0
and
µ1 x1 + · · · + µn xn ≥ R
(minimize risk, and having return of at least R).
Kuang HUANG MATH3290-2023/24 44
Brief description of contents
Topics:
• Modeling by difference equations
• Model fitting and empirical modeling
• Mathematical tools for big data analysis
• Simulation modeling
• Modeling by graph theory
• Optimization modeling, both discrete and continuous
• Modeling by differential equations
Kuang HUANG MATH3290-2023/24 45
Modeling with differential equations
Modeling quantities that change continuously in time (For example,
populations, concentration of chemicals, etc.).
(Recall that, difference equations model quantifies that change in
discrete time intervals.)
A differential equation is an equation relating a quantity of interest
and its derivatives, e.g.,
dx d2 y dy
= ax(b − x), + 2t = 3y.
dt dt2 dt
Derivatives represent instantaneous change rates of a quantity.
Kuang HUANG MATH3290-2023/24 46
A mathematical problem
Can one determine the internal properties of a medium by making
measurements outside the medium?
Q: Can we determine internal properties from attenuation of X-rays?
Kuang HUANG MATH3290-2023/24 47
Attenuation coefficient
Attenuation coefficient—µ(x) quantifies the tendency of an object to
absorb X-rays.
(Don’t worry about the negative signs.)
Kuang HUANG MATH3290-2023/24 48
Beer’s law
Beer’s law states that the intensity of X-ray—I(s) satisfies
dI
= −µ(s)I(s),
ds
where s is the arc-length parameter along the X-ray.
Kuang HUANG MATH3290-2023/24 49
Example: Drug dosage
We combine differential and difference equations in a model.
Q: How can the doses and the time between doses be adjusted to
maintain a safe but effective concentration of drug?
Assumption 1: Decay of drug
Let C(t) be the concentration of the drug. Then we assume
dC
= −kC
dt
where k > 0 is the decay rate.
Assumption 2: Constant dosage
A dose of C0 is added at fixed time intervals of length T.
Kuang HUANG MATH3290-2023/24 50
Example: the SIR model
S(t) = the number of susceptible population, dS βIS
I(t) = the number of infected population, =− ,
dt N
R(t) = the number of removed population dI βIS
= − γI,
(either by death or recovery), dt N
N = the number of total population. dR
= γI.
dt
This is a simplified model and is also far from the reality
(vaccination, the possibility of re-infection, incubation, etc.).
Kuang HUANG MATH3290-2023/24 51
Finding solutions
We will discuss three ways to find solutions:
• analytical solutions, but only for simple cases;
• graphical solutions, may work for a more general class of
differential equations to understand qualitative behaviors
including long term behaviors;
• numerical solutions, can work for almost all cases, and one can
obtain approximate values of solutions.
Kuang HUANG MATH3290-2023/24 52
Course webpage
https://www.math.cuhk.edu.hk/course/2324/math3290
Kuang HUANG MATH3290-2023/24 53
Disclaimer
All figures, tables, and data appearing in the slides are only used for
teaching under guidelines of Fair Use.
Kuang HUANG MATH3290-2023/24 54