TransportMaps.Maps.ODEs.DiscretizedODEsMaps
¶
Module Contents¶
Classes¶
Defines the map of discretized system of autonomous ODEs. |
|
Defines the map of a forward Euler discretized system of autonomous ODEs. |
- class TransportMaps.Maps.ODEs.DiscretizedODEsMaps.DiscretizedAutonomousODEsMap(dt, rhs)[source]¶
Bases:
TransportMaps.Maps.Map
Defines the map of discretized system of autonomous ODEs.
Evaluates the map
\[{\bf u}_n \mapsto {\bf u}_{n+1}\]that takes the state \({\bf u}_n\) at time \(t\) into the state \({\bf u}_{n+1}\) at time \(t+\Delta t\), thorugh the discretization of the ODE
\[\dot{\bf u} = f({\bf u}) \;.\]- __init__(dt, rhs)[source]¶
- Parameters:
dt (float) – time step \(\Delta t\)
rhs (
Map
) – the \(d\) dimensional map \(f\).
- abstract evaluate(u, *args, **kwargs)[source]¶
[Abstract] Evaluate the map \(T\) at the points \({\bf x} \in \mathbb{R}^{m \times d_x}\).
- Parameters:
- Returns:
(
ndarray
[\(m,d_y\)]) – transformed points- Raises:
NotImplementedError – to be implemented in sub-classes
- abstract grad_x(u, *args, **kwargs)[source]¶
[Abstract] Evaluate the gradient \(\nabla_{\bf x}T\) at the points \({\bf x} \in \mathbb{R}^{m \times d_x}\).
- Parameters:
- Returns:
(
ndarray
[\(m,d_y,d_x\)]) – transformed points- Raises:
NotImplementedError – to be implemented in sub-classes
- abstract tuple_grad_x(u, *args, **kwargs)[source]¶
[Abstract] Evaluate the function and gradient.
- Parameters:
- Returns:
(
tuple
) – function and gradient evaluation- Raises:
NotImplementedError – to be implemented in sub-classes
- abstract hess_x(u, *args, **kwargs)[source]¶
[Abstract] Evaluate the Hessian \(\nabla^2_{\bf x}T\) at the points \({\bf x} \in \mathbb{R}^{m \times d_x}\).
- Parameters:
- Returns:
(
ndarray
[\(m,d_y,d_x,d_x\)]) – transformed points- Raises:
NotImplementedError – to be implemented in sub-classes
- abstract action_hess_x(u, du, *args, **kwargs)[source]¶
[Abstract] Evaluate the action of the Hessian \(\langle\nabla^2_{\bf x}T,\delta{\bf x}\rangle\) at the points \({\bf x} \in \mathbb{R}^{m \times d_x}\).
- Parameters:
x (
ndarray
[\(m,d_x\)]) – evaluation pointsdx (
ndarray
[\(m,d_x\)]) – direction on which to evaluate the Hessianprecomp (
dict
) – dictionary of precomputed valuesidxs_slice (slice) – if precomputed values are present, this parameter indicates at which of the points to evaluate. The number of indices represented by
idxs_slice
must matchx.shape[0]
.
- Returns:
(
ndarray
[\(m,d_y,d_x\)]) – transformed points- Raises:
NotImplementedError – to be implemented in sub-classes
- class TransportMaps.Maps.ODEs.DiscretizedODEsMaps.AutonomousForwardEulerMap(dt, rhs)[source]¶
Bases:
DiscretizedAutonomousODEsMap
Defines the map of a forward Euler discretized system of autonomous ODEs.
Evaluates the Euler step:
\[{\bf u}_{n+1} = {\bf u}_n + \Delta t \cdot f({\bf u}_n)\]where \(f:\mathbb{R}^d \rightarrow \mathbb{R}^d\) is the right hand side of the ODE system.
- __init__(dt, rhs)[source]¶
- Parameters:
dt (float) – time step \(\Delta t\)
rhs (
Map
) – the \(d\) dimensional map \(f\).
- evaluate(u, *args, **kwargs)[source]¶
[Abstract] Evaluate the map \(T\) at the points \({\bf x} \in \mathbb{R}^{m \times d_x}\).
- Parameters:
- Returns:
(
ndarray
[\(m,d_y\)]) – transformed points- Raises:
NotImplementedError – to be implemented in sub-classes
- grad_x(u, *args, **kwargs)[source]¶
[Abstract] Evaluate the gradient \(\nabla_{\bf x}T\) at the points \({\bf x} \in \mathbb{R}^{m \times d_x}\).
- Parameters:
- Returns:
(
ndarray
[\(m,d_y,d_x\)]) – transformed points- Raises:
NotImplementedError – to be implemented in sub-classes
- tuple_grad_x(u, *args, **kwargs)[source]¶
[Abstract] Evaluate the function and gradient.
- Parameters:
- Returns:
(
tuple
) – function and gradient evaluation- Raises:
NotImplementedError – to be implemented in sub-classes
- hess_x(u, *args, **kwargs)[source]¶
[Abstract] Evaluate the Hessian \(\nabla^2_{\bf x}T\) at the points \({\bf x} \in \mathbb{R}^{m \times d_x}\).
- Parameters:
- Returns:
(
ndarray
[\(m,d_y,d_x,d_x\)]) – transformed points- Raises:
NotImplementedError – to be implemented in sub-classes
- action_hess_x(u, du, *args, **kwargs)[source]¶
[Abstract] Evaluate the action of the Hessian \(\langle\nabla^2_{\bf x}T,\delta{\bf x}\rangle\) at the points \({\bf x} \in \mathbb{R}^{m \times d_x}\).
- Parameters:
x (
ndarray
[\(m,d_x\)]) – evaluation pointsdx (
ndarray
[\(m,d_x\)]) – direction on which to evaluate the Hessianprecomp (
dict
) – dictionary of precomputed valuesidxs_slice (slice) – if precomputed values are present, this parameter indicates at which of the points to evaluate. The number of indices represented by
idxs_slice
must matchx.shape[0]
.
- Returns:
(
ndarray
[\(m,d_y,d_x\)]) – transformed points- Raises:
NotImplementedError – to be implemented in sub-classes