input: Write a function to optimize the given objective function using the scipy.optimize.minimize method. The function should take an initial guess for the variables as input and return the optimized values of the variables. If the function is successfully minimized, return the optimized values; otherwise, return the initial guess values.
  
  from scipy.optimize import minimize 
  
  def obj_func(x):
      # objective function
      # ...
  
  def optimize(initial_guess): 
      res = minimize(obj_func, initial_guess, method='nelder-mead', options={'xtol': 1e-8, 'disp': True}) 
      return res.x
  
  assert list(optimize([0.0, 0.0, 0.0])) == [0.0, 0.0, 0.0]
  assert list(optimize([1.0, 2.0, 3.0])) == [1.0, 2.0, 3.0]
  assert list(optimize([-1.0, -2.0, -3.0])) == [-1.0, -2.0, -3.0]
  assert list(optimize([5.0, 5.0, 5.0])) == [5.0, 5.0, 5.0]
  assert list(optimize([0.0, 0.0, 0.0])) == [0.0, 0.0, 0.0]
output: def optimize(initial_guess): 
      res = minimize(obj_func, initial_guess, method='nelder-mead', options={'xtol': 1e-8, 'disp': True}) 
      if res.success:
          return res.x
      else:
          return initial_guess