0% found this document useful (0 votes)
16 views10 pages

WTW152 Online Semester Test-2020 ST1 WTW152 Online Semester Test-2020 ST1

The document outlines the structure and requirements for the WTW 152 Online Semester Test at the University of Pretoria, focusing on mathematical modeling. It includes detailed instructions for test completion, including the use of specific software and programming packages, as well as guidelines for submitting answers. The test consists of multiple questions that require students to apply mathematical concepts and programming skills to solve problems related to difference equations and logistic models.

Uploaded by

amahle.ngqulunga
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views10 pages

WTW152 Online Semester Test-2020 ST1 WTW152 Online Semester Test-2020 ST1

The document outlines the structure and requirements for the WTW 152 Online Semester Test at the University of Pretoria, focusing on mathematical modeling. It includes detailed instructions for test completion, including the use of specific software and programming packages, as well as guidelines for submitting answers. The test consists of multiple questions that require students to apply mathematical concepts and programming skills to solve problems related to difference equations and logistic models.

Uploaded by

amahle.ngqulunga
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

lOMoARcPSD|52658547

WTW152 Online Semester Test-2020 ST1

Mathematical modelling (University of Pretoria)

Scan to open on Studocu

Studocu is not sponsored or endorsed by any college or university


Downloaded by Baharia USA ([email protected])
lOMoARcPSD|52658547

UNIVERSITY OF PRETORIA
FACULTY OF NATURAL AND AGRICULTURAL SCIENCES
DEPT OF MATHEMATICS AND APPLIED MATHEMATICS

WTW 152 : MATHEMATICAL MODELLING

ONLINE SEMESTER TEST

DUE DATE: 22h00, Fri 5 JUNE 2020.


TIME: 3 hours
MARKS: 60

Internal examiners: Dr. M. Messerschmidt


Ms. P. Dumani
External examiner: Prof. M. Banda

Section B (Office use only):

Q1 Q2 Q3 Q4 Q5 Total
14 10 10 9 17 60

READ THE FOLLOWING INSTRUCTIONS.

(1) The paper consists of pages 1 to 9. Check whether your paper is complete.
(2) Read all questions and instructions carefully. Any failure to follow instructions will be penalized.
(3) This test is individual. You are not permitted to discuss this test with anyone in any forum. Any case
of dishonesty will be reported.
(4) This test is open book. You may use any study material provided on clickUP. Use of material found on
the internet is permitted, but such material is used at your own risk and may be arbitrarily penalized
at the discretion of the examiner/grader.
(5) Submit your answers for each question separately on the provided forms on clickUP.
(6) Answers to any given question may be submitted at any time before the deadline. It is not required to
submit your answers to all questions all at once, or even on the same day.
(7) It is assumed that you are using the software packages Anaconda and LibreOffice. Use of any other
software is permitted, but you do so at your own risk and may be arbitrarily penalized at the discretion
of the examiner/grader.
(8) Use of any package in the Python3 standard library is permitted. You may only use the following
3rd party Python3 packages: numpy, sympy and matplotlib. Use of other 3rd party packages is not
permitted.
(9) It is assumed that you have all required software installed and functioning correctly on an appropriate
device. Any IT issue occurring on a personal device remains solely the responsibility of the owner of
the device. UP IT-help ([email protected]) may be contacted for assistance in the event of any IT issues.
(10) Any sick notes should be handed in within 3 days of the test deadline. Note that sick notes are required
to cover all days that submission is active to be accepted.

Copyright reserved WTW 152


Page 1 of 9

Downloaded by Baharia USA ([email protected])


lOMoARcPSD|52658547

Question 1.
Save all files created in completing this question and upload them when filling out the online
submission form.
In this question let a, b, and c equal last three NON-ZERO digits of your student number. (E.g., if your
student number is u04535080, then a := 3, b := 5, c := 8).

Define a difference equation as follows: Let g0 := a, g1 := b, and g2 := c. For n = 3, 4, 5, 6..., define


gn := agn−2 + gn−3 .
Consider the following function specification:

Function Specification :

Input :
n : a non - negative integer
Output :
The value of gn .

The following Python3 function claims to implement the above function specification. Replace the #’s with
the values determined from your student number.

def g_recursive ( n ):
a = #
b = #
c = #

if n == 0:
return a
elif n == 1:
return b
elif n == 2:
return c
else :
return g_recursive ( a *( n -2)) + g_recursive (n -3)

Question 1.1. [0]


Write down the values for a, b, c as determined by your student number.

Question 1.2. [1]


Is the function implemented above recursive or non-recursive? Explain.

Question 1.3. [1]


With the values a, b and c determined from your student number filled in, does the above implementation
CORRECTLY implement the function specification?

Question 1.4. [3]


If you answered “No” in the previous question, suggest a correction.

Question 1.5. [2]


When trying to compute the value of g100 by running g recursive(100) my computer stops responding and
no output is obtained.
At the hand of roughly how many times the function g recursive is called in total when the command
g recursive(100) is run, explain in your own words why it is not appropriate to attempt to compute the value
of g100 using an implementation like the one above (regardless if the implementation above is correct or not).

Page 2 of 9

Downloaded by Baharia USA ([email protected])


lOMoARcPSD|52658547

Question 1.6. [4]


Implement a NON-RECURSIVE algorithm in Python3 according to the above function specification.
Copy and paste all Python3 code used into the online submission form.

Question 1.7. [3]


With the values a, b, c as determined from your student number, compute the correct values of the following
numbers.
• g100
• g300
• g1000
Write down the first three digits and last three digits for each number.
(E.g. 5725823456002347742394866723345 has first three digits: 572, and last three digits: 345).

Page 3 of 9

Downloaded by Baharia USA ([email protected])


lOMoARcPSD|52658547

Question 2.
Save all files created in completing this question and upload them when filling out the online
submission form.
In this question let s equal the number formed by the last three NON-ZERO digits of your student number.
(E.g., if your student number is u04535080, then s := 358.) Set A := 1000 × s and B := 10 × s.

By setting up a well-documented spreadsheet. Answer the following questions by reading off the answer from
your spreadsheet AND/OR performing an appropriate GOALSEEKs.

An investment account is opened with principal amount P rand and accrues interest of 10% per annum,
compounded monthly. After every 12th month, counting from the moment when the account is opened, a
deposit is made into the investment account. No deposits are made in the intervening months. The first
deposit amount of Q rand is made 12 months after the moment that the account is opened, and every one of
subsequent deposits is increased by 4% from the directly previous deposit amount

Question 2.1. [0]


Write down the values of s, A, B that you determined from your student number.

Question 2.2. [2]


If the principal amount P is equal to A rand, as determined above, and the first deposit amount Q equal to
R 2000, what is the account balance after 60 months? (Round DOWN to the nearest rand)

Question 2.3. [2]


If the principal amount P is equal to R100 000, as determined above, and the first deposit amount Q equal
to B rand, how long will it take to reach a balance of at least R2 000 000 in the account?

Question 2.4. [3]


If the first deposit amount Q is equal to B rand, what principal amount P should be initially invested so as
to have a balance of R1 000 000 in the account after 132 months? (Round UP to the nearest rand)

Question 2.5. [3]


If a principal amount P of A rand is initially invested, what should the first deposit amount Q be, so as to
have a balance of R5 000 000 in the account after 132 months? (Round UP to the nearest rand)

Page 4 of 9

Downloaded by Baharia USA ([email protected])


lOMoARcPSD|52658547

Question 3.
Save all files created in completing this question and upload them when filling out the online
submission form.
Obtain the function f : R → R that is assigned to your student number from the provided appendix. Use
this function to answer the following questions.

With r0 > 0, define the difference equation rn := f (rn−1 ) for all n = 1, 2, 3....

Triple check whether you are using the correct function assigned to your student number. Triple check whether
you copied your function correctly, including all digits and signs. Any error or typos in reading/copying the
function may result in severe penalties.

Question 3.1. [1]


Define a growth factor for the difference equation. That is, define a function g : R → R, that satisfies the
following equation f (x) = g(x)x for all x ∈ R.

Question 3.2. [2]


Determine all the equilibria of the difference equation. Round to the nearest whole number. Write the
equilibria in increasing order.
Copy and paste all Python3 code used into the online submission form.

Question 3.3. [2]


Make a line plot of the graph of the growth factor g on the interval [0,100].
Copy and paste all Python3 code used into the online submission form.

Question 3.4. [2]


Classify each equilibrium of the difference equation as either stable or unstable.

Question 3.5. [1]


Write down g(55) correct to 8 decimals. If r0 := 55, will the solution of the difference equation increase or
decrease from 55? Explain.

Question 3.6. [2]


Without doing any calculation, if r0 := 55, state whether the solution of the difference equation eventually
approach any of the equilibria? If yes, which? Explain fully.

Page 5 of 9

Downloaded by Baharia USA ([email protected])


lOMoARcPSD|52658547

Question 4.
Save all files created in completing this question and upload them when filling out the online
submission form.
Foot-and-Mouth-Disease (FMD) is a highly infectious disease of both domestic and wild hoofed animals.
Outbreaks of FMD in farms can have devastating economic effects and severely disrupt food supply chains.
Wildlife managers at the Kruger National Park are preparing for scenarios in managing an outbreak of FMD
in the african buffalo population, by using the logistic difference equation as a mathematical model.
With M, r, y0 > 0, the logistic difference equation is defined, for n = 1, 2, 3, 4 . . ., as

yn := yn−1 + ryn−1 (M − yn−1 ).

Let Mbuffalo := 48000 denote the total buffalo population in the Kruger National Park. Let y0 := 1 and, with
n = 1, 2, 3, ..., let yn denote the predicted number of infected individuals in the buffalo population, n days after
the moment that a first individual buffalo became infected with FMD.
The World Veterinary Association (WVA) has developed a protocol for preventative measures to mitigate the
spread of FMD under populations of wild hoofed animals. Although these measures do not prevent outbreaks
entirely, they do slow the spread of the disease initially before an outbreak is detected. This allows more time
to allow for an active response to be mounted when an outbreak is detected.
Data measured from previous outbreaks of FMD, give values of the parameter r under the scenarios with–,
and without the suggested preventative measures. They are:

rwith preventative measures := 6.7 × 10−7 .

rwithout preventative measures := 2.1 × 10−6

Question 4.1. [3]


Implement a NON-RECURSIVE function in Python3 according to the following specification:

Function Specification :

Name :
logistic

Input :
n : a non - negative integer
r : a positive real number
M : a positive real number

Output :
The value of yn as defined by the logistic difference equation ,
using provided values for the parameters r and M .

Question 4.2. [2]


Use the logistic difference equation to make a prediction of how many days it will take for at least half of
the Kruger National Park’s buffalo population to become infected WITH preventative measures being taken
(counted from the moment that the first individual buffalo becomes infected).
That is, with the parameters M = 48000 and r = 6.7 × 10−7 , what is the smallest natural number n so that
yn ≥ 48000/2?
Copy and paste all Python3 code used into the online submission form.

Question 4.3. [2]


Use the logistic difference equation to make a prediction of how many days it will take for at least half of the
Kruger National Park’s buffalo population to become infected WITHOUT preventative measures being taken
(counted from the moment that the first individual becomes infected).
That is, with the parameters M = 48000 and r = 2.1 × 10−6 , what is the smallest natural number n so that
yn ≥ 48000/2?
Copy and paste all Python3 code used into the online submission form.
Page 6 of 9

Downloaded by Baharia USA ([email protected])


lOMoARcPSD|52658547

Question 4.4. [2]


The WVA’s suggested preventative measures carry a huge financial cost. This cost has to be weighed against
the amount of time that it buys. If these measures only buy one or two days’ time from case zero to 50% of the
population infected, then the money might be better spent elsewhere.
With this in mind, in your own words, briefly comment the predictions made by the model, and on whether
incurring a huge cost is predicted to provide any benefit.

Page 7 of 9

Downloaded by Baharia USA ([email protected])


lOMoARcPSD|52658547

Question 5.
Save all files created in completing this question and upload them when filling out the online
submission form.
Obtain the dataset referred to in this question from the provided appendix.

A friendly military base is located on a 300m high cliff facing the ocean. With an edge on view, the sea
surface is represented by the set of points {(x, 0) ∈ R2 : x ∈ (−∞, 0]}. Ground level on the cliff is represented by
the set of points {(x, 300) ∈ R2 : x ∈ [0, ∞)}. The cliff face is represented by the set {(0, y) ∈ R2 : 0 ≤ y ≤ 300},
with the base of the cliff at the origin.

Critical buildings in the military base along with their locations are:
• The RADAR installation located at the coordinates (200m, 300m).
• The ammunition DEPOT located at the coordinates (300m, 300m).
• The missile defence LASER located at the coordinates (1000m, 300m).

An enemy submarine has sneaked into our coastal ocean undetected. The submarine has launched a number
of ballistic missiles, travelling in the positive x-direction, toward our friendly military base. A dataset of the
(x, y)-coordinates (in meters) of all incoming missiles measured over the last few minutes has just arrived from
the radar station. The radar operator is incompetent, so the data is all scrambled up.
Below is a diagram, not to scale, depicting the situation.

Question 5.1. [2]


Make a SCATTER PLOT of the dataset received from the radar station. You should see four missiles
incoming!
Copy and paste all Python3 code used into the online submission form.

For future reference, we label the missiles as “missile A”, “missile B”, “missile C” and “missile D” according
to their measured y-coordinates, from highest to lowest, “missile A” being the highest, and “missile D” being
the lowest.

Page 8 of 9

Downloaded by Baharia USA ([email protected])


lOMoARcPSD|52658547

Question 5.2. [4]


Separate the positional data for each incoming missile into its own dataset. For each incoming missile you
should have a separate list of its (x,y)-coordinates as measured. That is, store the positional data for each missile
in its own variable called “missile A data”, “missile B data”, “missile C data” and “missile D data”.
Performing this task by hand will earn zero marks in this question.
Copy and paste all Python3 code used into the online submission form.

Hints:
• Use the plot you made to determine an interval in which the y-coordinates of each missile falls. Write
conditional list comprehensions with each having an appropriate condition on the y-coordinate.
• There are exactly nine data points for each missile.

Question 5.3. [2]


Assume that EACH incoming missile follows a trajectory that is described by the curve with equation
y = ax2 + bx + c
with a, b, c ∈ R unknown parameters.
For EACH of the incoming missiles, “missile A”, “missile B”, “missile C” and “missile D’, use numpy’s
polyfit function to determine the values of the parameters a, b and c of the curve that best fits it’s positional
data.
Copy and paste all Python3 code used into the online submission form.

Question 5.4. [6]


For EACH incoming missile, determine the coordinates where the missile is expected to impact the ground.
From this, determine which building in the friendly base, if any, is being targeted by each missile.
You may use sympy to solve any equations that need to be solved.
Copy and paste all Python3 code used into the online submission form.

Question 5.5. [3]


Submarines launch their missiles from just below the surface of the ocean. Determine the coordinates of the
likely location where the enemy submarine had launched its missiles from.
(Round to the nearest 10 meters. Submarines are huge vehicles, so even a 10m discrepancy is not much).
Copy and paste all Python3 code used into the online submission form.

END
Page 9 of 9

Downloaded by Baharia USA ([email protected])

You might also like