parameters: (system, x0=None, t=None, n=None)
return_statement: return tout, yout
docstring: Step response of discrete-time system.
  
      Parameters
      ----------
      system : tuple of array_like
          A tuple describing the system.
          The following gives the number of elements in the tuple and
          the interpretation:
  
              * 1: (instance of `dlti`)
              * 3: (num, den, dt)
              * 4: (zeros, poles, gain, dt)
              * 5: (A, B, C, D, dt)
  
      x0 : array_like, optional
          Initial state-vector.  Defaults to zero.
      t : array_like, optional
          Time points.  Computed if not given.
      n : int, optional
          The number of time points to compute (if `t` is not given).
  
      Returns
      -------
      tout : ndarray
          Output time points, as a 1-D array.
      yout : tuple of ndarray
          Step response of system.  Each element of the tuple represents
          the output of the system based on a step response to each input.
  
      See Also
      --------
      step, dimpulse, dlsim, cont2discrete
docstring_summary: Step response of discrete-time system.
docstring_tokens: Step response of discrete - time system .
function: def dstep(system, x0=None, t=None, n=None):
      """
      Step response of discrete-time system.
  
      Parameters
      ----------
      system : tuple of array_like
          A tuple describing the system.
          The following gives the number of elements in the tuple and
          the interpretation:
  
              * 1: (instance of `dlti`)
              * 3: (num, den, dt)
              * 4: (zeros, poles, gain, dt)
              * 5: (A, B, C, D, dt)
  
      x0 : array_like, optional
          Initial state-vector.  Defaults to zero.
      t : array_like, optional
          Time points.  Computed if not given.
      n : int, optional
          The number of time points to compute (if `t` is not given).
  
      Returns
      -------
      tout : ndarray
          Output time points, as a 1-D array.
      yout : tuple of ndarray
          Step response of system.  Each element of the tuple represents
          the output of the system based on a step response to each input.
  
      See Also
      --------
      step, dimpulse, dlsim, cont2discrete
  
      """
      # Convert system to dlti-StateSpace
      if isinstance(system, dlti):
          system = system._as_ss()
      elif isinstance(system, lti):
          raise AttributeError('dstep can only be used with discrete-time dlti '
                               'systems.')
      else:
          system = dlti(*system[:-1], dt=system[-1])._as_ss()
  
      # Default to 100 samples if unspecified
      if n is None:
          n = 100
  
      # If time is not specified, use the number of samples
      # and system dt
      if t is None:
          t = np.linspace(0, n * system.dt, n, endpoint=False)
      else:
          t = np.asarray(t)
  
      # For each input, implement a step change
      yout = None
      for i in range(0, system.inputs):
          u = np.zeros((t.shape[0], system.inputs))
          u[:, i] = np.ones((t.shape[0],))
  
          one_output = dlsim(system, u, t=t, x0=x0)
  
          if yout is None:
              yout = (one_output[1],)
          else:
              yout = yout + (one_output[1],)
  
          tout = one_output[0]
  
      return tout, yout
function_tokens: def dstep ( system , x0 = None , t = None , n = None ) : # Convert system to dlti-StateSpace if isinstance ( system , dlti ) : system = system . _as_ss ( ) elif isinstance ( system , lti ) : raise AttributeError ( 'dstep can only be used with discrete-time dlti ' 'systems.' ) else : system = dlti ( * system [ : - 1 ] , dt = system [ - 1 ] ) . _as_ss ( ) # Default to 100 samples if unspecified if n is None : n = 100 # If time is not specified, use the number of samples # and system dt if t is None : t = np . linspace ( 0 , n * system . dt , n , endpoint = False ) else : t = np . asarray ( t ) # For each input, implement a step change yout = None for i in range ( 0 , system . inputs ) : u = np . zeros ( ( t . shape [ 0 ] , system . inputs ) ) u [ : , i ] = np . ones ( ( t . shape [ 0 ] , ) ) one_output = dlsim ( system , u , t = t , x0 = x0 ) if yout is None : yout = ( one_output [ 1 ] , ) else : yout = yout + ( one_output [ 1 ] , ) tout = one_output [ 0 ] return tout , yout