def _check_u_and_t_for_simulation(m, dt, u, t, isdiscrete):
    '\n    Helper function to validate the input arguments for simulate_linear_system\n    '
    if (t is None):
        if (not isdiscrete):
            raise ValueError('Continuous time models need an evenly spaced time sequence from which the sampling period will be obtained.')
        else:
            u_samples = len(u)
            t = np.linspace(0, ((u_samples - 1) * dt), num=u_samples)
    else:
        t = np.asarray(t, dtype=float).squeeze()
        if (t.ndim != 1):
            raise ValueError('Time array needs to be a 1D array.')
        t_diff = np.diff(t)
        if ((not np.allclose(t_diff, t_diff[0])) or (not (t_diff[0] > 0.0))):
            raise ValueError('Time array should be equally spaced and increasing.')
        if (isdiscrete and (not np.isclose(dt, t_diff[0]))):
            raise ValueError('Time array increment {} is not equal to the model sampling period {}.'.format(t_diff[0], dt))
    if (u.size < 1):
        raise ValueError('The input array should at least have one point.')
    if (len(u) != len(t)):
        raise ValueError('The input and time arrays should have the same length. t: {} vs. u: {}'.format(t.shape, u.shape))
    if (u.shape[1] != m):
        raise ValueError("Number of input columns ({}) don't match the number of inputs ({}) of the given model.".format(u.shape[1], m))
    return t
Helper function to validate the input arguments for simulate_linear_system
def _check_u_and_t_for_simulation(m, dt, u, t, isdiscrete):
    '\n    \n    '
    if (t is None):
        if (not isdiscrete):
            raise ValueError('Continuous time models need an evenly spaced time sequence from which the sampling period will be obtained.')
        else:
            u_samples = len(u)
            t = np.linspace(0, ((u_samples - 1) * dt), num=u_samples)
    else:
        t = np.asarray(t, dtype=float).squeeze()
        if (t.ndim != 1):
            raise ValueError('Time array needs to be a 1D array.')
        t_diff = np.diff(t)
        if ((not np.allclose(t_diff, t_diff[0])) or (not (t_diff[0] > 0.0))):
            raise ValueError('Time array should be equally spaced and increasing.')
        if (isdiscrete and (not np.isclose(dt, t_diff[0]))):
            raise ValueError('Time array increment {} is not equal to the model sampling period {}.'.format(t_diff[0], dt))
    if (u.size < 1):
        raise ValueError('The input array should at least have one point.')
    if (len(u) != len(t)):
        raise ValueError('The input and time arrays should have the same length. t: {} vs. u: {}'.format(t.shape, u.shape))
    if (u.shape[1] != m):
        raise ValueError("Number of input columns ({}) don't match the number of inputs ({}) of the given model.".format(u.shape[1], m))
    return t