Automatic optimization algorithms have been recently introduced as nonimaging optics design techniques. Unlike optimization of imaging systems, nonsequential ray tracing simulations and complex noncentered systems design must be considered, adding complexity to the problem. The merit function is a key element in the automatic optimization algorithm; nevertheless, the selection of each objective’s weight, {wi}{wi}, inside the merit function needs a prior trial and error process for each optimization. The problem then is to determine appropriate weights’ values for each objective. We propose a new dynamic merit function with variable weight factors {wi(n)}{wi(n)}. The proposed algorithm automatically adapts weight factors during the evolution of the optimization process. This dynamic merit function avoids the previous trial and error procedure by selecting the right merit function and provides better results than conventional merit functions.