scimba_torch.physical_models.ode.abstract_ode¶
Module for abstract ODEs.
Functions
|
Function returning a zero right-hand side. |
Classes
|
Base class for representing Ordinary Differential Equations (ODEs). |
- zeros_rhs(w, t, mu, nb_func=1)[source]¶
Function returning a zero right-hand side.
- Parameters:
w (
MultiLabelTensor) – Solution tensor.t (
LabelTensor) – Temporal coordinates tensor.mu (
LabelTensor) – Parameter tensor.nb_func (
int) – Number of functions to return (default is 1).
- Return type:
Tensor- Returns:
A tensor of zeros with shape (number of points, nb_func).
- class AbstractODE(space, init, n_equations=1, rhs_func=None, **kwargs)[source]¶
Bases:
ABCBase class for representing Ordinary Differential Equations (ODEs).
- Parameters:
space (
AbstractApproxSpace) – Approximation space used for the ODEinit (
Callable) – Initial condition functionn_equations (
int) – Number of equations in the system (default is 1)rhs_func (
Optional[Callable]) – Right-hand side function of the ODE (default is zeros_rhs)**kwargs – Additional keyword arguments
- grad(w, y)[source]¶
Compute the gradient of the tensor w with respect to the tensor y.
- Parameters:
w (
Tensor|MultiLabelTensor) – Input tensory (
Tensor|LabelTensor) – Tensor with respect to which the gradient is computed
- Return type:
Tensor|tuple[Tensor,...]- Returns:
Gradient tensor
- rhs(w, t, mu)[source]¶
Compute the right-hand side (RHS) of the PDE.
- Parameters:
w (
MultiLabelTensor) – Solution tensort (
LabelTensor) – Temporal coordinate tensormu (
LabelTensor) – Parameter tensor
- Return type:
Tensor|tuple[Tensor,...]- Returns:
RHS tensor
- abstract time_operator(w, t, mu)[source]¶
Apply the PDE operator.
- Parameters:
w (
MultiLabelTensor) – Solution tensort (
LabelTensor) – Temporal coordinate tensormu (
LabelTensor) – Parameter tensor
- Return type:
Tensor|tuple[Tensor,...]- Returns:
Operator tensor
- operator(w, t, mu)[source]¶
Apply the PDE operator.
- Parameters:
w (
MultiLabelTensor) – Solution tensort (
LabelTensor) – Temporal coordinate tensormu (
LabelTensor) – Parameter tensor
- Return type:
Tensor|tuple[Tensor,...]- Returns:
Operator tensor
- initial_condition(mu)[source]¶
Compute the initial condition.
- Parameters:
mu (
LabelTensor) – Parameter tensor- Return type:
tuple[Tensor,...]- Returns:
Initial condition tensor
- functional_operator_ic(func, mu, theta)[source]¶
Compute the functional operator for initial conditions.
- Parameters:
func (
VarArgCallable) – Callable representing the functionmu (
Tensor) – Parameter tensortheta (
Tensor) – Additional parameters tensor
- Return type:
Tensor- Returns:
Functional operator tensor for initial conditions