What are Dip and Dip direction
The
first concept to understand is the dip of a
joint. We shall initially consider a single
planar joint within the rock such as a shear
or fault. To define the direction of the joint
in three dimensional space we typically use
two values. By doing this we can use the
conventional 360 degrees that is commonly used
to define angles and directions. The two
angles typically used are called Dip and Dip
Direction.
To consider Dip and Dip Direction we need to consider a line on the plane of the joint. Imagine a grid of lines on this plane, with one set of lines running across the plane at the same height, effectively forming contours not rising or falling across the plane. The second set of lines on this grid will run perpendicular to the contours. This second set of lines would be the steepest line that could be formed on the plane. This line is the key line from which we measure Dip and Dip Direction.
The Dip Direction can be determined by viewing the plane and the line we have drawn on plan. The orientation of the line can be specified using the 360 degrees of a compass bearing. At this point it is worth noting that this value is not absolute, but that the baseline needs to be specified. Normally the baseline orientation is North but this could be true north, grid north or magnetic north.
Having specified the direction of the line, we need to specify how steep the line is. We do this using the Dip of the joint. To obtain the dip we have to cut the plane of the joint along the Dip Direction of the joint. Having cut the joint plane the Dip of the joint can be measured by measuring the angle from the horizontal of the plan of the joint. This means that a steeper dip gives a steeper joint up to a maximum of 90 degrees. Typically dip is only measured as a positive angle between 0 and 90 degrees.
Dip
and Dip Direction are the typical values that
are quoted to give the joint orientation.
There are however a few other dimensions that
are used to specify the orientation of
features. Strike is a value used instead of
Dip Direction. The Strike is a line at 90
degrees to the Dip Direction. Referring back
to our original diagram the Strike follows the
contour lines running parallel to the slope.
Strike and Dip Direction are therefore
interrelated. It is important to note that
Strike may not be defined using the
conventional 360 degree compass, but may be
defined as being an angle East or West of
North such as N72E, 72 degrees East of North.
Strike can be represented on a plan by a long
line following the direction of the strike and
a short bar at 90 degrees showing the
direction of the dip.
Another method of defining Dip and Dip Direction is Trend and Plunge. Trend and plunge tend to be used with linear features such as tunnels, shafts or roads. Trend tends to follow the centreline of these features such as the axis of a tunnel and is defined in the same way as Dip Direction. The plunge is then defined in the same way as the dip so the steeper the plunge the steeper the slope of the tunnel.
It is important to understand Dip and Dip Direction when designing rock structures. When using these measurements of the orientation of joints you must clarify how it has been defined by the geologist to ensure that you are applying the measurements in the same manner as they have been defined.
Monte Carlo analysis in Excel
Because I don't use it much specialist tools such as @risk are not really an option for me. The basic version of Excel is however more than capable of performing Monte-Carlo analysis with relative simplicity.
The first stage is to build your model with the usual input and output parameters using the same format as you would normally do. Once the is done create a new worksheet for the input parameters that you want to use in he Monte-Carlo analysis. To generate the random numbers to put into the Monte-Carlo analysis you will need to use a Rand() function for each input parameter you want to consider. You can then use Excel's built in distribution functions to generate your output value or you can create your own - I will consider some of the different distribution functions in later posts.
If you have done this correctly, every time you amend your spreadsheet now the values should change on this worksheet. Now link the input values on your model worksheet to the values on the inputs worksheet. The entire model should now change each time values are adjusted on the spreadsheet. At this point it is worth taking time to check how your model is performing. Just pressing the delete key on an empty cell should run one Monte-Carlo step. It is worth doing this a few times because Monte-Carlo analyses often test the limit of a spreadsheet with combinations of very high and very low values.
It is possible to manually run a Monte-Carlo analysis manually with the spreadsheet in this form. The power of this solution is however when it is automated, and to do that we can make use of a Macro.
First create a new worksheet to hold the outputs from the model. Now create a new Macro. The typical code that should be used for the Macro is something like:
Sub MonteCarlo()
With Application
.Calculation = xlManual
End With
For Counter = 1 To 500
Sheets("Model").Select
Calculate
Output1 = Range("L3").Value
Output2 = Range("H17").Value
Set curCell = Worksheets("Results").Cells(Counter, 2)
curCell.Value = Counter
Set curCell = Worksheets("Results").Cells(Counter, 3)
curCell.Value = Output1
Set curCell = Worksheets("Results").Cells(Counter, 4)
curCell.Value = Output2
Next Counter
With Application
.Calculation = xlAutomatic
End With
End Sub
This Macro runs the Monte-Carlo analysis 500 times. The results from the analysis are taken from cells L3 and H17 from the worksheet Model. They are then put into columns 3 and 4 of the worksheet Results.
Post processing of the output data should be done in a separate workbook. If this is not done then re-running the Monte-Carlo analysis will take much longer as the post processing will be done for each step of the Monte-Carlo analysis.
OmniOutliner as a calculation sheet
Typically if calculations are prepared on a computer, they are normally prepared in Excel or Word. I find neither of these options ideal. With Word files I simply have to spend too much time formatting and adjusting the layout of the document so that it works. Excel might initially seem to be ideal for preparing calculations, the problem is it takes so much effort to work with excel that it takes a lot of concentration away from the production of calculations. The format of the calculations is also very difficult to work with being so reliant on brackets.
My solution has been to use Omnioutliner Pro. Like all applications from the Omni Group, this is an application whose power is hidden beneath a deceptively simple to use exterior. For those who haven't used it, Omnioutliner is an outlining application, working much like word in outline view. It does however have a few neat tricks such as the addition of columns, formatting that can vary depending on the column or the outline level and the ability to quickly and easily move items entries or groups of entries around.
It also has another bonus feature - Linkback. For those who have never used it it can be a real bonus working with documents that are likely to change, something which calculations seem to do more often than would be ideal. As an example, you can create a diagram in Omnigraffle, paste it into Omnioutliner and then when you next double click the diagram in Omnioutliner it opens again in Omnigraffle ready to be ammended. The neat trick is that you don't even have to save a copy of the original Omnigraffle file, the file is stored with the Omnioutliner file. This works with a wide variety of applications, and not just applications from the Omnigroup, as long as the applications support Linkback.
Download it here.
Shear banding in geomechanics
In order to consider the formation of shear bands within numerical models, we will consider a simple model of a shear box test on a Mohr-Coulomb material.
When the two sides of the box slide apart, the shearing occurs across a very thin band as the soil grains slide across each other. In this case the shear band that is formed is very thin. We can simulate the shear box test relatively simply in most general numerical analysis packages, such as FLAC. In order to do this we need to discretise the problem, i.e. divide the problem into small elements. Typically there is a preference for a coarse discretisation as it gives the most efficient and simplest models.
In this model the shear box has been divided into a 4 x 4 grid giving 16 elements/zones. The base of the box has been fixed with roller boundary conditions on the three sides, as has the top of the box. A constant force is applied to the side of the box to model the shear force applied during the test.
We need to consider how this model will behave when the force applied to cause the shearing starts. The top section of the shear box has started to elastically deform under the shearing force.
The block of soil in the top section of the ground will behave roughly as a cantilever beam giving a linear variation in the stress shear stress through the model. Based on this stress distribution, we can obtain a basic stress distribution for elements within the model. This stress profile assumes that the elements behave as constant stress elements, a common assumption among general numerical analysis programs.
The stresses in elements 1 and 2 is therefore roughly an average of the theoretical stress and can only be correct at a few locations. The stress profile calculated by the model is therefore only an approximation of the actual theoretical stress profile. In order to consider the implications of this averaging we can increase the shearing in the theoretical model further.
The load, and hence the stress, in the section has been increased to the point where theoretical plastic shear failure will occur as indicated by the blue line. It can also be seen that the average stress in element 2 is not high enough to cause plastic failure, therefore the model will not exhibit plasticity at this load. Assuming a linear stress profile and the stress in the elements is the average theoretical stress across the element, the stress in element 2 will only be 75% of the limiting shear stress. In order to cause shear failure in element 2 to occur, the load on the model needs to be further increased.
In this case the theoretical stress has been increased to 33% above the shear stress limit so that the stress in element 2 will achieve the shear stress limit. We can now plot the distorted form of the model under additional load with the elements undergoing plastic deformation highlighted in blue.
In this case the numerical model is overestimating the strength of the ground by 33%. This is obviously not a conservative solution and indicates the problems that shear bands and other similar plasticity based problems can cause when carrying out numerical analyses.
A possible solution to this problem is to re-mesh the problem.
Now consider the case where the grid density has been increased by a factor of 2 in each direction. This results in a revised stress profile.
In this case the overstress required to cause plasticity is reduced to 14% and so the revised grid has significantly improved the performance of the model. We can plot how the accuracy of a model varies with increasing mesh density.Based on the mesh regenerating approach used above a density of 11 in each direction zones is required to get results with less than 5% overstress. Increasing the density of the zones does however reduce the speed of the solution of a typical model by an amount between the increase in density of the zones, or the square of the increase in the density of the zones. In this case then the models solution speed would decrease by between 7 times and 57 times. These could be large reductions in solution speeds for large models.
This is a very simplified way of looking at shear banding but the principals and logic will help understand some of the more complex problems. Lack of shear banding within certain types of geomechanical models is a critical reason why many models fail to produce credible results. Critically models without the ability to model shear banding will often overestimate soil strength. A modeller therefore needs to understand how shear banding forms and how to model it to create an effective and credible model.
Omnigraffle template for lattice girders
Download it here.
Version 5 of Sketchup for a Mac
One problem for Mac users is that version 6 only works with versions of OSX after 10.4.1. Unfortunately Google have not posted Sketchup version 5 for download. If you are using Mac OS 10.3.9 or earlier here is a version of Sketchup 5 that you can download.
Download it here
Hidden engineering gems
The clips below are taken from a book published in 1844 about the construction of two railway tunnels south of London, England. The entire book is available to browse online and I can heartily recommend doing so. It is a true treasure trove of our engineering heritage and it is amazing how much has and has not changed in the 160 years since this book was published.
Practical Tunnelling Explaining in Detail, the Setting Out of the Works; Shaft-sinking, and Heading Driving; Ranging the Lines, and Levelling Under Ground; Sub-excavating, Timbering; and the Construction of the Brickwork of Tunnels: with the Amount of Labour Required For, and the Cost of the Various Portions of the Work: as Exemplified by the Particulars of Blechingley and Saltwood Tunnels By Frederick Walter Simms
Applescript in iWork
It comes as a surprise that one of Apples flagship applications, iWork, does not fully support Applescript. Neither Pages nor Numbers have applescript dictionaries associated with them, although Keynote does have a dictionary. This means that Pages and Numbers do not have publicly documented specific Applescript abilities. The good news is that this doesn't mean that Applescript can't be used with this applications.
Using the 'application' System Events you can easily control keystrokes, and occasionally buttons within most applications. To demonstrate how this is done, the following simple script is used to insert a standard reference into the active Pages document. Applescript Studio can then be used to create an interface which allows different references to be inserted all at the click of a button.
set the_text to "Hoek-Brown failure criterion - 2002 edition, 2002, E.Hoek; C. Carranza Torres; B. Corkum, Proc. NARMS-TAC Conference, Toronto, 2002, 1, 267-273, www.rocscience.com/hoek/references/H2002.pdf"
set the clipboard to the_text
tell application "System Events"
tell application "Pages" to activate
tell process "Pages" to keystroke "v" using command down
end tell
I find this script a real timesaver because I don't have to look up references every time I need to insert them into a document. All it takes is a simple click of a button.
Omnigraffle template for geological sequences
One of my favourite features of Omnigraffle is the ability to create your own templates. One of the most useful diagrams I work with is a standard borehole logging diagram. The patterns used in this diagram are from British Standard 5930 which means diagrams will be professional quality as well as quick to produce.
Download it here.
Joint sets in UDEC
The power of this tool can however be a problem. There is always a temptation to just input measured or estimated quantities into UDEC with a suitably high variability, run the model a number of times and then take the worst case result. This is particularly the case with joint sets in a rock mass. A common convention is to simply obtain the joint sets from DIPS, adjust the joint orientations to give the apparent dips of the joints on the face of the model and then input all of the joint sets into the model and run it. This is however an overly simplistic method of generating the joint sets.
The key to understanding how to work with joint sets in UDEC is to understand a key limitation of UDEC; it can only model failure in two dimensions, normal to the face that is modelled in UDEC. To consider this point I want to consider a few different cases with different combinations of joint sets and joint orientations.
Let us first consider
the simple case with a single joint set potentially
causing a failure. The dip of the joint set is
parallel to the dip of the slope as shown in the
diagram. In this case the key joint set can be
readily modelled in UDEC.
The next stage is to consider what happens when the
dip of the joint set is rotated by 45 degrees to
the dip of the slope. Assuming that we only have
one joint set, then slip of the joints would not
occur, as another release pane would be needed.
So let us consider the case with two joint sets
oriented with dip directions of +45 degrees and -45
degrees and both having the same dip. In this case
it is relatively simple to show that the direction
of slide of a wedge that is released will be
perpendicular to the slope face. Again, UDEC will
model this situation appropriately because the
direction of failure is perpendicular to the plane
of the face being modelled in UDEC.
It becomes more complex when the dip and dip
direction of the joint sets relative to the slope
face are different. When this occurs, the dip
direction may not be parallel to the dip of the
slope. The implication of the this is that a simple
UDEC model normal to the to the dip direction of
the slope may not give us an appropriate solution.
So how do we model this more complex problem? The
fundamental requirement is to understand what is
happening to the slope prior to the analysis using
UDEC. If you can understand the dominant failure
mechanisms then you can adjust the UDEC models to
deal with them. I will give to examples of how UDEC
models can be adjusted to potentially give a more
representative solution for the problem. None of
these methods are guaranteed to give the correct
solution, they all have problems. The reality of
the assumption of a two dimensional problem in UDEC
is that in most rock mechanics problems, it can
only give an indication of the behaviour of the
system.
The first simplified approach to the solution is to
simply model the problem along the dip direction of
a dominant joint set. By using this approach the
angle of dip of the dominant joint set is correct.
The factor of safety against sliding along these
dominant joint sets will be correct. However all
other joint sets will not be correct, and the
installed support in the UDEC model will have to be
corrected because it will typically not be oriented
along the dip direction of the dominant joint set.
Whilst this approach is effective in modelling
failure along a single dominant joint set, it does
not consider failure along two joint sets.
The second approach therefore is to assess the dip
direction and dip of the sliding direction of a
block. This can be done using analysis programmes
such as UNWEDGE and SWEDGE. The joint sets in UDEC
can therefore be adjusted to model the dip and dip
direction of the sliding surface rather than the
joints themselves. This may not directly solve the
problem because the dip direction of the sliding
plane may still not be parallel to the dip
direction of the slope. There will also be
geometric problems in the model as UDEC models
prismatic blocks and we are actually trying to
model pyramid shaped blocks. Support, applied
forces and other adjustments to the models may
therefore be necessary.
A final note of warning. If you model two joint
sets in UDEC dipping in the same direction, it is
possible that the joint sets could cross. This
could lead to composite failure through both joint
sets which may be appropriate but not in all cases.
Two joints sets in a UDEC model may be dipping in
the same direction, however the actual dip
direction of these joint sets may be very
different. If this is the cases, then composite
failure through these two joint sets would not be
appropriate. The UDEC model could therefore
significantly over predict the size of a failure
zone by forming composite failures.
The generation of joint sets for modelling slopes
in UDEC can clearly be a complex problem. I hope
these techniques and observations might help
improve the use of UDEC. So far I have only dealt
with slopes; tunnels and caverns are even more
complex so I hope to deal with these in a future
post.
Review of iWork Numbers for engineers
To do this I recreated a standard spreadsheet I use on a regular basis for designing an unreinforced concrete section under axial load and bending. This spreadsheet allows me to check all of the basic features that I need in a spreadsheet for day to day use. It doesn't include some of the more advanced features that I use, but I know that Numbers is missing scripting and advanced plotting. As version 1.0, I don't expect these features and I know that Numbers will not be able to do everything I need it to do, but hopefully this will improve with time and newer versions.
First of all, here is the spreadsheet I created.
So how did I get on?
Well first of all the separate tables. It took me a
few minutes to get used to them, but as soon as I
did they are much more intuitive to use. You can
concentrate totally on the table you are working
on, forgetting about all the others. Once you've
done the work setting up the spreadsheets you can
then concentrate on how to lay them out. It really
helps focus on what you are trying to achieve.
What is ultimately more significant is how the
table can be modularised. To test this out I added
another table to the spreadsheet which took into
account reinforcement in the section. It was really
easy, just add the table. What this means is that a
library of standard tables can be created and just
bolted together. Not only is this quick and easy,
but if a standard library of verified tables is
created, all you have to worry about when checking
a new spreadsheet is how the table have been bolted
together and not whether the contents of each and
every cell is correct. The whole table concept,
from the way they work to the potential ability to
create a library of standard tables will make far
more transparent and accurate spreadsheets.
The biggest problem I have with numbers is in the
graph on my spreadsheet. The amount of control that
you have over the type and format of the
spreadsheet is an order of magnitude worse than it
is with Excel. You can create beautiful looking
graphs and charts, but the options are limited. I
wanted to create a straight line between the points
on my spreadsheet, but could only create a series
of points. It is something that I will definitely
be looking to Apple to improve in future versions.
My last gripe is a well known one, but there is a
lack of support for either plugins or scripting.
This is not surprising as most 1.0 applications
released by Apple have limited support and things
do improve with time. I hope that Applescript can
be added for version 2.0, because the possibility
of Applescript interfacing between Omnigraffle and
Numbers is well worth waiting for. Once this
happens the possibilities for quickly automatically
generating standard plots and diagrams will mean
there is a huge step forward in my productivity.
I think numbers is a big step forward for iWork,
and a big step forward for spreadsheets. I will use
it, but I have no doubt excel will be my tool of
choice, but I look forward to seeing what can be
achieved with version 2.0.
Learning Cocoa
Well I have to say that it is true, there really are some great resources out there. The trouble is there is no structure to it. There is no way to find out which tutorial you should start with and where you should go from there. It took me a bit of stumbling around in the dark to try and find my way around it all. I must admit that there are a few tutorials that I have done more than once and still don't understand, and that is despite the tutorials being describe as 'for beginners'. The penny has finally dropped though, I have suddenly started to understand Cocoa and that is because I happened to find a sequence of tutorials that seems to have worked. If you want to have a go at learning Cocoa, try this sequence. I hope it will as well for you as it did for me.
- The first stage is to go through an excellent short PDF manual called Become an Xcoder. This really does require no prior knowledge of C, C++ or any other language that most manuals assume the reader has. It gives the reader sufficient knowledge to understand what is happening in all the different sections of a project as well as working with basic classes such as arrays or strings.
- The next stage I would recommend is to do Apple's tutorial. To understand fully what is going on in this tutorial you do need some knowledge of the code structures used by Cocoa, but having been through 'Become and Xcoder' you should be ready for this. The one problem with Apples tutorial is that the latest version is based on Leopard and Objective C 2.0. If you don't have leopard, you aren't out of luck, there are still some examples using older versions of Xcode on the internet. This tutorial is useful because it gives you an understanding of some of the non code related issues associated with creating an application.
The latest Cocoa tutorial on the Apple Developer site
An older version of the Apple currency converter tutorial
- The next stage I would suggest is to go to CocoaDevCentral.com and go through the tutorials on the front page. These are some excellent tutorials dealing with some of the other features of Cocoa such as core data and working with graphics. Doing this will give you a fair understanding of how easily accessible some of the features of Cocoa are.
CocoaDevCentral
- Finally I would recommend looking at a larger project and taking it appart to understand how it works. An excellent example of this is a simple calculator app prepared by Apple. Being such a simple application we all understand what it needs to do, making the methods within the application much more accessible. Having been through all of these tutorials you should be able to understand what almost every line of code in the project does. You can then start adding your own buttons and code to the calculator to try out your own skills.
- Now, the world is you oyster. It is now time to start branching out to develop the type of application that you want to do. Once source I would suggest that you have a look at is MacDevNet. It includes two excellent podcasts, CocoaCast for those wanting to do more work on the basics and LateNightCocoa, a well produced series of interviews with Cocoa developers. MacDevNet
I hope this might help out a few people who are starting out or struggling with Cocoa. For a beginner it is a very steep learning curve but it will be well worth it in the end.
Seeding random numbers
One of these key features is the seed. Random numbers are generated using algorithms that take an input value and generate a sequence of numbers that are apparently random. The input value is called the seed. Most programmes use the time when the first random number is generated as the seed; this then ensures a different sequence is generated each time a programme is run.
Overriding the use of the time as the seed does however have a number of benefits:
● It allows scenarios to be re-run, particularly important where scenarios are used to generate the design in a safety critical situation.
● It allows scenarios to be partially re-run. By using the same input parameter the scenario can be started in the same way, but using the seed, the random number sequence can be effectively re-set. This then allows a bifurcation in the model with a different outcome part way through the model.
● It gives repeatability to models, a key component of any analysis that is quality audited. If you are having your analysis checked and it doesn't have built in auditing features such as date stamped reports, your checker must be capable of recreating identical results to yours. The only way of doing this in a statistical model such as UDEC is to set the deed of the model prior to the runs so that the checker can recreate exactly the same model.
So with all that in mind, here are a few ways of setting random number seeds in your models:
Excel
With Excel the easiest way to generate random numbers with a seed is to use the Data Analysis tool pack. I usually find that when I'm working with Excel and random numbers I'm having to use visual basic. For me setting the seed programmatically in Excel using Randomize statement.
Apple Numbers 1.0
Bad news here, I don't know how to set the seed in numbers. It doesn't really surprise me given the lack of scripting associated with Numbers. I remain hopeful of many improvements in the next version of Numbers and this is definitely one of them.
Cocoa
In Cocoa just use the srandom() function. There are plenty of examples out there with this in.
Applescript
In Applescript just set the seed when you first generate a random number using set firstRandom to random number from 1 to 100 with seed seedValue. I've been using this with no problems on an Application that I am currently writing in Applescript Studio. One thing to be aware of though is the some item of function. This doesn't seem to respond to seeding so well so other methods of taking a random value from a list using a directly generated random number seem to work better.


