You are currently browsing the tag archive for the ‘modelling’ tag.

Screen Shot 2018-05-16 at 10.36.10 AM

Modelling more Chaos

This post was inspired by Rachel Thomas’ Nrich article on the same topic.  I’ll carry on the investigation suggested in the article.  We’re going to explore chaotic behavior – where small changes to initial conditions lead to widely different outcomes.  Chaotic behavior is what makes modelling (say) weather patterns so complex.

f(x) = sin(x)

This time let’s do the same with f(x) = sin(x).

Screen Shot 2018-05-16 at 10.12.48 AM

Starting value of x = 0.2

 

Screen Shot 2018-05-16 at 10.10.41 AM

 

Starting value of x = 0.2001

 

Screen Shot 2018-05-16 at 10.10.48 AM

 

Both graphs superimposed 

 

Screen Shot 2018-05-16 at 10.10.48 AM

This time the graphs do not show any chaotic behavior over the first 40 iterations – a small difference in initial condition has made a negligible difference to the output.  Even after 200 iterations we get the 2 values x = 0.104488151 and x = 0.104502319.

f(x) = tan(x)

Now this time with f(x) = tan(x).

Screen Shot 2018-05-16 at 10.21.55 AM

Starting value of x = 0.2

 

Screen Shot 2018-05-16 at 10.25.52 AM

 

Starting value of x = 0.2001

 

Screen Shot 2018-05-16 at 10.23.03 AM

 

Both graphs superimposed 

 

Screen Shot 2018-05-16 at 10.23.14 AM

This time both graphs remained largely the same up until around the 38th data point – with large divergence after that.  Let’s see what would happen over the next 50 iterations:

 

Screen Shot 2018-05-16 at 10.29.49 AM

Therefore we can see that tan(x) is much more susceptible to small initial state changes than sin(x).  This makes sense by considering the graphs of tan(x) and sin(x).  Sin(x) remains bounded between -1 and 1, whereas tan(x) is unbounded with asymptotic behaviour as we approach pi/2.

Screen Shot 2018-05-16 at 10.36.10 AM

Modelling Chaos

This post was inspired by Rachel Thomas’ Nrich article on the same topic.  I’ll carry on the investigation suggested in the article.  We’re going to explore chaotic behavior – where small changes to initial conditions lead to widely different outcomes.  Chaotic behavior is what makes modelling (say) weather patterns so complex.

Let’s start as in the article with the function:

f(x) = 4x(1-x)

We can then start an iterative process where we choose an initial value, calculate f(x) and then use this answer to calculate a new f(x) etc. For example when I choose x = 0.2, f(0.2) = 0.64. I then use this value to find a new value f(0.64) = 0.9216. I used a spreadsheet to plot 40 iterations for the starting values of x = 0.2 and x = 0.2001. This generated the following spreadsheet (cut to show the first 10 terms):

Screen Shot 2018-05-16 at 7.44.29 AM

I then imported this table into Desmos to map how the change in the starting value from 0.2 to 0.2001 affected the resultant graph.

Starting value of x = 0.2

Screen Shot 2018-05-16 at 7.45.17 AM

Starting value of x = 0.2001

Screen Shot 2018-05-16 at 7.45.04 AM

Both graphs superimposed 

Screen Shot 2018-05-16 at 7.45.31 AM

We can see that for the first 10 terms the graphs are virtually the same – but then we get a wild divergence, before the graphs seem to synchronize more closely again.  One thing we notice is that the data is bounded between 0 and 1.  Can we prove why this is?

If we start with a value of x such that:

0<x<1.

then when we plot f(x) = 4x – 4x2 we can see that the graph has a maximum at x = 1/2:
Screen Shot 2018-05-16 at 9.34.26 AM.

Therefore any starting value of x between 0 and 1 will also return a new value bounded between 0 and 1.  Starting values of x > 1 and x < -1 will tend to negative infinity because x2 grows much more rapidly than x.

f(x) = ax(1-x)

Let’s now explore what happens as we change the value of a whilst keeping our initial starting values of x = 0.2 and x = 0.2001

a = 0.8

Screen Shot 2018-05-16 at 10.51.49 AM

both graphs are superimposed but are identical at the scale we are using.  We can see that both values are attracted to 0 (we can say that 0 is an attractor for our system).

a = 1.2

Screen Shot 2018-05-16 at 10.57.01 AM

Again both graphs are superimposed but are identical at the scale we are using.  We can see that both values are attracted to 1/6 (we can say that 1/6 is an attractor for our system).

In general, for f(x) = ax(1-x) with -1≤x≤1, the attractors are given by x = 0 and x = 1 – 1/a, but it depends on the starting conditions as to whether we will end up being attracted to this point.

f(x) = 0.8x(1-x)

So, let’s look at f(x) = 0.8x(1-x) for different starting values 1≤x≤1.  Our attractors are given by x = 0 and x = 1 – 1/0.8 = -0.25.

When our initial value is x = 0 we remain at the point x = 0.

When our initial value is x = -0.25 we remain at the point x = -0.25.

When our initial value is x < -0.25 we tend to negative infinity.

When our initial value is  -0.25 < x ≤ 1 we tend towards x = 0.

Starting value of x = -0.249999:

Screen Shot 2018-05-16 at 12.02.53 PM

Therefore we can say that x = 0 is a stable attractor, initial values close to x = 0 will still tend to 0.

However x = -0.25 is a fixed point rather than a stable attractoras

x = -0.250001 will tend to infinity very rapidly,

x = -0.25 stays at x = -0.25.

x = -0.249999 will tend towards 0.

Therefore there is a stable equilibria at x = 0 and an unstable equilibria at x = -0.25.

 

Screen Shot 2014-12-11 at 2.51.32 PM

Making Music With Sine Waves

Sine and cosine waves are incredibly important for understanding all sorts of waves in physics.  Musical notes can be thought of in terms of sine curves where we have the basic formula:

y = sin(bt)

where t is measured in seconds.  b is then connected to the period of the function by the formula period = 2π/b.

When modeling sound waves we normally work in Hertz – where Hertz just means full cycles (periods) per second.  This is also called the frequency.  Sine waves with different Hertz values will each have a distinct sound – so we can cycle through scales in music through sine waves of different periods.

For example the sine wave for 20Hz is:

Screen Shot 2014-12-11 at 3.05.05 PM

20Hz means 20 periods per second (i.e 1 period per 1/20 second) so we can find the equivalent sine wave by using

period = 2π/b.

1/20 = 2π/b.

b = 40π

So, 20Hz is modeled by y = sin(40πt)

You can plot this graph using Wolfram Alpha, and then play the sound file to hear what 20Hz sounds like.  20Hz is regarded as the lower range of hearing spectrum for adults – and is a very low bass sound.

The middle C on a piano is modeled with a wave of 261.626Hz.  This gives the wave

Screen Shot 2014-12-11 at 3.15.05 PM

which has the equation, y = sin(1643.84πt).  Again you can listen to this sound file on Wolfram Alpha.

At the top end of the sound spectrum for adults is around 16,000 – 20,000Hz.  Babies have a ability to hear higher pitched sounds, and we gradually lose this higher range with age.  This is the   sine wave for 20,000Hz:

Screen Shot 2014-12-11 at 3.19.39 PM

which has the equation, y = sin(40,000πt). See if you can hear this file – warning it’s a bit painful!

electro2

As well as sound waves, the whole of the electromagnetic spectrum (radio waves, microwaves, infrared, visible light, ultraviolet, x rays and gamma rays) can also be thought of in terms of waves of different frequencies.  So, modelling waves using trig graphs is an essential part of understanding the physical world.

If you enjoyed this post you might also like:
Fourier Transforms – the most important tool in mathematics? – how we can use advanced mathematics to understand waves – with applications for everything from WIFI, JPEG compression, DNA analysis and MRI scans.

zombieModelling for Zombies

Some mathematicians at the University of Ottawa have just released a paper looking at the mathematics behind a zombie apocalypse.  What are the best strategies for avoiding being eaten?  How quickly would zombies spread through the population?  This may seem a little silly as zombies aren’t real – but actually the mathematics behind how diseases spread through a population is very useful – and, well, zombies are as good a way as any to introduce this.

zombie2

The graphic above from the paper shows how zombie movement can be modelled.  Given that zombies randomly move around, and any bumping would lead to a tendency towards finding space, they are modelled in the same way that we model the diffusion of gas.  If you start with a small concentrated number of particles they will spread out to fill the given space like shown above.

zombies3

Diffusion can be modelled by the diffusion equation above.  We have:

t: time (in specified units)

x: position of the x axis.

w: the density of zombies at time t and point x.  We could also write w(t,x) in function notation.

a: a is a constant.

The “curly d” in the equation means the partial differential.  This works the same as normal differentiation but when we differentiate we are only interested in differentiating the denominator letter – and act as though all other letters are constants.  This is easier to show with an example.

z = 3xy2

The partial differential of z with respect to x is 3y2
The partial differential of z with respect to y is 6xy

So, going back to our diffusion equation, we need to find a function w(x,t) which satisfies this equation – and then we can use this function to model the spread of zombies through an area.  There are lots of different solutions to this equation (see a list here).  One of the easiest is:

w(x,t) = A(x2 + 2at) + B

where we have introduced 2 new constants, A and B.

We can check that this works by finding the left handside and right handside of the diffusion equation:

zombies4

Therefore as the LHS and RHS are equal, the diffusion equation is satisfied. Therefore we have the following zombie density model:

w(x,t) = A(x2 + 2at) + B

this will tell us at point x and time t what the zombie density is.  We would need particular values to then find A, B and a.  For example, we can restrict x between 0 and 1 and t between 1 and 5, then set A = -1, B = 21, a = 2 to give:

w(x,t) = (-x2 + -4t) + 21

This begins to fit the behavior we want – at any fixed point x the density will decrease with time, and as we move further away from the initial point (x = 0) we have lower density.  This is only very rough however.

zombie6

A more complicated solution to the diffusion equation is given above.  In this equation Z(x,t) stands for the density of zombies at point x and time t. Z0 stands for the initial zombie density – where all zombies are starting at the same point (x between 0 and 1). L stands for the edge of the domain.  This is a 1 dimensional model – where zombies only travel in a straight line.  For modelling purposes, this would be  somewhat equivalent to being trapped in a 50 metre by 1 metre square fenced area – with (0,0) as the bottom left corner of the fence. L would be 50 in this case, and all zombies would initially be in the 1 metre square which went through the origin.

Luckily as t gets large this equation can be approximated by:zombie8Which means that after a long length of time our 50 metre square fenced area will have an equal density of zombies throughout. If we started with 100 zombies in our initial 1 metre square area (say emerging from a tomb), then with Z0 = 100 and with L = 50 we would have an average density of 100/2 = 2 zombies per metre squared.  In other words zombies would be evenly spaced out across all available space.

So, what advice can you take from this when faced with a zombie apocalypse? Well if zombies move according to diffusion principles then initially you have a good advantage to outrun them – after-all they will be moving randomly and you will be running linearly as far away as possible. That will give you some time to prepare your defences for when the zombies finally reach you. As long as you get far enough away, when they do reach your corner their density will be low and therefore much easier to fight.

Good luck!

If you liked this post you might also like:

Surviving the Zombie Apocalypse – more zombie maths.  How long before the zombies arrive?

How contagious is Ebola? – using differential equations to model infections.

traffic simulation

Simulations -Traffic Jams and Asteroid Impacts

This is a really good online Java app which has been designed by a German mathematician to study the mathematics behind traffic flow.  Why do traffic jams form?  How does the speed limit or traffic lights or the number of lorries on the road affect road conditions?   You can run a number of different simulations – looking at ring road traffic, lane closures and how robust the system is by applying an unexpected perturbation (like an erratic driver).

There is a lot of scope for investigation – with some prompts on the site.  For example, just looking at one variable – the speed limit – what happens in the lane closure model?  Interestingly, with a homogenous speed of 80 km/h there is no traffic congestion – but if the speed is increased to 140km/h then large congestion builds up quickly as cars are unable to change lanes.   This is why reduced speed limits  are applied on motorways during lane closures.

Another investigation is looking at how the style of driving affects the models.  You can change the politeness of the drivers – do they change lanes recklessly?  How many perturbations (erratic incidents) do you need to add to the simulation to cause a traffic jam?

This is a really good example of mathematics used in a real life context – and also provides some good opportunities for a computer based investigation looking at the altering one parameter at a time to note the consequences.

asteriod

Another good simulation is on the Impact: Earth page.  This allows you to investigate the consequences of various asteroid impacts on Earth – choosing from different parameters such as diameter, velocity, density and angle of impact.  It then shows a detailed breakdown of thee consequences – such as crater size and energy released.   You can also model some famous impacts from history and see their effects.   Lots of scope for mathematical modelling – and also for links with physics.  Also possible discussion re the logarithmic Richter scale – why is this useful?

Student Handout

Asteroid Impact – Why is this important?
Comets and asteroids impact with Earth all the time – but most are so small that we don’t even notice. On a cosmic scale however, the Earth has seen some massive impacts – which were they to happen again today could wipe out civilisation as we know it.

The website Impact Earth allows us to model what would happen if a comet or asteroid hit us again. Jay Melosh professor of Physics and Earth Science says that we can expect “fairly large” impact events about every century. The last major one was in Tunguska Siberia in 1908 – which flattened an estimated 80 million trees over an area of 2000 square km. The force unleashed has been compared to around 1000 Hiroshima nuclear bombs. Luckily this impact was in one of the remotest places on Earth – had the impact been near a large city the effects could be catastrophic.

Jay says that, ”The biggest threat in our near future is the asteroid Apophis, which has a small chance of striking the Earth in 2036. It is about one-third of a mile in diameter.”

Task 1: Watch the above video on a large asteroid impact – make some notes.

Task 2:Research about Apophis – including the dimensions and likely speed of the asteroid and probability of collision. Use this data to enter into the Impact Earth simulation and predict the damage that this asteroid could do.

Task 3: Investigate the Tunguska Event. When did it happen? What was its diameter? Likely speed? Use the data to model this collision on the Impact Earth Simulation. Additional: What are the possible theories about Tunguska? Was it a comet? Asteroid? Death Ray?

Task 4: Conduct your own investigation on the Impact Earth Website into what factors affect the size of craters left by impacts. To do this you need to change one variable and keep all the the other variables constant.  The most interesting one to explore is the angle of impact.  Keep everything else the same and see what happens to the crater size as the angle changes from 10 degrees to 90 degrees.  What angle would you expect to cause the most damage?  Were you correct?  Plot the results as a graph.

If you enjoyed this post you might also like:

Champagne Supernovas and the Birth of the Universe – some amazing photos from space.

Fractals, Mandelbrot and the Koch Snowflake – using maths to model infinite patterns.

Screen Shot 2018-03-19 at 5.29.06 PM

IB Maths Revision

I’d strongly recommend starting your revision of topics from Y12 – certainly if you want to target a top grade in Y13.  My favourite revision site is Revision Village – which has a huge amount of great resources – questions graded by level, full video solutions, practice tests, and even exam predictions.  Standard Level students and Higher Level students have their own revision areas.  Have a look!

Website Stats

  • 5,192,431 views

Recent Posts

Follow IB Maths Resources from British International School Phuket on WordPress.com