Responses

The responses plugin contains extra response functions for Pastas.

Currently the following response functions are available:

  • Theis: the Theis response function for pumping between two parallel infinitely long ditches.

Example

See the Examples section for more information on how to use the responses plugin.

API

class Edelman(cutoff=0.999, **kwargs)[source]

The function of Edelman, describing the propagation of an instantaneous water level change into an adjacent half-infinite aquifer.

Parameters:
  • up (bool or None, optional) – indicates whether a positive stress will cause the head to go up (True, default) or down (False), if None the head can go both ways.

  • gain_scale_factor (float, optional) – the scale factor is used to set the initial value and the bounds of the gain parameter, computed as 1 / gain_scale_factor.

  • cutoff (float, optional) – proportion after which the step function is cut off.

Notes

The Edelman function is explained in :cite:t:`edelman_over_1947`.

The impulse response function for this class can be viewed on the Documentation website or using latexify by running the following code in a Jupyter notebook environment:

ps.Edelman.impulse
_name = 'Edelman'
static gain(p)[source]
Parameters:

p (ArrayLike)

Return type:

float

get_init_parameters(name)[source]

Get initial parameters and bounds. It is called by the stressmodel.

Parameters:

name (str) – Name of the stressmodel.

Returns:

parameters – The initial parameters and parameter bounds used by the solver.

Return type:

pandas DataFrame

get_tmax(p, cutoff=None)[source]

Method to get the response time for a certain cutoff.

Parameters:
  • p (array_like) – array_like object with the values as floats representing the model parameters.

  • cutoff (float, optional) – proportion after which the step function is cut off. default is 0.999.

Returns:

tmax – Number of days when 99.9% of the response has effectuated, when the cutoff is chosen at 0.999.

Return type:

float

static impulse(t, p)[source]

Method to return the impulse response function.

Parameters:
  • t (array_like) – array_like object with the times at which to evaluate the impulse response, can be obtained with get_t() method

  • p (array_like) – array_like object with the values as floats representing the model parameters.

Returns:

s – Array with the impulse response.

Return type:

array_like

Notes

The impulse response function for each response function class can be viewed on the Documentation website or using latexify by running the following code in a Jupyter notebook environment:

ps.RfuncName.impulse

Only used for internal consistency checks

step(p, dt=1.0, cutoff=None, maxtmax=None)[source]

Method to return the step function.

Parameters:
  • p (array_like) – array_like object with the values as floats representing the model parameters.

  • dt (float) – timestep as a multiple of one day.

  • cutoff (float, optional) – proportion after which the step function is cut off. default is 0.999.

  • maxtmax (int, optional) – Maximum timestep to compute the block response for.

Returns:

s – Array with the step response.

Return type:

array_like

class Theis(cutoff=0.999, nterms=10, **kwargs)[source]

Theis response function for pumping between two ditches.

Parameters:
  • cutoff (float, optional) – The cutoff value of the response function.

  • nterms (int, optional) – The number of terms to use in the Theis response function.

  • **kwargs – Any other parameter that is passed to the RfuncBase class.

_name = 'Theis'
static gain(p)[source]
Parameters:

p (ArrayLike)

Return type:

float

get_init_parameters(name)[source]

Get initial parameters and bounds. It is called by the stressmodel.

Parameters:

name (str) – Name of the stressmodel.

Returns:

parameters – The initial parameters and parameter bounds used by the solver.

Return type:

pandas DataFrame

get_tmax(p, cutoff=None)[source]

Method to get the response time for a certain cutoff.

Parameters:
  • p (array_like) – array_like object with the values as floats representing the model parameters.

  • cutoff (float, optional) – proportion after which the step function is cut off. default is 0.999.

Returns:

tmax – Number of days when 99.9% of the response has effectuated, when the cutoff is chosen at 0.999.

Return type:

float

step(p, dt=1.0, cutoff=None, maxtmax=None)[source]

Method to return the step function.

Parameters:
  • p (array_like) – array_like object with the values as floats representing the model parameters.

  • dt (float) – timestep as a multiple of one day.

  • cutoff (float, optional) – proportion after which the step function is cut off. default is 0.999.

  • maxtmax (int, optional) – Maximum timestep to compute the block response for.

Returns:

s – Array with the step response.

Return type:

array_like

to_dict()[source]

Method to export the response function to a dictionary.

Returns:

data – dictionary with all necessary information to reconstruct the rfunc object.

Return type:

dict

Notes

The exported dictionary should exactly match the input arguments of __init__.