Starting from:

$29

Math 232 – Computing Assignment 3 SOLVED

Math 232 – Computing Assignment 3

Programming Preamble:
Matlab: You need to be able to enter column vectors and matrices.
Matlab: You need to be able to multiply a matrix by a vector.
Matlab: You need to be able to draw lines on the same figure.
Matlab: help plot gives you all the information you need to make your plots look good - labelling
the axes, putting on a title etc.
Matlab: Use a for loop (see Matlab documentation) to repeatedly multiply your age distribution
vector ⃗xt by your transition matrix A for a specified number of times. This little bit of script could
be modified for this purpose;
>> y=x1;
>> for i=1:10
y2=A*y;
XX(:,i)=y2;
y=y2;
end
Here, the matrix XX stores the vectors y2 that are iterates of the vector x1 as its columns, and
these columns can be plotted individually.
Computing Assignment
Required submission: 1 page PDF report and Matlab or Python code (.m or .py respectively,
exported as a .pdf) uploaded to Canvas.
Population Dynamics
This assignment is designed to show you a basic model used to describe and predict population
dynamics. Please read pages 164-167 of the secondary textbook (Boyd and Vandenberghe, available
as a .pdf from Canvas).
1
These websites may be useful to refer to while working on this assignment;
Age distribution in Canada;
https://www150.statcan.gc.ca/t1/tbl1/en/tv.action?pid=1710000501
https://www.statista.com/statistics/266540/age-distribution-in-canada/
Birth rates Canada;
https://www150.statcan.gc.ca/t1/tbl1/en/tv.action?pid=1310041801
Death rates;
https://www150.statcan.gc.ca/n1/pub/71-607-x/71-607-x2021032-eng.htm
Projections of population in Canada;
https://www150.statcan.gc.ca/n1/pub/71-607-x/71-607-x2022015-eng.htm
Let ⃗xt
,(⃗xt)i = number of people in Canada with age i − 1 in year t (say, on Jan 1 of that year),
i = 1, . . . , 100, where t = 0 denotes the year 2000.
The birth rate is given by a vector ⃗b,(
⃗b)i
, i = 1, . . . , 100.
The death rate is given by a vector ⃗d,(
⃗d)i
, i = 1, . . . , 100.
1. Find age distribution, birth rate, and death rates for Canada (like Figures 9.1 - 9.3 in the
book by Boyd and Vandenberghe are for the US) by utilizing the internet.
2. Formulate a discrete dynamical model as described in those pages from the book by Boyd
and Vandenberghe. In particular, make sure you specify your transition matrix in the cases
below.
3. From your model, make plots of the age distribution in Canada for the years 2028, 2033, and
2038 (5, 10, and 15 years from now), similar to Figure 9.4 (3 plots on one graph, different
colours each). For example, the following piece of code can be modified for this;
>> plot(XX(:,1),’b-’)
>> hold on
>> plot(XX(:,5),’r-’)
>> hold on
>> plot(XX(:,9),’k-’)
(with axis and lines suitably labeled)
4. Now make a modification of your model (i.e., the transition matrix A) incorporating immigration. Make a simple assumption of what the average immigration rate is per year based
on data you find on the web (for example, immigration could only affect the population distributions of people between the ages of 20 and 40). Plot again the predicted population
distribution for Canada for the years 2028, 2033, and 2038 from this new model.
5. What other factors do you think would make this model more realistic or more accurate?
2

More products