Further Modelling - Lesson
Further Modelling - Lesson
Jamie Frost
www.drfrost.org
@DrFrostMaths
( 2 , 200 )
Give some example scenarios where
2
we might use an exponential model:
(years)
• Population growth/decline
• Size of investment over time,
• ?
Radioactive decay. 3 A suitable model for the above
scenario would be:
𝒕
𝑷 =𝒂 𝒃 ?
Recap of exponential modelling Show all
solutions
2 ①
200=𝑎 𝑏 ②
3 ②÷①
8=𝑏 ? ( 2 , 200 )
𝑘𝑥
𝑦 =𝑎 𝑏
𝑥
𝑦=𝐴𝑒
It’s custom to use a capital
when as the coefficient of an
Why might we want to exponential term with base .
write in the second form?
𝑦 (kg) When
In general, for
𝑦0 𝑘( 0 )
Initial mass exponential
models, is the 𝑦 0= 𝐴 𝑒
initial value of .
The time it takes for the
substance to decay to When
1 half of its mass is known
𝑦 as its half-life, written as 1 𝑘𝑡
2 0 𝑦 = 𝑦0 𝑒 0.5
2 0
1 𝑘𝑡
=𝑒 0.5
half-life
𝑥
(years)
ln
1
2 ( )
=𝑘 𝑡 0.5
− ln ( 2 )=𝑘 𝑡 0.5
In general,
by laws of logs. ln ( 2 )
𝑡 0.5=−
𝑘
More general exponential models
The background radiation in Chernobyl is mSv per year.
A radioactive substance is introduced to a lab, raising the radiation level to mSv per year.
The half-life of the substance is minutes.
Estimate the radiation level in the room after minutes.
We may additionally allow horizontal translation Note that the level of radiation will
of the exponential curve, to allow for a non-zero decay in the same way as mass.
‘long-term’ value (when exponential decay).
𝑘𝑑 𝐴=150 − 100
𝑦 (kg) 𝑦 = 𝑑+ 𝐴 𝑒 represents the ln 2
radioactivity of the 𝑡 0.5=−
𝑘
𝐴 substance, with either
ln 2
its initial mass or initial 30 =−
level of radiation. 𝑘
ln 2
𝑘=−
ln 2 30
𝑡 0.5=−
𝑘 ¿ − 0.0231
− 0.0231𝑡
𝑅=100+50 𝑒
𝑦 =𝑑 When minutes:
𝑥
(years)
Test Your Understanding
6 A radioactive burger weighing g is placed in a non-radioactive
burger bun weighing g.
If the half-life of the burger is days, what is the total mass of the
‘food’ after days?
? Model
When days:
? Mass
Logarithmic models
Logarithmic models are suitable when
a scale factor increase in the input
(e.g. ) only leads to a constant
increase in the output (e.g. ).
𝑦 =𝑎 +𝑏 ln 𝑥 Amplitude
Richter scale
To do directly on an fx-
Pedantry corner: the examples presented for
CG50 calculator, press logarithmic models (e.g. pH/Richter) are not
Statistics, enter your really ‘models’, more just ‘conversion functions’
for a single underlying measure.
values (pressing EXE after Formulas for models typically try to represent a
each one), click CALC, relationship between different physical
then REG, then LOG. quantities, and converting between different
scales is not doing that.
Sinusoidal models
We can use sinusoidal models for quantities which oscillate in waves.
Daily hours
of sunlight
𝒂= 𝟒?
Vertical transformations
Knowledge of graph transformations can help us to find the values of and in
the sinusoidal model by comparing to the graph of
𝒅=𝟏𝟐
?
Horizontal transformations
Knowledge of graph transformations can help us to find the values of and in
the sinusoidal model by comparing to the graph of
365
?
Recall that
The period of a sine wave is the results in a
width of one full oscillation. stretch parallel to
the -axis by scale
factor
𝟐𝝅
𝒃= ?
𝟑𝟔𝟓
Horizontal transformations
Knowledge of graph transformations can help us to find the values of and in
the sinusoidal model by comparing to the graph of
𝒄 =𝟗𝟏
?
Final equation:
?
Summary of sinusoidal models
÷𝑏 +𝑐
e.g. to the values, i.e.
𝑥 −𝑐 𝑏𝑥 translation by
+𝑐 ÷𝑏
𝑥 𝑥 As this does the translation first, and the
values are subsequently divided by , this
translation effectively becomes , meaning
This does the scaling first, which means the phase shift will be not .
the subsequent horizontal translation (and
thus phase shift) actually will be by .
Example Test Your Understanding
A Ferris wheel has a period of minutes. 8 As a diver jumps into the water, the
A seat starts m of the ground and the top of depth of the water can initially be
the wheel is m of the ground. modelled as a sinusoidal function.
The Ferris wheel is rotating and a seat is The depth varies from m to m and takes
level with the centre of the wheel after seconds to go from minimum to
minutes. maximum depth.
Assuming the height of the seat can be The water starts from rest but displaces
modelled with sinusoidal motion, determine upwards second after the diver hits the
a model for the height (in metres) in terms water.
of the time a Determine a model for the depth of the
(in minutes) after moving. water in terms of the time after the
diver hits the water.
b Identify a weakness in this model.
?
( )
0 amplitude is the
𝝅
centre of the wheel. 𝒚 =𝟎 .𝟐𝟓 𝐬𝐢𝐧 ( 𝒙 − 𝟏 ) +𝟓 .𝟐𝟓
𝟑
For the first second the water will be at rest and so
will not follow the model.
A ‘piecewise’ model could handle this.
Logistic models
Consider bacteria growing in a petri dish.
What will happen:
(a) initially?
(b) after a longer period of time?
is known as the
carrying capacity
? Graph
Time ()
Deeper Understanding
We want the gradient to be small if either:
(a) the existing population is small or
(b) the remaining capacity is small.
𝒅𝑷
∝ 𝑷 (? 𝑳 − 𝑷 )
𝒅𝒕
Notice that will
be small if either
Population () is small or is close
to .
𝑃= 𝐿
Time ()
is small, so the gradient
will be small.
Solving the differential equation
𝑑𝑃
∝ 𝑃 ( 𝐿− 𝑃 )
𝑑𝑡
𝑑𝑃
= 𝑘𝑃 ( 𝐿 − 𝑃 )
𝑑𝑡
1 𝑑𝑃 Get everything related to left of
= 𝑘 equation, and anything related
𝑃 ( 𝐿 − 𝑃 ) 𝑑𝑡 (which there isn’t) to right.
1 𝑑𝑃
∫ 𝑃 ( 𝐿− 𝑃 ) 𝑑𝑡 𝑑𝑡 =∫ 𝑘 𝑑𝑡
Integrate both sides.
1
∫ 𝑃 ( 𝐿− 𝑃 ) 𝑑𝑃=∫ 𝑘 𝑑𝑡
(
∫ 1/𝑃𝐿 + 𝐿−1/ 𝐿
𝑃 )
𝑑𝑃=∫ 𝑘 𝑑𝑡 Split into partial fractions
to make integratable.
1
𝐿
1
( +
1
)
∫ 𝑃 𝐿− 𝑃 𝑑𝑃 =∫ 𝑘 𝑑𝑡 Tidy up.
1
¿ Do the integration.
𝐿
ln | 𝑃
𝐿− 𝑃 |
= 𝐿𝑘𝑡 +𝑐 ′ Remove the . Typically would be
written as , where is a positive
𝑃 𝐿𝑘𝑡 +𝑐
′
𝐿𝑘𝑡 𝑐
′
𝑘 𝑡
′
constant.
=𝑒 =𝑒 𝑒 = 𝐴𝑒
𝐿− 𝑃 is itself a generic constant so
replaced with .
Solving the differential equation
Continuing…
𝑃 𝑘 𝑡
′
=𝐴𝑒
𝐿− 𝑃 For convenience we’ve
𝑘𝑡 used to mean .
𝑃 = ( 𝐿 − 𝑃 ) 𝐴𝑒 Strategy now is to make
𝑘𝑡 𝑘𝑡 the subject.
𝑃= 𝐴𝐿𝑒 − 𝐴𝑃 𝑒
𝑃 + 𝐴𝑃 𝑒 𝑘𝑡 = 𝐴𝐿 𝑒 𝑘𝑡
isolated on one
side so it can be
factorised out.
𝑃 ( 1+ 𝐴 𝑒𝑘𝑡 )= 𝐴𝐿𝑒 𝑘𝑡
𝐴𝐿 𝑒 𝑘𝑡
𝑃= 𝑘𝑡
1+ 𝐴 𝑒
𝐿
𝑃= − 𝑘𝑡
1 + 𝐶𝑒 ÷ 𝐴𝑒 𝑘𝑡
Key Points
! The logistic model is
𝑦
𝑦 =𝐿
foxes ?
Example Test Your Understanding
There are initially foxes in an urban 9 The population of Galapagos tortoises
area. The area can’t support more than on the Galapagos islands is initially ,
foxes. After one year there are foxes. but is limited to . After years the
Use logistic regression to estimate the population of tortoises is .
number of foxes after years.
𝐿 a Use logistic regression to estimate the
𝑦= − 𝑘𝑥
number of tortoises after years.
1 +𝐶 𝑒 b After how many years will the
When , When population be ?
When
tortoises
b
After 3 years: ?
Solving: years.
To do the regression directly on a calculator, use a large value for for the limiting value (here 10000)
Further applications of logistic functions
Probability of
passing
1 Where the limiting value is ,
logistic functions are useful for
modelling the probability of
anything binary (two outcomes),
e.g. ‘passing an exam’ or ‘female
vs not female’.
Hours revised (
For example , taking an input of a photo, and outputting a desirable value such as:
• the probability the photo is of a giraffe (known as a ‘binary classifier’, i.e. giraffe or not)
• a numerical value corresponding to the identified animal (1 = giraffe, 2 = lion, …)
Input
Hidden
Output
p(giraffe)
Turn into a
= 0.87
numerical ‘feature
vector’
A (feed-forward) neutral
network consists of connected
‘neurons’, modelling how
We somehow turn the input into a list neurons work in the brain.
of numbers, representing features of
the input. This might be the intensity x1
of individual pixels in an image. f(a0 + a1x1 + a2x2 + a3x3)
x2
x3
Weight
𝑝 ( 𝑐𝑎𝑡 ) ≈ 0 Weight
( 1 , 3)
𝑥
10
{
2 If it’s a quadratic with turning
𝑥 2𝑥+4
?−Suggest 0 ≤ 𝑥< 3 point , the equation would be of
𝑓 (𝑥 )= the form
10 −𝑥
? Suggest 𝑥 ≥3
Using either or allows us to
determine that .
Example Test Your Understanding
Let 10 Let
b
Range is ?