brent.py#

Define the Brent class.

Based on implementation of the Brent algorithm in OpenMDAO 2.0 using brentq from scipy.

class openmdao.solvers.nonlinear.brent.BrentSolver(**kwargs)[source]

Bases: NonlinearSolver

Brent solver.

Root finding using Brent’s method. This is a specialized solver that can only converge a single scalar residual. You must specify the name of the implicit state-variable via the state_target option. You must specify lower_bound and upper_bound for the upper and lower.

Parameters:
**kwargsdict

Options dictionary.

Attributes:
state_targetstr

Relative openmdao varpath to the state.

upper_targetstr or None

Relative openmdao varpath to the upper bound. Only used if the lower bound is computed somewhere in the model.

lower_targetstr or None

Relative openmdao varpath to the lower bound. Only used if the lower bound is computed somewhere in the model.

normfloat

The current norm.

Methods

add_recorder(recorder)

Add a recorder to the solver's RecordingManager.

can_solve_cycle()

Return True if this solver can solve groups with cycles.

check_config(logger)

Perform optional error checks.

cleanup()

Clean up resources prior to exit.

get_outputs_dir(*subdirs[, mkdir])

Get the path under which all output files of this solver are to be placed.

get_reports_dir()

Get the path to the directory where the report files should go.

record_iteration(**kwargs)

Record an iteration of the current Solver.

report_failure(msg)

Report a failure that has occurred.

solve()

Run the solver.

use_relevance()

Return True if relevance should be active.

SOLVER = 'NL: BRENT'
__init__(**kwargs)[source]

Initialize all attributes.