EART 20170 Computing Data Analysis Communication skills Lecturer

  • Slides: 45
Download presentation
EART 20170 Computing, Data Analysis & Communication skills Lecturer: Dr Paul Connolly (F 18

EART 20170 Computing, Data Analysis & Communication skills Lecturer: Dr Paul Connolly (F 18 – Sackville Building) p. connolly@manchester. ac. uk 2. Computing (Excel statistics/modelling) 2 lectures assessed practical work Course notes etc: http: //cloudbase. phy. umist. ac. uk/people/connolly LAST LECTURE! Recommended reading: Cheeney. (1983) Statistical methods in Geology. George, Allen & Unwin

Plan n This lecture plus two more drop- in sessions in computer labs n

Plan n This lecture plus two more drop- in sessions in computer labs n Assessment handed out today and need to hand in by 16: 00, Tuesday December 12 th.

Lecture 5 n Monte Carlo method of error propagation. n Using `Goal seek’ to

Lecture 5 n Monte Carlo method of error propagation. n Using `Goal seek’ to root-find n Using `solver’ for optimisation n Basic macros. n Mega Tsunami

Statistical approach to error propagation n Computers enable the use of a very simple

Statistical approach to error propagation n Computers enable the use of a very simple statistical method to propagate errors. n Monte Carlo methods provides approximate solutions to a variety of mathematical problems by performing statistical sampling experiments. n The statistical approach is particularly useful for propagating errors in complex functions.

Monte Carlo methods n Monte Carlo simulations or methods are named after Monte Carlo,

Monte Carlo methods n Monte Carlo simulations or methods are named after Monte Carlo, Monaco, where the primary attractions are casinos containing games of chance exhibiting random behaviour. n The random behaviour in games of chance is similar to how Monte Carlo simulation selects variable values at random to simulate a model. n For each uncertain variable (one that has a range of possible values), you define the possible values with a probability distribution (e. g. the Excel function norminv(rand(), mean, stdev)).

Monte Carlo in Error Propagation n Let’s use a previous example of measuring bed

Monte Carlo in Error Propagation n Let’s use a previous example of measuring bed thickness. We have two “populations” of measurements: x = 12. 1 ± 0. 3 and y = 4. 2 ± 0. 2. n By repeatedly taking samples at random (e. g. by the `nested’ Excel function norminv(rand(), mean, stdev)) from x and y, and adding the values, we should obtain a third population with a mean of 16. 3 cm and a standard deviation approximately equal to that obtain from the analytical solution (± 0. 4 cm). n The statistical approach is particularly useful for propagating errors in complex functions

A more complicated formula: This is one used in geochronology (don’t worry about the

A more complicated formula: This is one used in geochronology (don’t worry about the details): The error propagation formula is given by: where T = 1/l

A more complicated formula: Using the following data: R = 49. 704 ± 0.

A more complicated formula: Using the following data: R = 49. 704 ± 0. 381 t = 1. 072 ± 0. 011 billion years l = 5. 543 10 -10 years-1 Then using the equations: J = 0. 016329 ± 0. 000255 OK so what about the Monte Carlo? With a table of R and t calculated from the norminv function (10000 values are typically used for good statistics) we calculate J and can therefore calculate the average and stdev.

Using `Goal seek’ to rootfind n What if I want to find the inverse

Using `Goal seek’ to rootfind n What if I want to find the inverse of a function? ? n Sometimes I can find the inverse analytically, e. g. n But not always (and if maths isn’t your forte).

Using `Goal seek’ to rootfind n What height of fall will result in a

Using `Goal seek’ to rootfind n What height of fall will result in a height of single tsunami 30 m? n This is sometimes difficult (or impossible!). n Instead use iteration => Goal seek.

Using `Goal seek’ to rootfind n Here are some arbitrary values n Go to

Using `Goal seek’ to rootfind n Here are some arbitrary values n Go to tools->goal seek

Using `Goal seek’ to rootfind n Enter the cell you want to change and

Using `Goal seek’ to rootfind n Enter the cell you want to change and the value (i. e. the actual energy) and the variable that will be changed – press OK n The cells change until the goal is found. Press OK at the next prompt Your value for HD is now displayed in the correct cell. And you didn’t have to do any maths!

Using `solver’ for optimisation n Goal seek only works for functions of one variable.

Using `solver’ for optimisation n Goal seek only works for functions of one variable. n Goal seek is good for route finding, but what if I want to find other properties such as minimum, maximum values? n E. g. Mining a gold seam. How can I break even? Whats the max profit I can make? Whats the min number of days I can mine before making a profit?

Using `solver’ for optimisation n Example: say that it costs £ 100 per day

Using `solver’ for optimisation n Example: say that it costs £ 100 per day to hire your basic digging equipment. n And you manage to extract 4 tonne per day of gold from rock. n But as the number of days increase it becomes more difficult to extract the gold from the shaft as extra equipment has to be rented – usually have some apriori knowledge (0. 2 xday^2). n The market value for gold is £ 321 for 31. 1 g.

Using `solver’ for optimisation n You wish to know: n How many days you

Using `solver’ for optimisation n You wish to know: n How many days you should work before breaking even? n What is the maximum net profit you can make n How long can you work before your net rate of pay drops below £ 40 per day

Using `solver’ for optimisation

Using `solver’ for optimisation

First: How many days to break even? n Go to Tools->solver n On the

First: How many days to break even? n Go to Tools->solver n On the pop-up menu, set the target cell to the `Net’ cell reference and the changing cell to the `Days’ cell reference. Also check the `Value of’ tab and set this value to 0 (i. e. break even)

First: How many days to break even? n You should also set the constraint

First: How many days to break even? n You should also set the constraint that the number of Days is greater than or equal to zero! – Click on `add’ and in the next box put in that `Days’ should be greater than 0 – OK. n On the first popup window press `solve’ n The cell values change and another popup asks if you want to keep the solution – OK.

First: How many days to break even? n You see that it after 243

First: How many days to break even? n You see that it after 243 days the venture will start to become non profitable. Your total costs were £ 36139 all of which you got back from the gold seam.

Second: What is the max net profit? n Go to Tools->solver n On the

Second: What is the max net profit? n Go to Tools->solver n On the pop-up menu, set the target cell to the `Net’ cell reference and the changing cell to the `Days’ cell reference. Also check the `max’ tab.

Second: What is the max net profit? n You should also set the constraint

Second: What is the max net profit? n You should also set the constraint that the number of Days is greater than or equal to zero! – Click on `add’ and in the next box put in that `Days’ should be greater than 0 – OK. n On the first popup window press `solve’ n The cell values change and another popup asks if you want to keep the solution – OK.

Second: What is the max net profit? n You see that it takes 121.

Second: What is the max net profit? n You see that it takes 121. 6 days to get the maximum net profit of £ 2960. Your total costs were £ 15113 and your average rate of pay was £ 24 per day.

Third: At least £ 40 per day? n Go to Tools->solver n On the

Third: At least £ 40 per day? n Go to Tools->solver n On the pop-up menu, set the target cell to the `Rate’ cell reference and the changing cell to the `Days’ cell reference. Also check the `Value of’ tab and set this value to 40 (i. e. £ 40/day)

Third: At least £ 40 per day? n You should also set the constraint

Third: At least £ 40 per day? n You should also set the constraint that the number of Days is greater than or equal to zero! – Click on `add’ and in the next box put in that `Days’ should be greater than 0 – OK. n On the first popup window press `solve’ n The cell values change and another popup asks if you want to keep the solution – OK.

Third: At least £ 40 per day? n You see that after 43 days

Third: At least £ 40 per day? n You see that after 43 days your average net rate of pay will drop below £ 40. Your total costs were £ 4687 and your net pay was £ 1730.

Basic macros n The goal seek and solver tools are very powerful, but they

Basic macros n The goal seek and solver tools are very powerful, but they can be time consuming if you want to work on vast data sets. n You can save a macro to a worksheet and use it again and again without having to always remember the exact sequence. n We will look at recording and using a macro for using the goal seek tool.

Basic macros n Go to tools->Macro->record new macro n You can name the macro

Basic macros n Go to tools->Macro->record new macro n You can name the macro and give it a shortcut key

Basic macros n The macro recorder is now visible with a `stop’ symbol. All

Basic macros n The macro recorder is now visible with a `stop’ symbol. All your actions will now be recorded. n Again use goal seek in the same way as before

Basic macros n Enter your values as before. n The solution is found n

Basic macros n Enter your values as before. n The solution is found n Now press the `stop’ button to cease recording

Basic macros n You can now run your macro by going to tools->macros n

Basic macros n You can now run your macro by going to tools->macros n Selecting the macro you recorded and pressing run. You could have also used a shortcut

A subtlety n When using goal seek it is nearly always more convenient to

A subtlety n When using goal seek it is nearly always more convenient to solve for a zero. n This is because `goal seek’ doesn’t allow the value to be input by a cell reference.

A subtlety n In this case you put zero in the `To value’ box

A subtlety n In this case you put zero in the `To value’ box in goal seek Put zero here

Mega tsunami

Mega tsunami

Volcano collapse n All volcanoes are inherently unstable and edifice growth will ultimately lead

Volcano collapse n All volcanoes are inherently unstable and edifice growth will ultimately lead to some degree of collapse. n Major collapse of the old volcanic edifice, Soufriere Hills volcano early on 26 December 1977

Caldera collapse n The movement associated with collapse can be either vertical (caldera) or

Caldera collapse n The movement associated with collapse can be either vertical (caldera) or horizontal (lateral collapse).

Mount St Helens 1980 The landslide moved northward at speeds of 110 to 155

Mount St Helens 1980 The landslide moved northward at speeds of 110 to 155 mph and advanced. Part of the avalanche surged into and across Spirit Lake, but most of it flowed westward along the North Fork of the Toutle River for 13 miles filling the valley to an average depth of 150 ft. http: //pubs. usgs. gov/publications/msh/debris. html

Hazard Potential n Lateral collapse of oceanic island volcanoes are amongst the most spectacular

Hazard Potential n Lateral collapse of oceanic island volcanoes are amongst the most spectacular natural events on Earth. n There is a potential for submarine landslides to generate tsunami and mega-tsunami. n Mega-tsunami have never been witnessed historically and geological evidence for their existence is controversial. n With ~1% of the world’s population (~60, 000 people) living in regions susceptible to giant waves around the coastlines of the world’s oceans, they pose a very serious threat.

Mega-tsunami n Mega-tsunami are long wavelength (typically 300 -400 km) wave trains that travel

Mega-tsunami n Mega-tsunami are long wavelength (typically 300 -400 km) wave trains that travel thousands of kilometres, across ocean basins at velocities in excess of 500 km hr-1. n As they pass into shallower water towards land their wavelength is compressed and height amplifies, typically 10 - to 20 -fold, generating waves up to hundreds of metres high that may incur many kilometres inland.

USGS http: //vulcan. wr. usgs. gov/Volcanoes/Hawaii/Maps/map_location_hawaii. html Hawaiian lateral collapses n The Hawaiian islands

USGS http: //vulcan. wr. usgs. gov/Volcanoes/Hawaii/Maps/map_location_hawaii. html Hawaiian lateral collapses n The Hawaiian islands are surrounded by more than 68 slumps and avalanches >20 km long. n There are >20 giant collapses of up 5000 km 3 (approx. 2000 times larger than Mt St Helens) From: http: /www. mala. bc. ca/~earles/kilauea-feb 02. htm

From: Ward, 2002

From: Ward, 2002

Prehistoric Hawaiian Collapse Lateral collapse Molokai N Lanai 10 km USGS http: //vulcan. wr.

Prehistoric Hawaiian Collapse Lateral collapse Molokai N Lanai 10 km USGS http: //vulcan. wr. usgs. gov/Volcanoes/Hawaii/Maps/map_location_hawaii. html

Lanai tsunami impact PACIFIC OCEAN Source of tsunami NEW GUINEA Wave impact FIJI AUSTRALIA

Lanai tsunami impact PACIFIC OCEAN Source of tsunami NEW GUINEA Wave impact FIJI AUSTRALIA Sydney Wave impact TASMANIA From Davidson, 1992 Wave impact NEW ZEALAND HAWAII

New South Wales Tsunami Deposits The tsunami carved these scour pools within a few

New South Wales Tsunami Deposits The tsunami carved these scour pools within a few minutes as it overtopped a 20 -25 m high headland Blocks stacked against 30 m high cliffs. Note the person circled for scale. Some of the blocks are as large as rooms in a house. Source: E. A. Bryant http: //www. uow. edu. au/science/geosciences/research/tsun. htm

Tsunami wave model Potential energy released by the collapse: Archimedes force D 0 Ds

Tsunami wave model Potential energy released by the collapse: Archimedes force D 0 Ds V = volume of collapse block (m 3) pw = density of seawater (1030 kg m 3) pr = density of rock (2800 kg m 3) g = acceleration due to gravity (9. 8 m/s/s) D 0 = initial depth of sliding block (m) Ds = final depth of sliding block (m)

The wave energy, Et HD ~ H, the wave height near shore (Depth ~

The wave energy, Et HD ~ H, the wave height near shore (Depth ~ 0) L = length of wave perpendicular to the propagation direction wave L = 2 pr r