Dynamic wireless charging (DWC) technology enables the charging of electric vehicles (EVs) en route without the need for stopping on long-distance trips. Based on DWC technology, a dynamic wireless charging system (DWCS) concept is proposed to determine the number of DWC lanes and their locations and lengths considering varying battery charging rates. A two-stage approach is proposed to design the optimal DWCS. First, we propose a mixed-integer model with nonlinear constraints to determine the locations and lengths of the charging lanes. This model is further reformulated as a mixed-integer linear problem to make it suitable to solve with off-the-shelf commercial solvers (e.g., Gurobi). Next, we propose a method to obtain an approximately optimal solution for the number of lanes. Then, a numerical example from a freeway in Guangdong Province, China, is investigated to demonstrate the applicability of the proposed model and its effectiveness in reducing the construction costs.