Sensitivity Analyses

by Nate on June 15, 2009

A GeoStudio user commented on an earlier post (”solving in batch mode”) asking how to generate thousands of similar analyses that differ only by some input parameters.

Interesting question, and I’d like to hear more about what it is he’s trying to accomplish.  But in the meantime here are some thoughts.

Sensitivity

In SLOPE/W, take a look at the Sensitivity analysis (KeyIn Analyses - FOS Distribution - Sensitivity).

Selecting the Sensitivity analysis option.

That will let you specify a range of values for certain properties (such as C, Phi and Unit Weight in the material properties), and will re-run the analysis many times.

Specify a range of values for a parameter.

In Contour you can then do things such as graphing how the FOS is affected by varying Phi. (In the menu that’s Draw - Sensitivity.)

Graphing factor of safety relative to changing parameter values.

Probability

Similarly you can do a Probabilistic analysis in SLOPE/W, where Solve takes care of varying the parameters in a random way using a distribution function you define. It then gives you a probability of failure instead of a factor of safety.

One of the probability graphs.

You can find an example of sensitivity and probabilistic stability analyses on the geo-slope.com web site.

Add-Ins

The other products (Seep, Sigma, etc) do not have sensitivity analyses built in.  (It’s a feature we’re considering adding, so email or leave a comment to cast your vote if you would use it.)

I could imagine doing something similar using an Add-In and a batch file. The batch file could make many copies of the file, giving each a unique name (”dam-1.gsz”, “dam-2.gsz”, etc), then solving each. An Add-In function would be used to specify the property you want to vary. The Add-In would look at the file name (the “1″ or “2″ part of it) to return a different value for each run.

Not a particularly elegant solution, but it would do the trick. Of course you’d end up with hundreds of files and no simple way to compare results or graph results across the varying parameter as you can do in Slope.

Add-Ins are beyond the scope of what I can go into today, but I have been wanting to delve into them on the blog at some point. Let me know if that would interest you.

XML

An even more adventurous route would be to edit the xml inside a gsz file.  (I mentioned in passing in a few other posts that a .gsz is just a zip file that contains a bunch of other files–one of the xml files it contains is what actually defines all the data in your model.)  The advantage would be you could avoid having thousands of files and instead have just a few files each containing a number of analyses.  That lets you share data (so that moving a point in one file wouldn’t have to be duplicated to all the others), and you may also be able to take advantage of the fact that GeoStudio can graph across analyses.

But editing the xml is not something we officially support, so you’re on your own if you choose that route.

I’m curious what it is you’re doing with your thousands of files. Can you share some more detail? Do the tips I mentioned help? We’re working full-force on the next version of GeoStudio at the moment, so this is a great time to hear about features that would be important to you.

{ 0 comments }

Shorter Solve Times with QUAKE/W

by Nate on June 2, 2009

Last year while discussing hardware recommendations for getting the most out of GeoStudio 2007, I mentioned that the solvers are multi-threaded, “meaning [they] will take full advantage of multiple CPUs or cores.”

But a QUAKE/W user showed me that’s not true in all cases.  He had a QUAKE/W analysis that was only using one of his four cores, and asked me why that was, or what he could do to change it.

That was news to me, and at first I thought it was a bug, but after some digging through the code and discussing with other engineers in the group, I learned a valuable lesson.

It turns out QUAKE/W will take full advantage of multiple CPUs when using the Parallel Direct Solver option but only for Initial Static and Nonlinear Dynamic analyses.  The Equivalent Linear analysis types are not currently formulated in a way that lends itself to parallelization, and thus even if you choose the “Parallel Direct Equation Solver” option, they will only use a single core while solving.

QUAKE/W analysis types - only the first and last lend themselves to multi-threading.

We did have some other suggestions, however, for how this customer could greatly speed up solving his analysis.  Some of these may help you as well.

Shorten the Earthquake Record

This customer had over 12,000 data points in his earthquake record.  That means over 12,000 finite-element analyses for each iteration. 

Much of this is unnecessary.  The first thing to do is to lop off the ends.  Normally in an earthquake record the beginning and end can be lopped off, as the vibrations are small enough as to not affect the final solution. 

In this case we suggested getting rid of the first five seconds and the last 25 or so, which I’ve highlighted here.

Focus on the important part of the quake by getting rid of the 'noise' at the beginning and end.

We’ve just cut down the number of data points to 5000, less than half.  That cuts the solve time less than half too.

Resample the Earthquake Record

This record’s data points are 4/1000 sec apart.  That kind of precision is likely not necessary for a geotechnical analysis. 

Use Excel to remove every other data point, then re-scale the record so it still has the same peak accelerations, and you’ve reduced the number of equations by half again, still likely without affecting your results.

Understand the Equivalent Linear Method

Remember what the EL method is all about.  You are looking for only one number for each element and taht is the maximum dynamic shear stress.  This usually occurs at one of the peaks.  All analyses after the peak has been established are irrelevant to the analysis.

Simplify the Mesh

Especially in the early stages of an analysis, when you’re trying to answer some initial questions, use a simple mesh.  For example:

  • if you know all the important activity will be in one area, get rid of mesh detail a long way from that area;
  • stick to just a few materials and a couple of regions;
  • try a 1D column to start with.

Besides making for shorter solve times, a simpler geometry and simpler mesh also makes it easier to understand and interpret the answers you’re getting.  You can add complexity later and watch how (or if) it affects what you’ve understood so far.

Happy meshing!

{ 2 comments }

Happy New Year

by Nate on January 6, 2009

Happy New Year to all my readers!

A coworker recently pointed me to Dave’s landslide blog, by Dave Petley, the Wilson Professor at Durham University in England. Today’s article is an interesting look at a slide at a Tennesses power plant a few weeks ago (which amazingly claimed no lives).

{ 0 comments }

Snap To Grid

by Nate on December 15, 2008

We generally recommend you always keep the “Snap to Grid” option on.  In fact in recent versions we’ve defaulted it to on for new files.  

The reason is that otherwise lines that appear to be vertical may in fact be slightly off. Many times that’s fine, but in SLOPE/W in particular nearly-vertical lines can cause a host of problems, and often be hard to detect.

So turn your grid on, and use these tips to draw foolproof geometry.

Grid Settings

Use the Grid Toolbar to make changes to your grid, or the Set - Grid menu item.

Use the Grid Toolbar for adjusting your grid as you work.

The button on the left turns the grid (and grid snapping) on or off.  

The two edit boxes adjust the grid spacing.  (You only need to adjust one of them–the other gets calculated automatically.)

Finer Detail

Adjust the grid spacing often as you work.  If you need to add details in between the grid points, don’t turn the grid off, just work with a finer grid.  When you’re done with detail area, you can make the grid coarser again.

Alt to Override the Grid

There are some times where you really need to work without the grid, or where you’re adjusting it so many times that you’d rather just turn it off.

Consider instead holding down the Alt key while you’re clicking.  The Alt key will temporarily override the grid, letting you click wherever you want.

{ 4 comments }

Create a Database of Common Functions

by Nate on December 1, 2008

As you use GeoStudio, you quickly find yourself creating the same functions over and over.  As you type in a water content function for your standard local clay for the hundredth time, and especially if you’re lazy like I am, you think “there’s got to be better way!”

There are, in fact, three ways I can suggest.

Importing Functions

Functions can be imported from any other .gsz file.

 

  1.  From the KeyIn Functions box, click the arrow next to “Add” and choose “Import…”
  2. Select the .gsz file that contains the function.
  3. You’ll be presented with a list of functions in that file that are of the same type as those you’re currently editing.  
  4. You can select one or more and click Import, and they magically appear in your list of functions.

 

Function Library

You may want to import a function from another analysis you were just working on recently.  But the next level of organization is to create a .gsz file whose only purpose is to store common functions.

Save a “Function Library.gsz” on a shared drive on the network and all your engineers can have access to the same standard functions.

Spreadsheet

An alternative to importing a function from another .gsz is to import it from a spreadsheet.  

In this case you aren’t really importing it, you just use the clipboard to copy the data points and paste them into the KeyIn Functions list.  (I discussed this last year in editing functions.)

I don’t suggest keeping a shared database of functions in a spreadsheet, because the spreadsheet only holds the data points, not the function type (spline vs step etc) or additional values like the spline curve or segment weight.  

But if you have a function from some other source, or you’ve written an algorithm in Excel to generate your unique function, this can be a good way to get it into GeoStudio.

{ 4 comments }

Meshing Efficiently

by Nate on November 19, 2008

GeoStudio 2007 tries to let you focus on the definition of the geometry, boundary conditions and material properties, without being distracted by the mesh. If you want, you can define your model, solve it, and view the results without once looking at the mesh.

But the reality is if you’re doing a finite-element analysis, the mesh can’t be ignored forever.

Start Simple

We always encourage you to start your model simply, and add complexity.  The same can be said for meshing.  Start with the default mesh, look at your results, and then decide if you need to use a finer mesh in certain areas (or everywhere).

Set the Global Element Size

If you want a finer mesh, the place to start is to use Draw Mesh Properties to change the “Approx. Global Element Size”.  This will change the entire mesh.

You’re setting the preferred length of each element edge.  So a smaller number will make for a finer mesh, and a larger number gives a coarser mesh.

Remember this size is “approximate”.  The mesher will do the best it can to stay close to the size you specified, but it won’t be exact.

Constrain the Mesh

Often you’ll find there are certain areas of your geometry that have more “activity”.  These areas may benefit by having a finer mesh.  You’ll get more exacting results at the expense of a longer solve time.

To get a finer (or coarser) mesh in specific areas, you select a region, line or point in that area, and change the Element Edge Length for the object you selected.  (You can also multi-select to adjust several objects simultaneously.) 

This is called “constraining the mesh”, because you’re giving the mesher specific instructions about this part of the mesh.

When adding a constraint, you are again specifying the preferred (or approximate) length of every element edge in this area.  But there are several ways to specify it:

  1. Using a ratio of the global length.
  2. Specifying the approximate length.
  3. Specifying the exact number of divisions (this option is only avialable on lines).

Normally #1 is the better approach, just defining it as a ratio, like “0.5″ to make the mesh in this area half the size as the rest of the mesh.  That way you can later adjust the Global Element Size to make the entire mesh finer, and this area becomes finer yet.

Here’s an Example

Draw a simple geometry.  Choose Draw Mesh Properties to look at the mesh.

Make a finer mesh everywhere by adjusting the global element size.

Make the left side finer still, using a ratio.

Make the entire mesh finer by adjusting the global element size again.  Notice that elements along the left side are still half the size of the rest of the mesh.

Conclusions

Meshing is half science and half black art.  Making a finer mesh does NOT always give you a better result.  Discussing the ins and outs of how to mesh properly is beyond the scope of this article.  Read the engineering books that came with your software for a better treatment of this subject.

But adjusting and fine-tuning the mesh in GeoStudio 2007–or ignoring it completely–is easier than it has been in any previous version.

{ 0 comments }

Copying and Pasting Regions

by Nate on November 10, 2008

While you can’t copy regions from one .gsz file to another, you can do better than just re-creating them all by hand.

To start out, run two copies of GeoStudio side-by-side, one with the source file and one with the destination file.

Copy the Points

Choose the KeyIn Points command in both GeoStudio windows.

  1. In the source file, select every point in the list;
  2. copy them to the clipboard.
  3. In the destination file, paste the points into the list.

When pasting the points, you may get this error:

You can safely hit OK and forget about it. The problem is just that when you copied the points to the clipboard, you included the last one in the list, which is just a placeholder and has “—” as the X and Y values. When you try to paste those values GeoStudio complains that they aren’t numbers. You can avoid the error in the future by selecting all but the last point.

Both files now have the same points. All that’s left is to hook them up together into regions.

Copy the Regions

Unfortunately you can’t copy and paste the entire list of regions like we did with points. Instead you have to do them one region at a time.

For each region in the source list:

  1. Select the region;
  2. Select and Copy the “Region Points” text;
  3. In the destination, click the Add button;
  4. Paste the points into the Region Points control.

For simple regions you may find it easier to just redraw them. At least all the points exist already at the same coordinates. But for complex region this tip will save you some time and avoid errors.

{ 0 comments }

Ordering Analyses

by Nate on October 27, 2008

Here is a quick tip to put you on friendly terms with KeyIn Analyses:

When you create analyses in KeyIn Analyses, they are always listed in alphabetical order. If you really want them to be displayed in a different order, just put a number at the beginning of each analysis name, and they’ll get sorted by that number.

Take this case, for example. We develop three analyses as an experiment, with increasing complexity:

  • Dry Frictional Material with No Cohesion
  • Wet Frictional Material with No Cohesion
  • Wet Frictional Material with Cohesion

But GeoStudio displays them in alphabetical order, resulting in this:

To get the analyses displayed in a more logical order, simply rename them, like this:

P.S. Our own examples online do this all the time, but are not really good examples to follow IMO. Our engineers tend to go crazy and use numbering even when it isn’t necessary.

In my experience, most of the time the default alphabetical and parent/child ordering is fine.

While there’s nothing wrong with something like the following example, the numbering is unnecessary, because the parent-analysis / child-analysis structure will keep the analyses in sequential order anyway:

{ 2 comments }

Long Analysis Names

by Nate on October 20, 2008

Mike recently emailed me from Australia trying to understand why a long analysis name would cause a “Path too long” error when running Verify.

Background - Path Length

Windows imposes a maximum number of characters allowed for any path, including the drive letter, the directories, and the file name. In XP I believe the limit is 260 characters.

In this example (and in Mike’s case) his file name was within the 260 character limit that Windows imposes on paths.

The problem is a bit hidden, and has to do with how GeoStudio handles .gsz files.

A Gsz is a Zip File

I’ve mentioned before that a .gsz file is really just a Zip file that can be opened with WinZip or any other Zip reader.

When GeoStudio opens a .gsz file, it unzips any internal files it needs into your TEMP directory. In Windows 2000, Windows 98, and older versions, the TEMP directory is normally C:\TEMP. But in XP (and Vista) each user on a computer gets their own TEMP directory for privacy reasons, so the path is something like:

C:\Documents and Settings\YourUsername\Local Settings\Temp\

That’s a pretty long path to start out with. Maybe you can see where this is headed.

After that TEMP path, GeoStudio adds a unique folder name that is derived from the name of the .gsz, so now we’re up to something like:

C:\Documents and Settings\YourUsername\Local Settings\Temp\gs_Your Gsz File Name_89284fa64a8df8a7cf04a40a75c2b96c\

That’s the root folder the .gsz gets unzipped into. Nasty. But that’s not all, oh no, that is not all!

Inside that folder you get another folder named after each analysis. Now we’re at:

C:\Documents and Settings\YourUsername\Local Settings\Temp\gs_Your Gsz File Name_89284fa64a8df8a7cf04a40a75c2b96c\Your Descriptive Analysis Name\

Inside that analysis folder you get one folder for each time step:

C:\Documents and Settings\YourUsername\Local Settings\Temp\gs_Your Gsz File Name_89284fa64a8df8a7cf04a40a75c2b96c\Your Descriptive Analysis Name\001\

And for the coup de grâce, in SLOPE/W we then fnish the path off with the name of the analysis again (in the flow products we use shorter names like “nodes.csv”):

C:\Documents and Settings\YourUsername\Local Settings\Temp\gs_Your Gsz File Name_89284fa64a8df8a7cf04a40a75c2b96c\Your Descriptive Analysis Name\001\Your Descriptive Analysis Name.frc01

You can see that even if you keep your filename and analysis names below the 260 character limit, you may still end up going over the limit inadvertantly. With SLOPE/W especially, keeping your analysis names shorter makes a big difference since they are used twice.

Verify

The good news is that in the latest versions, Verify catches the problem. In earlier versions it wasn’t so friendly. I don’t remember if it would crash, give strange results, or if the solver would just give an unhelpful error message.

If you get the “Path too long” error in Verify, just shorten your analysis name and/or the name of your .gsz file.

{ 0 comments }

When to Use GeoStudio Betas

by Nate on October 14, 2008

Wow, I have not been very good at updating this blog this fall!  Work has been very busy here lately and I just haven’t been able to find the time to write.

Betas

Two weeks ago I talked about how we let people know about updates to GeoStudio being released, and why there’s usually a delay between a release and when GeoStudio’s Start Page tells you about it.  I ended the article by mentioning that we now post betas weeks or even months before a release.

You can always find the latest beta on the Beta Downloads page.

Betas have turned out to be a great way to get small changes out quickly.  Normally when we become aware of an important bug, we can fix it the same day or at least within the week.  But we don’t want to post a new release every week–you’d probably be annoyed having to download a 70 MB file that often!

Instead we post a new beta, and email the person who reported the bug.  Anyone else over the next weeks who reports the same bug can be pointed to the beta as well and be quickly up and running again.

It is beta software though!

A word of caution:  a beta has not been fully tested, and could contain new bugs worse than what we fixed.

As a result, we don’t recommend everyone run the beta.  But if you encounter a bug with no easy workaround that has been fixed in the beta, using the beta can be better than waiting for the next release.

{ 0 comments }