scimba_torch.physical_models.ode.rigid_body¶
Implementation of a rigid body ODE.
Classes
|
Implementation of a rigid body ODE. |
- class RigidBody(space, init, rhs_func=None, **kwargs)[source]¶
Bases:
AbstractODEImplementation of a rigid body ODE.
\[\begin{split}\frac{dx}{dt} = y z + f_x(t), \\ \frac{dy}{dt} = - x z + f_y(t), \\ \frac{dz}{dt} = x y + f_z(t), \\\end{split}\]with an initial condition given by the function init and a right-hand side given by the function rhs_func, giving the three components of the right-hand side \(f_x\), \(f_y\), and \(f_z\).
- Parameters:
space (
AbstractApproxSpace) – The approximation space for the probleminit (
Callable) – Callable for the initial conditionrhs_func (
Callable) – Callable for the right-hand side of the ODE (default is zeros_rhs)**kwargs – Additional keyword arguments
- static compute_eqs(dx_dt, dy_dt, dz_dt, x, y, z, i_x, i_y, i_z)[source]¶
Compute the equations of the rigid body ODE.
- Parameters:
dx_dt (
Tensor) – Time derivative of xdy_dt (
Tensor) – Time derivative of ydz_dt (
Tensor) – Time derivative of zx (
Tensor) – Variable xy (
Tensor) – Variable yz (
Tensor) – Variable zi_x (
Tensor) – Parameter i_xi_y (
Tensor) – Parameter i_yi_z (
Tensor) – Parameter i_z
- Return type:
tuple[Tensor,Tensor,Tensor]- Returns:
A tuple containing the equations for x, y, and z
- time_operator(w, t, mu)[source]¶
Apply the ODE operator.
- Parameters:
w (
MultiLabelTensor) – Solution tensort (
LabelTensor) – Temporal coordinate tensormu (
LabelTensor) – Parameter tensor
- Return type:
Tensor|tuple[Tensor,...]- Returns:
Operator tensor
- functional_operator(func, t, mu, theta)[source]¶
Compute the functional operator.
- Parameters:
func (
VarArgCallable) – Callable representing the functiont (
Tensor) – Temporal coordinate tensormu (
Tensor) – Parameter tensortheta (
Tensor) – Additional parameters tensor
- Return type:
Tensor- Returns:
Functional operator tensor