code: def eval_mean_error_functions(act,ang,n_vec,toy_aa,timeseries,withplot=False):
      
  
      Err = np.zeros(6)
      NT = len(timeseries)
      size = len(ang[6:])/3
      UA = ua(toy_aa.T[3:].T,np.ones(3))
      fig,axis=None,None
      if(withplot):
          fig,axis=plt.subplots(3,2)
          plt.subplots_adjust(wspace=0.3)
      for K in range(3):
          ErrJ = np.array([(i[K]-act[K]-2.*np.sum(n_vec.T[K]*act[3:]*np.cos(np.dot(n_vec,i[3:]))))**2 for i in toy_aa])
          Err[K] = np.sum(ErrJ)
          ErrT = np.array(((ang[K]+timeseries*ang[K+3]-UA.T[K]-2.*np.array([np.sum(ang[6+K*size:6+(K+1)*size]*np.sin(np.sum(n_vec*i,axis=1))) for i in toy_aa.T[3:].T])))**2)
          Err[K+3] = np.sum(ErrT)
          if(withplot):
              axis[K][0].plot(ErrJ,'.')
              axis[K][0].set_ylabel(r'$E$'+str(K+1))
              axis[K][1].plot(ErrT,'.')
              axis[K][1].set_ylabel(r'$F$'+str(K+1))
  
      if(withplot):
          for i in range(3):
              axis[i][0].set_xlabel(r'$t$')
              axis[i][1].set_xlabel(r'$t$')
          plt.show()
  
      EJ = np.sqrt(Err[:3]/NT)
      ET = np.sqrt(Err[3:]/NT)
  
      return np.array([EJ,ET])
docs: Calculates sqrt(mean(E)) and sqrt(mean(F))