Skip to content

Class AbstractODE

The class AbstractODE is an abstract class for ordinary differential equations (ODEs) of the form

\[ \dot{\mathbf{x}}(t) = \mathbf{f} (\mathbf{x}(t), \mathbf{u}). \]

Info

Since the rhs function must accommodate both fixed parameters and variable parameters, it should be capable of handling inputs of the form \(\mathbb{R}^{N \times N_x} \times \mathbb{R}^{1 \times N_u}\) (fixed parameters) and \(\mathbb{R}^{N \times N_x} \times \mathbb{R}^{N \times N_u}\) (variable parameters).

API Documentation

dim property

Returns the dimension of the system.

Returns:

Type Description
int

The dimension of the system.

param_dim property

Returns the dimension of the parameters.

Returns:

Type Description
int

The dimension of the parameters.

__init__(dim, param_dim, rhs)

Initializes the ODE class with the given dimensions and right-hand side function.

Parameters:

Name Type Description Default
dim int

The dimension of the system.

required
param_dim int

The dimension of the parameter space.

required
rhs torch.Tensor -> torch.Tensor

The right-hand side function of the ODE, which defines the system dynamics.

required

rhs(x, u)

Compute the right-hand side of the differential equation.

Parameters:

Name Type Description Default
x Tensor

The state tensor.

required
u Tensor

The parametric input tensor.

required

Returns:

Type Description
Tensor

The computed right-hand side of the differential equation.