import torch


def double_integrator_dynamics(dtype=torch.float64):
    """
    The double integrator p̈ = u can be written as a linear system
    ẋ = Ax + Bu
    where x = [p, ṗ]. A = [0 1; 0 0], B = [0; 1]
    @return (A, B) A is a 2 x 2 matrix, B is a 2 x 1 vector.
    """
    return (torch.tensor([[0, 1], [0, 0]]).type(dtype=dtype),
            torch.tensor([[0], [1]]).type(dtype=dtype))