approximation_scheme.py

Base class used to define the interface for derivative approximation schemes.

class openmdao.approximation_schemes.approximation_scheme.ApproximationScheme[source]

Bases: object

Base class used to define the interface for derivative approximation schemes.

__init__(self)[source]

Initialize the ApproximationScheme.

add_approximation(self, abs_key, system, kwargs)[source]

Use this approximation scheme to approximate the derivative d(of)/d(wrt).

Parameters
abs_keytuple(str,str)

Absolute name pairing of (of, wrt) for the derivative.

systemSystem

Containing System.

kwargsdict

Additional keyword arguments, to be interpreted by sub-classes.

compute_approximations(self, system, jac=None, total=False)[source]

Execute the system to compute the approximate (sub)-Jacobians.

Parameters
systemSystem

System on which the execution is run.

jacNone or dict-like

If None, update system with the approximated sub-Jacobians. Otherwise, store the approximations in the given dict-like object.

totalbool

If True total derivatives are being approximated, else partials.