The aim is to put forward the optimal selecting of weights in variational problemin which the linear advection equation is used as constraint. The selection of the functionalweight coefficients ( FWC) is one of the key problems for the relevant research. It wasarbitrary and subjective to some extent presently. To overcome this difficulty, thereasonable assumptions were given for the observation field and analyzed field, variationalproblems with " weak constraints" and " strong constraints" were considered separately. Bysolving Euler' s equation with the matrix theory and the finite difference method of partialdifferential equation, the objective weight coefficients were obtained in the minimumvariance of the difference between the analyzed field and ideal field. Deduction results showthat theoretically the optimal selection indeed exists in the weighting factors of the costfunction in the means of the minimal variance between the analysis and ideal field in terms ofthe matrix theory and partial differential ( corresponding difference ) equation, if thereasonable assumption from the actual problem is valid and the differnece equation is stable.It may realize the coordination among the weight factors, numerical models and theobservational data. With its theoretical basis as well as its prospects of applications, thisobjective selecting method is probably a way towards the finding of the optimal weightingfactors in the variational problem.