Sensitivity Computation¶
Sensitivity matrix computation utilities for parameter estimation and consider covariance analysis.
Overview¶
Brahe provides both analytical and numerical sensitivity computation through a unified interface. Sensitivity matrices describe how a function's output changes with respect to consider parameters (\(\partial f/\partial p\)), which is essential for orbit determination with consider parameters and covariance analysis.
NumericalSensitivity ¶
NumericalSensitivity(dynamics_fn: Any)
Numerical sensitivity provider for dynamic-sized systems using finite differences.
Computes the sensitivity matrix ∂f/∂p numerically by perturbing the parameters and evaluating the dynamics function.
Example
Initialize instance.
backward builtin ¶
backward(dynamics_fn: callable) -> NumericalSensitivity
Create with backward finite differences.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dynamics_fn | callable | Function with signature (t: float, state: ndarray, params: ndarray) -> ndarray | required |
Returns:
| Name | Type | Description |
|---|---|---|
NumericalSensitivity | NumericalSensitivity | Sensitivity provider using backward differences |
central builtin ¶
central(dynamics_fn: callable) -> NumericalSensitivity
Create with central finite differences.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dynamics_fn | callable | Function with signature (t: float, state: ndarray, params: ndarray) -> ndarray | required |
Returns:
| Name | Type | Description |
|---|---|---|
NumericalSensitivity | NumericalSensitivity | Sensitivity provider using central differences |
compute method descriptor ¶
Compute the sensitivity matrix at the given time, state, and parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t | float | Current time | required |
state | ndarray | State vector at time t | required |
params | ndarray | Consider parameters | required |
Returns:
| Name | Type | Description |
|---|---|---|
ndarray | ndarray | Sensitivity matrix ∂f/∂p (state_dim × param_dim) |
forward builtin ¶
forward(dynamics_fn: callable) -> NumericalSensitivity
Create with forward finite differences.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dynamics_fn | callable | Function with signature (t: float, state: ndarray, params: ndarray) -> ndarray | required |
Returns:
| Name | Type | Description |
|---|---|---|
NumericalSensitivity | NumericalSensitivity | Sensitivity provider using forward differences |
with_adaptive method descriptor ¶
with_adaptive(scale_factor: float, min_value: float) -> NumericalSensitivity
Set adaptive perturbation with custom parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scale_factor | float | Multiplier on sqrt(ε), typically 1.0 | required |
min_value | float | Minimum reference value | required |
Returns:
| Name | Type | Description |
|---|---|---|
NumericalSensitivity | NumericalSensitivity | Self for method chaining |
with_fixed_offset method descriptor ¶
with_fixed_offset(offset: float) -> NumericalSensitivity
Set fixed absolute perturbation for all parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
offset | float | Fixed perturbation size | required |
Returns:
| Name | Type | Description |
|---|---|---|
NumericalSensitivity | NumericalSensitivity | Self for method chaining |
with_method method descriptor ¶
with_method(method: DifferenceMethod) -> NumericalSensitivity
Set the difference method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
method | DifferenceMethod | Finite difference method to use | required |
Returns:
| Name | Type | Description |
|---|---|---|
NumericalSensitivity | NumericalSensitivity | Self for method chaining |
with_percentage method descriptor ¶
with_percentage(percentage: float) -> NumericalSensitivity
Set percentage-based perturbation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
percentage | float | Percentage of parameter value (e.g., 1e-6 for 0.0001%) | required |
Returns:
| Name | Type | Description |
|---|---|---|
NumericalSensitivity | NumericalSensitivity | Self for method chaining |
AnalyticSensitivity ¶
AnalyticSensitivity(sensitivity_fn: Any)
Analytical sensitivity provider for dynamic-sized systems.
Uses a user-provided function that directly computes the analytical sensitivity matrix.
Example
Initialize instance.
compute method descriptor ¶
Compute the sensitivity matrix at the given time, state, and parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t | float | Current time | required |
state | ndarray | State vector at time t | required |
params | ndarray | Consider parameters | required |
Returns:
| Name | Type | Description |
|---|---|---|
ndarray | ndarray | Sensitivity matrix ∂f/∂p (state_dim × param_dim) |
See Also¶
- Sensitivity Matrix Guide - Detailed usage examples and theory
- Jacobian Computation - Related Jacobian computation utilities
- Mathematics Module - Mathematics module overview