A new method for data assimilation is proposed using complex-variable differentiation (CVD), which can be used to estimate the initial conditions of the nonlinear physical system governed by the following equation:. Firstly, the gradient analysis of cost function in variational data assimilation is transformed into function numerical computation in complex domain, and the value of gradient is computed more efficiently and exactly. Secondly, the new algorithm of data assimilation is developed by combining an accurate gradient information from CVD with the classical optimization method. Finally, numerical simulations of typical chaotic systems and a humidity evolution equation with physical on-off process show that the new data assimilation method can reconstruct initial conditions of the nonlinear dynamical system very conveniently and accurately.