forked from randlab/hytool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
diagnostic.m
67 lines (62 loc) · 1.87 KB
/
diagnostic.m
1
function diagnostic(t,s,d,m)%DIAGNOSTIC Creates a diagnostic plot of the data% % Syntax: diagnostic(t,s[[,d],m]) %% d = optional argument allowing to adjust the% number of points used in the Spline by default% or the distance between points depending on the option below%% m = optional argument allowing to select% different methods of computation of the derivative%% 's' for spline resampling% in that case d is the number of points for the spline%% 'd' for direct derivation% in that case the value provided in the variable d is not used%% 'b' for the Bourdet et al. formula % in that case d is the lag distance used to compute the derivative %% Description:% This function allows to create rapidly a diagnostic plot (i.e. a % log-log plot of the drawdown as a function of time together with% its logarithmic derivative) of the data.%% Example:% diagnostic(t,s)% diagnostic(t,s,30)% diagnostic(t,s,20,'d') - in that case the number 20 is not used%% See also: trial, ldf, ldiff, ldiffs, fit%if(nargin==2) % Default value for d if not given by user d=20; m='s';endif(nargin==3) % Default value for d if not given by user m='s';endispositive=find(t>0);t=t(ispositive);s=s(ispositive);switch m case 's' [td,sd]=ldiffs(t,s,d); % Numerical estimation of the derivative with spline sampling case 'd' [td,sd]=ldiff(t,s); % Standard estimation of the derivative case 'b' [td,sd]=ldiffb(t,s,d); % Standard estimation of the derivative otherwise disp('ERROR: diagnostic(t,s,d,m)'); disp(' The method selected for log-derivative calculation is unknown'); td=NaN; sd=NaN;endisd=find(sd>0);clfloglog(t,s,'o',td(isd),sd(isd),'+') xlabel('Time')ylabel('Drawdown and log derivative')legend('Drawdown','Derivative','Location','Northwest')