backtracking.py

Line search using backtracking.

class openmdao.solvers.backtracking.BackTracking[source]

Bases: openmdao.solvers.solver_base.LineSearch

A line search subsolver using backtracking.

Options:

options[‘iprint’] : int(0)

Set to 0 to disable printing, set to 1 to print the residual to stdout each iteration, set to 2 to print subiteration residuals as well.

options[‘atol’] : float(1e-10)

Absolute convergence tolerancee for line search.

options[‘maxiter’] : int(10)

Maximum number of line searches.

options[‘rtol’] : float(0.9)

Relative convergence tolerancee for line search.

options[‘solve_subsystems’] : bool(True)

Set to True to solve subsystems. You may need this for solvers nested under Newton.

solve(params, unknowns, resids, system, solver, alpha, fnorm, fnorm0, metadata=None)[source]

Take the gradient calculated by the parent solver and figure out how far to go.

Args:

params : VecWrapper

VecWrapper containing parameters. (p)

unknowns : VecWrapper

VecWrapper containing outputs and states. (u)

resids : VecWrapper

VecWrapper containing residuals. (r)

system : System

Parent System object.

metadata : dict, optional

Dictionary containing execution metadata (e.g. iteration coordinate).

solver : Solver

Parent solver instance.

alpha : float

Initial over-relaxation factor as used in parent solver.

fnorm : float

Initial norm of the residual for absolute tolerance check.

fnorm0 : float

Initial norm of the residual for relative tolerance check.