otf.system.base
System abstractions for on-the-fly (OTF) data assimilation.
Classes to define systems of differential equations with which to use the on-the-fly (OTF) method of data assimilation. Based on the AOT method which "nudges" a data assimilated system toward an observed "ground truth" system, OTF in addition estimates the model governing the observed system.
Classes:
| Name | Description |
|---|---|
BaseSystem |
Base abstraction for a dynamical system used with OTF assimilation. |
System_ModelKnown |
System where the true ODE is known and can be simulated. |
System_ModelUnknown |
System where the true ODE is unknown and cannot be simulated. |
BaseSystem
BaseSystem(
mu: float,
cs: jndarray,
observed_mask: jndarray,
assimilated_ode: Callable[
[jndarray, jndarray], jndarray
],
complex_differentiation: bool = False,
)
Base abstraction for a dynamical system used with OTF assimilation.
This class wraps an ODE for an assimilated system together with nudging behavior that pushes the assimilated state toward observed portions of a (possibly partially observed) true state. Subclasses may provide a known true system or leave the true system unspecified.
Initialize the base system.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mu
|
float
|
Nudging parameter. |
required |
cs
|
jndarray
|
Estimated parameter values used by the assimilated system (may
differ from the true system parameters |
required |
observed_mask
|
jndarray
|
Boolean |
required |
assimilated_ode
|
Callable[[jndarray, jndarray], jndarray]
|
Callable |
required |
complex_differentiation
|
bool
|
If True, treat arrays as potentially complex for autodiff. |
False
|
Methods:
| Name | Description |
|---|---|
f_assimilated |
Return time derivative of the assimilated state with nudging. |
Source code in src/otf/system/base.py
f_assimilated
Return time derivative of the assimilated state with nudging.
The method applies assimilated_ode and then subtracts a nudging term
on observed entries: mu * (assimilated - true_observed).
This method is suitable for JIT compilation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cs
|
jndarray
|
Estimated parameter values for the assimilated ODE. |
required |
true_observed
|
jndarray
|
Observed portion of the true state (matches |
required |
assimilated
|
jndarray
|
Current assimilated (flattened) state. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Time derivative of |
Source code in src/otf/system/base.py
System_ModelKnown
System_ModelKnown(
mu: float,
gs: jndarray,
cs: jndarray,
observed_mask: jndarray,
assimilated_ode: Callable[
[jndarray, jndarray], jndarray
],
true_ode: Callable[[jndarray, jndarray], jndarray],
complex_differentiation: bool = False,
true_observed_mask: jndarray | None = None,
)
Bases: BaseSystem
System where the true ODE is known and can be simulated.
This subclass stores gs (true-system parameters) and a true_ode allowing
simultaneous integration of the true and assimilated systems.
Initialize a System_ModelKnown with a provided true ODE.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
See
|
|
required | |
gs
|
jndarray
|
True-system parameter values used by |
required |
true_ode
|
Callable[[jndarray, jndarray], jndarray]
|
Callable |
required |
true_observed_mask
|
jndarray | None
|
Boolean mask indicating observed entries of the true state. If
|
None
|
Methods:
| Name | Description |
|---|---|
f_true |
Return the time derivative of the true state using |
Source code in src/otf/system/base.py
f_true
Return the time derivative of the true state using true_ode.
This method is suitable for JIT compilation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
true
|
jndarray
|
Current true (flattened) state. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Time derivative of |
Source code in src/otf/system/base.py
System_ModelUnknown
System_ModelUnknown(
mu: float,
cs: jndarray,
observed_mask: jndarray,
assimilated_ode: Callable[
[jndarray, jndarray], jndarray
],
complex_differentiation: bool = False,
)
Bases: BaseSystem
System where the true ODE is unknown and cannot be simulated.
This subclass does not provide a true_ode or gs; it is suitable when
only an assimilated model is available and the true dynamics cannot be
integrated alongside the assimilated system.
See BaseSystem for shared behavior and API.