In this paper, the problem of optimal placement of 5 virtual inertia is considered as a techno-economic problem from a 6 frequency stability point of view. First, a data driven-based equiv-7 alent model of battery energy storage systems, as seen from the 8 electrical system, is proposed. This experimentally validated model 9 takes advantage of the energy storage system special attributes to 10 contribute to inertial response enhancement, via the virtual inertia 11 concept. Then, a new framework is proposed, which considers the 12 battery storage system features, including annual costs, lifetime and 13 state of charge, into the optimal placement formulation to enhance 14 frequency response with a minimum storage capacity. Two well-15 known dynamical frequency criteria, the frequency nadir and the 16 rate of change of frequency, are utilized in the optimization formu-17 lation to determine minimum energy storage systems. Moreover, a 18 power angle-based stability index is also used to assess the effect 19 of virtual inertia on transient stability. Sensitivity and uncertainty 20 analyses are further conducted to assess the applicability of the 21 method. The efficiency of the proposed framework is demonstrated 22 on a linearized model of a three-area power system as well as two 23 nonlinear systems. Simulation results suggest that the proposed 24 method gives improved results in terms of stability measures and 25 less ESS capacity, when compared with other methods proposed in 26 the literature. Q1 27 Index Terms-Optimal placement, frequency nadir, virtual 28 inertia, energy storage systems, inertial response, rate of change 29 of frequency, transient stability, uncertainty analysis, sensitivity 30