docs: def imitate_path(self, y_des):
          """Takes in a desired trajectory and generates the set of 
          system parameters that best realize this path.
      
          y_des list/array: the desired trajectories of each DMP
                            should be shaped [dmps, run_time]
          """
  
          # set initial state and goal
          if y_des.ndim == 1: 
              y_des = y_des.reshape(1,len(y_des))
          self.y0 = y_des[:,0].copy()
          self.y_des = y_des.copy()
          self.goal = self.gen_goal(y_des)
          
          self.check_offset()
  
          if not (self.timesteps == y_des.shape[1]):
              # generate function to interpolate the desired trajectory
              import scipy.interpolate
              path = np.zeros((self.dmps, self.timesteps))
              x = np.linspace(0, self.cs.run_time, y_des.shape[1])
              for d in range(self.dmps):
                  path_gen = scipy.interpolate.interp1d(x, y_des[d])
                  for t in range(self.timesteps):  
                      path[d, t] = path_gen(t * self.dt)
              y_des = path
  
          # calculate velocity of y_des
          dy_des = np.diff(y_des) / self.dt
          # add zero to the beginning of every row
          dy_des = np.hstack((np.zeros((self.dmps, 1)), dy_des))
  
          # calculate acceleration of y_des
          ddy_des = np.diff(dy_des) / self.dt
          # add zero to the beginning of every row
          ddy_des = np.hstack((np.zeros((self.dmps, 1)), ddy_des))
  
          f_target = np.zeros((y_des.shape[1], self.dmps))
          # find the force required to move along this trajectory
          for d in range(self.dmps):
              f_target[:,d] = ddy_des[d] - self.ay[d] * \
                              (self.by[d] * (self.goal[d] - y_des[d]) - \
                              dy_des[d])
  
          # efficiently generate weights to realize f_target
          self.gen_weights(f_target)
  
          '''# plot the basis function activations
          import matplotlib.pyplot as plt
          plt.figure()
          plt.subplot(211)
          plt.plot(psi_track)
          plt.title('psi_track')
  
          # plot the desired forcing function vs approx
          plt.subplot(212)
          plt.plot(f_target[:,0])
          plt.plot(np.sum(psi_track * self.w[0], axis=1))
          plt.legend(['f_target', 'w*psi'])
          plt.tight_layout()
          plt.show()'''
  
          self.reset_state()
          return y_des