Sie sind auf Seite 1von 3

MINERR; The Inverse Approach, Curve Fitting, and Non-Linear Regression

Earlier in the course we used Excel's LINEST function to find the least-squares best-fitting line to various data sets that we expected were linear. Mathcad provides a similar capability via its SLOPE and INTERCEPT functions. Obviously, not every process in Geology can be described by a simple linear relationship. The one we graphed in the last exercise, draw down around a pumping well, provides a ready example. To deal with nonlinear problems Mathcad provides FIND, MINERR, and GENFIT. In this exercise set we will investigate and use MINERR; Mathcad's help explains the others as well.

MINERR, used in a Solve Block, returns parameters of a model that come closest to satisfying the equations of the model. Thus if we observe draw down in some test wells, we know their distance from the pumping well, how much we are pumping, and most parameters of the draw down model. What we do not know is the local hydraulic conductivity. Extracting the parameters of the model directly from the observations is generally known as the inverse problem, curve fitting, or non-linear regression.

First, let's review the forward approach:

To generate some values to use for nonlinear regression we'll return to the function we looked at in the last exercise, draw down in an unconfined aquifer from pumping a well. To generate a graph of the function, we first need to enter the constants and function (remember the ":" bit). Note that I dropped the units here; Mathcad has trouble solving for multiple unknowns when units are carried in the expressions:

.
.
day
24 60 60
ho
10
 r 1000 k 10 12 rw 0 g 9.8 Q 25 u .001 r0 2000

day

Next, enter the range of r values we wish to investigate. To do so, put in the initial value, a comma, the next value, a semicolon, and the final value; Mathcad calls this sort of construction a "range variable."

r

0.1 ,2

1000

As before, define your function and Insert a graph from the Graph Palette or from the Menu Bar/Insert/Graph/X-Y Plot. Then fill in the placeholders using r for the x-axis, head(r) for the y-axis If your units don't work out Mathcad will tell you so:

Evaluated at a few spots:

u
. Q
r
ho 2
. ln
.
.
.
k r
g p
r0
10
5
0
20
40

r

Pretend that the evaluation of the function at 3, 5, and 7 meters represents observations. We will later truncate these values and used them as observations; truncation removes their "exactness."

1

Now, the inverse approach:

The typical situation in a geological experiment is that we know the underlying function (model) and we have designed an experiment, and acquired some data. The problem is then to get the best, most-reasonable estimates of the parameters of the model. In the case of draw down around a pumping-well, we would know most of the parameters in our equation and would usually be interested in getting a good estimate of hydraulic conductivity, k. Given our observations and a knowledge of the underlying model (equation), a general setup for MINERR is as follows:

1. We start by defining the data we are going to use. I put them in a vector (hit CTRL M after the ":="

sign) so I could graph them later:

Obs

6.0
6.8
6.7
7.2

Now,

Obs 0 = 6

Obs 1 = 6.8

etc.

For their distance:

Obs_r

3
5
7
9

2. Mathcad requires initial guesses of the unknown parameters to know where to start looking in solution

space. You should make these as reasonable as possible because in most non-linear systems there will be "pretty good" solutions known as local minima that are not the best solution (global minima).

Take a guess at k:

k

5 10 11

.

This is a reasonably wild guess as we generated the "data" with k = 1*10 -12

3. Now set up the data constraints and a Given Block. To do so, we set the equation, evaluated at

the proper x values, equal to the observations. The heavy set (bold) = sign is inserted by holding down the CTRL key and hitting the "=" key:

Given

Mathcad recognizes this "given" as one of its statements. Here are four observations or constraints truncated to one decimal place. If I want to find k, one unknown, I really only need one observation; using four highlights the least-squares approach:

k

.
u
Q
3
.
ho 2
ln
Obs
0
r0
.
.
.
k
r
g
p
.
u
Q
5
.
ho 2
ln
Obs
1
r0
.
.
.
k
r
g
p
minerr( k)
k
=
9.966 10 13
.
u
Q
7
.
ho 2
ln
Obs
2
r0
.
.
.
k
r
g
p
.
u
Q
9
.
ho 2
ln
Obs
3
r0
.
.
.
k
r
g
p

And MINERR has produced its result. If you experiment with changing the observations you'll see MINERR change the result. Now, how well does our least-squares determined k value fit the observation? I'll put the observations in a vector and plot them along with the draw down function evaluated with Mathcad's MINERR estimated value for k.

2

To look at the result, rewrite the equation so it is evaluated with the new conductivity determined by nonlinear regression and graph the data and equation:

recall:

Obs =

ho 2

u
. Q
r
. ln
.
.
.
k r
g p
r0

6

6.8

6.7

7.2

Obs_r

=

3

5

7

9

10
5
Obs
0
2
4
6
8
10
r,Obs_r

Exercises:

1. Replicate the inverse part of this exercise.

2. Given the data below, determine the least-squares best-fit values for Q and k and graph the data and

results to determine the adequacy of your fit.

Obs

r