editing functions

by Nate Hekman on March 18, 2008

If you use GeoStudio, you use functions.  And yet I find over and over as I watch people at workshops that to many of you functions are a bit of a mystery, a necessary evil.

Not being an engineer, I can’t help make sense of how the functions are used or what values to type in.  For that you’ll have to read the product manuals or attend one of our workshops (European readers, the annual UK workshop is only a few months away).

But I can help clarify how you can create and edit functions.  And with that frustration out of the way you can focus on the numbers.


We always recommend you start with a simple model and add complexity only as needed.  A simple way to create a function is to estimate it.  In many cases an estimated function is all you need.  Making adjustments to an estimated function and seeing how those changes affect the result can tell you how critical this function is to your particular problem.

Most functions have an “Estimate…” button.  The details as to what values you need to provide to come up with a reasonable estimate will vary depending on what type of function you’re estimating.

Here’s how a hydraulic conductivity function is estimated.

Estimating a function is a good place to start

When you estimate a function, GeoStudio uses the values you provide to generate a curve, then samples the curve at a couple dozen points and adds those points to the function.

At that point it’s just a regular function you can edit like any other.

Importing from Excel

If you already have a function defined in a spreadsheet such as Excel, it’s easy to import the data points.  Make sure the data in the spreadsheet is arranged in two columns.  Select the columns and copy them to the clipboard (Ctrl-C, Ctrl-Ins, Edit-Copy in the menu, or right-click and choose Copy). 

Then go back to GeoStudio and paste them into the function’s list of data points (by right-clicking on the list and choosing Paste, or clicking on the listbox and hitting Ctrl-V or Shift-Ins).

Paste points from Excel into KeyIn Functions

Exporting to Excel

Exporting is just as easy.  Select all the points in the listbox and copy them to the clipboard (right-click and Copy), then paste them into Excel.

But there’s another way to export.  If you want more detail than just the data points you defined, you can click the “More” button under the graph, then “Export data (csv)”.  Give it a file name, and it will sample the function at more points, saving the coordinates to a csv file, then opening the file in Excel (or whatever application is registered to open .csv files).  If your function has lots of variability then this method will often give you a more accurate representation.

Export a function to a spreadsheet

Edit Data Points

You can edit, add or remove data points graphically. 

Make sure you’re in the “Edit Data Points” mode:

Edit Data Points

Then use your mouse to drag points around on the graph. 

  • Click and drag a point to move it.
  • Drag a rectangle around several points to select them all.
  • Hit Del to delete selected points.
  • Drag a point beyond the edge of the graph and the graph will extend to include the new extents.

Click the “Add Points” button to switch to “add” mode.  Now anywhere you click on the function you’ll add a new points.

View Function

Choose “View Function” instead of “Edit Data Points” to see the function as the solver will use it. 

For many functions, “View Function” will show you the same thing as “Edit Data Points” only without being able to modify it. 

But in a few cases the function you see under View Function is different.  For example, when you define the Hydraulic Conductivity Function you enter Matric Suction vs X-Conductivity, but View Function shows you Pore-Water Pressure vs X-Conductivity.  That’s because the solver will actually be using the PWP function.

View Slope of Function

A function with a steep slope or sharp variability in its slope can sometimes cause numerical instability.  You may want to use the “View Slope of Function” if the solution can’t converge, to make sure the graph of the slope of the function is smooth.


Some functions can be easily adjusted up or down by adjusting the “y-intercept” (in math lingo).  The hydraulic conductivity function, for example, has a K-Saturation value.  Change the K-Saturation and the entire function is moved up or down so as to pass through that point.

You can move the entire function up or down by adjusting K-sat

Curve Fit and Segments

Spline functions have “Curve Fit” and “Segment” sliders which you can use to adjust how the curve is fit to the points you’ve defined. 

“Curve Fit” governs how important it is for the line to go through or near the points.

“Segments” controls how straight or curved the line should be (and thus how sharp the corners).

Summing it Up

Whether you’re a technical engineer who likes typing in exact numbers or an artistic engineer who just knows what the function should look like, you should know how to get your data into and out of a typical data point function.

When it comes to making a function look pretty, read my blog from December.

{ 4 comments… read them below or add one }


marganda 04.07.08 at 7:10 pm

Dear, Mr. Grokkin

we have a problem import data from minescape ( data format in dwg/dxf). we use geostudio 2004 .

Can you give me the solution for my problem ??

we use manual system to plot the point.


Nate 04.08.08 at 7:49 am

You should email support [at] geo-slope [dot] com and someone will be happy to assist. You may want to attach your dwg file to the email and explain what you feel isn’t working.


ahmed essam 10.26.10 at 10:35 am

why the hydroulic gradiant is line and isnot a curve?


Nate 10.26.10 at 10:42 am

Sorry Ahmed, that’s beyond my knowledge. Feel free to email support [at] geo-slope [dot] com and one of our engineers would be happy to explain.

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>