linear_system.py

A component that solves a linear system.

class openmdao.components.linear_system.LinearSystem(size)[source]

Bases: openmdao.core.component.Component

A component that solves a linear system Ax=b where A and b are params and x is a state.

Options:

deriv_options[‘type’] : str(‘user’)

Derivative calculation type (‘user’, ‘fd’, ‘cs’) Default is ‘user’, where derivative is calculated from user-supplied derivatives. Set to ‘fd’ to finite difference this system. Set to ‘cs’ to perform the complex step if your components support it.

deriv_options[‘form’] : str(‘forward’)

Finite difference mode. (forward, backward, central)

deriv_options[‘step_size’] : float(1e-06)

Default finite difference stepsize

deriv_options[‘step_calc’] : str(‘absolute’)

Set to absolute, relative

deriv_options[‘check_type’] : str(‘fd’)

Type of derivative check for check_partial_derivatives. Set to ‘fd’ to finite difference this system. Set to ‘cs’ to perform the complex step method if your components support it.

deriv_options[‘check_form’] : str(‘forward’)

Finite difference mode: (“forward”, “backward”, “central”) During check_partial_derivatives, the difference form that is used for the check.

deriv_options[‘check_step_calc’] : str(‘absolute’,)

Set to ‘absolute’ or ‘relative’. Default finite difference step calculation for the finite difference check in check_partial_derivatives.

deriv_options[‘check_step_size’] : float(1e-06)

Default finite difference stepsize for the finite difference check in check_partial_derivatives”

deriv_options[‘linearize’] : bool(False)

Set to True if you want linearize to be called even though you are using FD.

apply_linear(params, unknowns, dparams, dunknowns, dresids, mode)[source]

Apply the derivative of state variable with respect to everything.

apply_nonlinear(params, unknowns, resids)[source]

Evaluating residual for given state.

solve_linear(dumat, drmat, vois, mode=None)[source]

LU backsubstitution to solve the derivatives of the linear system.

solve_nonlinear(params, unknowns, resids)[source]

Use numpy to solve Ax=b for x.