PDSim.misc.solvers module

PDSim.misc.solvers.Broyden(f, x0, dx=1e-05, args=(), kwargs={}, ytol=1e-05, Nfd=1, J0=None, w=1.0, wJ=1.0, itermax=10, JustOneStep=False)[source]

Broyden’s method

If f returns None, then the computation is stopped, and a list the size of x0 is returned with all None values

Parameters:
  • f (function) –

    Must have a signature of the form:

    (x0,*args) --> array
    

    that returns an array-like object the same shape as x0

  • J0 (ndarray) – A square matrix that contains a first guess for the Jacobian
  • x0 (array-like) – Initial values for the solver
  • args (tuple) – Positional arguments to pass to the objective function
  • kwargs (dictionary) – Keyword arguments to pass to the objective function
  • ytol (float) – The allowed root-sum-square-error
  • itermax (int) – maximum number of iterations allowed
  • Nfd (int) – The number of finite difference steps to be used at the beginning
  • w (float) – relaxation factor
  • wJ (float) – relaxation factor for updating of Jacobian matrix
  • JustOneStep (boolean) – If True, stop after one step
PDSim.misc.solvers.MultiDimNewtRaph(f, x0, dx=1e-06, args=(), ytol=1e-05, w=1.0, JustOneStep=False)[source]

A Newton-Raphson solver where the Jacobian is always re-evaluated rather than re-using the information as in the fsolve method of scipy.optimize

PDSim.misc.solvers.newton(f, x0, dx=0.0001, args=(), kwargs={}, tol=1e-08, ytol=1e-08)[source]