matscipy.optimize

Functions

ode12r(f, X0[, args, h, verbose, fmax, ...])

Adaptive ODE solver, which uses 1st and 2nd order approximations to estimate local error and choose a new step length.

matscipy.optimize.ode12r(f, X0, args=None, h=None, verbose=1, fmax=1e-06, maxtol=1000.0, steps=100, rtol=0.1, C1=0.01, C2=2.0, hmin=1e-10, extrapolate=3, callback=None, apply_precon=None, converged=None, residual=None)

Adaptive ODE solver, which uses 1st and 2nd order approximations to estimate local error and choose a new step length. The original implementation in ase.optimize.ode, and has been modified to this matscipy version to ensure compatibility with the NCFlex routines.

This optimizer is described in detail in:

S. Makri, C. Ortner and J. R. Kermode, J. Chem. Phys. 150, 094109 (2019) https://dx.doi.org/10.1063/1.5064465

Parameters:
  • f (function) – function returning driving force on system

  • X0 (1-dimensional array) – initial value of degrees of freedom

  • h (float) – step size, if None an estimate is used based on ODE12

  • verbose (int) – verbosity level. 0=no output, 1=log output (default), 2=debug output.

  • fmax (float) – convergence tolerance for residual force

  • maxtol (float) – terminate if reisdual exceeds this value

  • rtol (float) – relative tolerance

  • C1 (float) – sufficient contraction parameter

  • C2 (float) – residual growth control (Inf means there is no control)

  • hmin (float) – minimal allowed step size

  • extrapolate (int) – extrapolation style (3 seems the most robust)

  • callback (function) – optional callback function to call after each update step

  • apply_precon (function) – apply a apply_preconditioner to the optimisation

  • converged (function) – alternative function to check convergence, rather than using a simple norm of the forces.

  • residual (function) – compute the residual from the current forces

Returns:

X – final value of degrees of freedom

Return type:

array