1% STK_TESTFUN_BOREHOLE computes the "borehole model" response function
2%
3% CALL: Y = stk_testfun_borehole (X)
4%
5%    computes the responses Y(i, :) of the "borehole model" [1-3] for the
6%    input vectors X(i, :).
7%
8%    The output Y is the water flow rate through the borehole (m3/yr).
9%
10%    The input variables (columns of X) are:
11%
12%       X(:, 1) = rw   radius of borehole (m),
13%       X(:, 2) = r    radius of influence (m),
14%       X(:, 3) = Tu   transmissivity of upper aquifer (m2/yr),
15%       X(:, 4) = Hu   potentiometric head of upper aquifer (m),
16%       X(:, 5) = Tl   transmissivity of lower aquifer (m2/yr),
17%       X(:, 6) = Hl   potentiometric head of lower aquifer (m),
18%       X(:, 7) = L    length of borehole (m),
19%       X(:, 8) = Kw   hydraulic conductivity of borehole (m/yr),
20%
21%    and their usual domain of variation is:
22%
23%       input_domain = stk_hrect ([                                  ...
24%           0.05    100   63070    990   63.1    700  1120   9855;   ...
25%           0.15  50000  115600   1110  116.0    820  1680  12045],  ...
26%          {'rw',  'r',    'Tu',  'Hu',  'Tl',  'Hl',  'L',  'Kw'})
27%
28% REFERENCES
29%
30%  [1] Harper, W. V. & Gupta, S. K. (1983).  Sensitivity/uncertainty analysis
31%      of a borehole scenario comparing Latin Hypercube Sampling and determinis-
32%      tic sensitivity approaches.  Technical report BMI/ONWI-516,  Battelle
33%      Memorial Inst., Office of Nuclear Waste Isolation, Columbus, OH (USA).
34%
35%  [2] Morris, M. D., Mitchell, T. J. & Ylvisaker, D. (1993).  Bayesian design
36%      and analysis of computer experiments: use of derivatives in surface
37%      prediction.  Technometrics, 35(3):243-255.
38%
39%  [3] Surjanovic, S. & Bingham, D.  Virtual Library of Simulation Experiments:
40%      Test Functions and Datasets.  Retrieved February 1, 2016, from
41%      http://www.sfu.ca/~ssurjano/borehole.html.
42
43% Copyright Notice
44%
45%    Copyright (C) 2016 CentraleSupelec
46%
47%    Author:  Julien Bect  <julien.bect@centralesupelec.fr>
48%
49%    Based on the "Virtual Library for Simulation Experiments"
50%       Copyright (C) 2013 Derek Bingham, Simon Fraser University
51%       Authors: Sonja Surjanovic & Derek Bingham (dbingham@stat.sfu.ca)
52%       Distributed under the GPLv2 licence
53%       http://www.sfu.ca/~ssurjano/Code/borehole.html
54
55% Copying Permission Statement
56%
57%    This file is part of
58%
59%            STK: a Small (Matlab/Octave) Toolbox for Kriging
60%               (http://sourceforge.net/projects/kriging)
61%
62%    STK is free software: you can redistribute it and/or modify it under
63%    the terms of the GNU General Public License as published by the Free
64%    Software Foundation,  either version 3  of the License, or  (at your
65%    option) any later version.
66%
67%    STK is distributed  in the hope that it will  be useful, but WITHOUT
68%    ANY WARRANTY;  without even the implied  warranty of MERCHANTABILITY
69%    or FITNESS  FOR A  PARTICULAR PURPOSE.  See  the GNU  General Public
70%    License for more details.
71%
72%    You should  have received a copy  of the GNU  General Public License
73%    along with STK.  If not, see <http://www.gnu.org/licenses/>.
74
75function y = stk_testfun_borehole (x)
76
77x = double (x);
78
79rw = x(:, 1);
80r  = x(:, 2);
81Tu = x(:, 3);
82Hu = x(:, 4);
83Tl = x(:, 5);
84Hl = x(:, 6);
85L  = x(:, 7);
86Kw = x(:, 8);
87
88A = 2 * pi * Tu .* (Hu - Hl);
89B = 2 * L .* Tu ./ ((log (r ./ rw)) .* (rw .^ 2) .* Kw);
90C = Tu ./ Tl;
91D = (log (r ./ rw)) .* (1 + B + C);
92
93y = A ./ D;
94
95end % function
96