The optimization method is used to modify some external forcing terms in the PBL model. By this way the output of the model is fitted with the observations, and wind fields in the PBL are produced. The gradients of the objective function with respect to the parameters are obtained through perturbation method. Furthermore, the reasonableness of this method is tested by using the model data and the observation in Lanzhou city.