pymloc.solvers.dynamical_systems.sensitivities¶
Classes
|
Subclass for case b) described in |
|
Subclass for case c) described in |
|
Subclass for case a) described in |
|
Baseclass for the inhomogeneity used in both – forward and adjoint – sensitivity computations. |
|
Baseclass for both Sensitivity solvers. |
-
class
pymloc.solvers.dynamical_systems.sensitivities.SensInhomProjection(*args, **kwargs)¶ Bases:
pymloc.solvers.dynamical_systems.sensitivities.SensitivitiesInhomogeneitySubclass for case b) described in
SensitivitiesSolverclass- Parameters
sensitivities (SensitivitiesSolver object blabla) –
localized_bvp (localized BoundaryValueProblem object) –
solution –
parameter –
-
capital_f_theta(t)¶
-
temp2_f_a_theta(capital_f_theta, tau)¶
-
class
pymloc.solvers.dynamical_systems.sensitivities.SensInhomProjectionNoSubset(*args, **kwargs)¶ Bases:
pymloc.solvers.dynamical_systems.sensitivities.SensInhomProjectionSubclass for case c) described in
SensitivitiesSolverclass- Parameters
sensitivities (SensitivitiesSolver object blabla) –
localized_bvp (localized BoundaryValueProblem object) –
solution –
parameter –
-
capital_f_theta(t)¶
-
f_a_theta(tau)¶
-
projector_cal_theta(tau)¶ - Parameters
tau (float) –
-
summand_2(tau)¶
-
class
pymloc.solvers.dynamical_systems.sensitivities.SensInhomWithTimeDerivative(sensitivities, localized_bvp, solution, parameter)¶ Bases:
pymloc.solvers.dynamical_systems.sensitivities.SensitivitiesInhomogeneitySubclass for case a) described in
SensitivitiesSolverclass- Parameters
sensitivities (SensitivitiesSolver object blabla) –
localized_bvp (localized BoundaryValueProblem object) –
solution (pymloc.solvers.base_solver.TimeSolution) –
parameter (numpy.ndarray) –
-
capital_f_theta(t)¶ - Parameters
t (float) –
-
capital_f_tilde(t)¶ Computes the quantity \(\tilde F^{(i)}\), where \(i\) depends on the chosen method.
- Parameters
t (float) –
-
class
pymloc.solvers.dynamical_systems.sensitivities.SensitivitiesInhomogeneity(sensitivities, localized_bvp, solution, parameter)¶ Bases:
abc.ABCBaseclass for the inhomogeneity used in both – forward and adjoint – sensitivity computations.
Concrete implementations depend on the chosen algorithm.
- Parameters
sensitivities (SensitivitiesSolver object blabla) –
localized_bvp (localized BoundaryValueProblem object) –
solution (pymloc.solvers.base_solver.TimeSolution) –
parameter (numpy.ndarray) –
-
_set_eplus_e_derivatives(parameter)¶ Sets several derivative functions wrt. parameters.
- Parameters
parameter (numpy.ndarray) –
-
a_dif(t)¶ Computes the derivative \(A_{\theta}(t)\).
- Parameters
t (float) –
- Return type
numpy.ndarray
-
abstract
capital_f_theta(t)¶ - Parameters
t (float) –
-
capital_f_tilde(t)¶ Computes the quantity \(\tilde F^{(i)}\), where \(i\) depends on the chosen method.
- Parameters
t (float) –
- Return type
numpy.ndarray
-
e_dif(t)¶ Computes the derivative \(E_{\theta}(t)\).
- Parameters
t (float) –
- Return type
numpy.ndarray
-
f_dif(t)¶ Computes the derivative \(f_{\theta}(t)\).
- Parameters
t (float) –
- Return type
numpy.ndarray
-
get_capital_fs()¶ Returns relevant functions for in the computation of the sensitivities
- Return type
Sequence[Callable[[float], numpy.ndarray]]
-
property
solution¶
-
x_d(t)¶ Computes the projected solution \(x_{\mathrm d}(t) = E^+E(t)\).
- Parameters
t (float) –
- Return type
numpy.ndarray
-
x_d_dot(t)¶ Computes the time derivative \(\dot{x}_{\mathrm d}(t)\).
- Parameters
t (float) –
- Return type
numpy.ndarray
-
x_dot(t)¶ Computes the time derivative \(\dot{x}(t)\).
- Parameters
t (float) –
- Return type
numpy.ndarray
-
class
pymloc.solvers.dynamical_systems.sensitivities.SensitivitiesSolver(bvp_param, *args, **kwargs)¶ Bases:
pymloc.solvers.base_solver.BaseSolver,abc.ABCBaseclass for both Sensitivity solvers. The Forward and the Adjoint solver.
- Parameters
bvp_param (pymloc.model.sensitivities.boundary_dae.BVPSensitivities) –
-
_capital_f_classes: Sequence[Type[pymloc.solvers.dynamical_systems.sensitivities.SensitivitiesInhomogeneity]] = (<class 'pymloc.solvers.dynamical_systems.sensitivities.SensInhomWithTimeDerivative'>, <class 'pymloc.solvers.dynamical_systems.sensitivities.SensInhomProjection'>, <class 'pymloc.solvers.dynamical_systems.sensitivities.SensInhomProjectionNoSubset'>)¶ Hard coded tuple of allowed subclasses
-
_get_capital_fs(*args, **kwargs)¶ Computes the capital_f_tilde quantity \(\tilde F^{(i)}\), that is used in the computation of both, forward and adjoint sensitivities. The concrete result depends on certain conditions.
Compute forward or adjoint sensitivities?
Regularity level
Time derivative of the algebraic variables exist
\((E^+E)_{\theta} E^+E = (E^+E)_{\theta}\)
is not fulfilled
The forward approach can only be used in case a) and b). The adjoint approach can be used in all cases. However, in the most general case c) additional derivatives of the original data are necessary Approach a) has the additional disadvantage that the product \(E_{\theta} \dot{x}\) may not be available directly from most DAE solvers.
-
property
bvp_param¶
-
property
capital_f_class¶
-
capital_f_default_class: Type[pymloc.solvers.dynamical_systems.sensitivities.SensitivitiesInhomogeneity]¶ attribute that must be defined in subclasses to determine the appropriate subclass of
SensitivitiesInhomogeneityfor the computation of \(\tilde F^{(i)}\).Available subclasses are listed in
_capital_f_classes.
-
property
dynamical_system¶