Source code for scimba_torch.physical_models.ode.simple_ode
"""Implementation of a simple 1D ODE."""fromtypingimportCallable,castimporttorchfromscimba_torch.approximation_space.abstract_spaceimportAbstractApproxSpacefromscimba_torch.physical_models.ode.abstract_odeimportAbstractODEfromscimba_torch.utils.scimba_tensorsimportLabelTensor,MultiLabelTensorfromscimba_torch.utils.typing_protocolsimportVarArgCallable
[docs]classSimpleODE(AbstractODE):r"""Implementation of a 1D simple ODE. .. math:: \frac{du}{dt} = \\mu u, \\quad t \\in (0, T), with an initial condition given by the function `init`. Args: space: The approximation space for the problem init: Callable for the initial condition **kwargs: Additional keyword arguments """def__init__(self,space:AbstractApproxSpace,init:Callable,**kwargs,):super().__init__(space,init=init,n_equations=1,**kwargs)