chemreac.util.analysis

Functions to analyze numierc output from integration.

chemreac.util.analysis.eval_jacobian(rd, x, y)[source]

Evaluates the Jacobian matrix

Parameters
rd: ReactionDiffusion instance

System at hand

x: float

value of the independent variable

y: array

values of the dependent variables (you may need to transform)

chemreac.util.analysis.solver_linear_error(y, rtol, atol, logy=False, scale_err=1.0, expb=None)[source]

Returns linear estimated error bounds from numerical integration

Parameters
yarray_like

Output from integration (before back-transformation is applied)

rtolfloat

Relative tolerance

atolfloat

Absolute tolerance

logybool

Is y from a run with logarithmic concentration?

scale_errfloat

scale estimated error bounds (useful for testing)

expbcallback

exponential function in base b (e or 2 depending on use_log2)

Returns
Array of shape (2, len(y)) with rows corresponding to lower and
upper bounds around y.

Note

Assumes maximum mangitude of error be: \(\boldsymbol{e}_{max} = \|\boldsymbol{y} \cdot \mathrm{rtol}\| + \mathrm{atol}\) ..

chemreac.util.analysis.solver_linear_error_from_integration(integration, ti=slice(None, None, None), bi=0, si=0, **kwargs)[source]

Convenience function wrapping solver_linear_error()

Parameters
integration: Integration instance
chemreac.util.analysis.suggest_t0(rd, y0, max_f=1.0)[source]

Suggests an appropriate initial time, useful when logy==True and logt==True, If suggested t0 > 1, 1 is returned.

Parameters
rd: ReactionDiffusion instance

System at hand

y0: sequence

initial values

max_f: float

upper bound of absolute value for largest element in for the inital step.