function Y = uq_ABC(X)
% Y = uq_borehole(X) returns the value of the water flow Y through a
% borehole, described by 8 variables given in X = [rw, r, Tu, Hu, Tl, Hl, L, Kw]
%
% rw 	-	radius of borehole (m)
% r 	-	radius of influence (m)
% Tu 	-	transmissivity of upper aquifer (m^2/yr)
% Hu 	-	potentiometric head of upper aquifer (m)
% Tl 	-	transmissivity of lower aquifer (m^2/yr)
% Hl 	-	potentiometric head of lower aquifer (m)
% L 	-	length of borehole (m)
% Kw 	-	hydraulic conductivity of borehole (m/yr)
%
% For more info, see: http://www.sfu.ca/~ssurjano/borehole.html
% 
% See also: UQ_EXAMPLE_SENSITIVITY_01_BOREHOLE_MODEL,
%           UQ_EXAMPLE_SENSITIVITY_02_SOBOLINDICES

X1 = X(:, 1);
X2 = X(:, 2);
X3 = X(:, 3);
X4 = X(:, 4);
X5 = X(:, 5);
X6 = X(:, 6);
X7 = X(:, 7);
X8 = X(:, 8);
X9 = X(:, 9);
X10 = X(:,10);
X11= X(:, 11);
X12= X(:, 12);
X13= X(:, 13);
X14= X(:, 14);
X15= X(:, 15);
X16= X(:, 16);
X17= X(:, 17);
X18= X(:, 18);
X19= X(:, 19);
X20= X(:, 20);
X21= X(:, 21);
X22= X(:, 22);
X23= X(:, 23);
X24= X(:, 24);
% Precalculate the logarithm:
Y=sqrt((-X1+X19-8*X24-X13+450*(X11+X17)+8*(X12+X6+X18)-X7).^2+(-X2+X20+200*X24-X14+450*(X10+X16)+400*(X12+X6+X18)-X8).^2+(X21+8*X22-200*X23-X3-X15-8*(X10+X4+X16)-400*(X11+X5+X17)-X9).^2);