broyden.py

Define the BroydenSolver class.

Based on implementation in Scipy via OpenMDAO 0.8x with improvements based on NPSS solver.

class openmdao.solvers.nonlinear.broyden.BroydenSolver(**kwargs)[source]

Bases: openmdao.solvers.solver.NonlinearSolver

Broyden solver.

Attributes

delta_fxm

(ndarray) Most recent change in residual vector.

delta_xm

(ndarray) Most recent change in state vector.

fxm

(ndarray) Most recent residual.

Gm

(ndarray) Most recent Jacobian matrix.

linear_solver

(LinearSolver) Linear solver to use for calculating inverse Jacobian.

linesearch

(NonlinearSolver) Line search algorithm. Default is None for no line search.

n

(int) Total length of the states being solved.

xm

(ndarray) Most recent state.

SOLVER = 'BROYDEN'
__init__(self, **kwargs)[source]

Initialize all attributes.

Parameters
**kwargsdict

options dictionary.

add_recorder(self, recorder)

Add a recorder to the solver’s RecordingManager.

Parameters
recorder<CaseRecorder>

A recorder instance to be added to RecManager.

cleanup(self)[source]

Clean up resources prior to exit.

get_residuals(self)[source]

Return a vector containing the values of the residuals specified in options.

Returns
ndarray

Array containing values of residuals.

get_states(self)[source]

Return a vector containing the values of the states specified in options.

This is used to get the initial state guesses.

Returns
ndarray

Array containing values of states.

record_iteration(self, **kwargs)

Record an iteration of the current Solver.

Parameters
**kwargsdict

Keyword arguments (used for abs and rel error).

set_linear_vector(self, dx)[source]

Copy values from step into the linear vector for backtracking.

Parameters
dxndarray

Full step in the states for this iteration.

set_states(self, new_val)[source]

Set new values for states specified in options.

Parameters
new_valndarray

New values for states.

solve(self)

Run the solver.