The significant problem of compensator placement and sizing in electrical networks has been analyzed in the paper. The compensation is usually realized by means of passive or active power filters. The former solution is widely used mainly because of the economical reasons, but the latter one becomes more and more popular as the number of nonlinear loads increases. Regardless of the compensator type the most important goal consists in voltage and current distortion drop below levels imposed by standards. Nevertheless, the desired effects should be achieved with the minimum cost. So far a few objective functions have been proposed for this optimization problem. It is claimed that minimization of the compensator currents leads also to the minimum costs. This paper shows that such simplified approach could lead to suboptimal solutions and in fact a function g(·) reflecting the relation between the compensator size and its price must be incorporated into objective functions. Moreover, in this case it is very easy to compare solutions obtained using compensators offered by different suppliers - it is enough to change the function g(·). Theoretical considerations have been illustrated by an example of active power filter allocation and sizing.
 H. Akagi, “Modern active filters and traditional passive filters”, Bull. Pol. Ac.: Tech. 54 (3), 255-269 (2006).
 G. Benysek, M.P. Kaźmierkowski, J. Popczyk, and R. Strzelecki, “Power electronic systems as a crucial part of Smart Grid infrastructure - a survey”, Bull. Pol. Ac.: Tech. 59 (4), 455-473 (2011).
 G.W. Chang, S.-Y. Chu, and H.L. Wang, “A new method of passive harmonic filter planning for controlling voltage distortion in a power system”, IEEE Trans. on Power Delivery 21 (1), 305-312 (2006).
 R. Dehini and S. Sefiane, “Power quality and cost improvement by passive power filters synthesis using ant colony algorithm”, J. Theoretical and Applied Information Technology 23 (2), 70-79 (2011).
 G. Carpinelli, G. Ferruzzi, and A. Russo, “Trade-off analysis to solve a probabilistic multi-objective problem for passive filtering system planning”, Int. J. Emerging Electric Power Systems 14 (3), 275-284 (2013).
 N. He, D. Xu, and L. Huang, “The application of particle swarm optimization to passive and hybrid active power filter design”, IEEE Trans. on Industrial Electronics 56 (8), 2841-2851 (2009).
 Y.-Y. Hong and Y.-K. Chang, “Determination of locations and sizes for active power line conditioners to reduce harmonics in power systems”, IEEE Trans. on Power Delivery 11 (3), 1610-1617 (1996).
 R. Keypour, H. Seifi, and A. Yazdian-Varjani, “Genetic based algorithm for active power filter allocation and sizing”, Electric Power Systems Research 71, 41-49 (2004).
 D.F.U. Ramos, J. Cortes, H. Torres, L.E. Gallego, A. Delgadillo, and L. Buitrago, “Implementation of genetic algorithms in ATP for optimal allocation and sizing of active power line conditioners”, Proc. IEEE/PES Transmission & Distribution Conf. and Exposition 1, 1-5 (2006).
 N. Dehghani and I. Ziari, “Optimal allocation of APLCs using genetic algorithm”, Proc. 43rd Int. Universities Power Engineering Conference UPEC 1, 1-4 (2008).
 Wang Yan-Song, Shen Hua, Liu Xue-min, Liu Jun, Gou Songbo, “Optimal allocation of the active filters based on the TABU algorithm in distribution network”, Proc. Int. Conf. on Electrical and Control Engineering ICECE 1, 1418-1421 (2010).
 C.S. Gehrke, A.M.N. Lima, and A.C. Oliveira, “Evaluating APLCs placement in a power system based on real-time simulation”, 2012 IEEE Energy Conversion Congress and Exposition 2011, CD-ROM (2012).
 A. Moradifar and H.R. Soleymanpour, “A fuzzy based solution for allocation and sizing of multiple active power filters”, J. Power Electronics 12 (5), 830-841 (2012).
 I. Ziari and A. Jalilian, “A new approach for allocation and sizing of multiple active power-line conditioners”, IEEE Trans. on Power Delivery 25 (2), 1026-1035 (2010).
 I. Ziari and A. Jalilian, “Optimal placement and sizing of multiple APLCs using a modified discrete PSO”, Int. J. Electrical Power and Energy Systems 43 (1), 630-639 (2012).
 K. Kennedy, G. Lightbody, R. Yacamini, M. Murray, and J. Kennedy, “Online control of an APLC for network-wide harmonic reduction”, IEEE Trans. on Power Delivery 21 (1), 432-439 (2006).
 D. Grabowski, M. Maciążek, and M. Pasko, “Sizing of active power filters using some optimization strategies”, Int. J. for Computation and Mathematics in Electrical and Electronic Engineering COMPEL 32 (4), 1326-1336 (2013).
 C.S. Gehrke, A.M.N. Lima, and A.C. Oliveira, “Cooperative control for active power compensators allocated in distributed networks”, 2012 IEEE Energy Conversion Congress and Exposition 1, 2764 (2012).
 H. Yue, G. Li, M. Zhou, K. Wang, and J. Wang, “Multiobjective optimal power filter planning in distribution network based on fast nondominated sorting genetic algorithms”, DRPT 2011 - 2011 4th Int. Conf. on Electric Utility Deregulation and Restructuring and Power Technologies 1, 234 (2011).
 S.M.R. Rafiei, M.H. Kordi, G. Griva, and H. Yassami, “Multiobjective optimization based optimal compensation strategies study for power quality enhancement under distorted voltages”, IEEE Int. Symp. on Industrial Electronics 1, 3284 (2010).
 E. Gonz´alez-Romera, E. Romero-Cadaval, S. Ru´ız-Arranz, and M. Milan´es-Montero, “Overall power quality correction in distribution networks by active power filters. optimization of location and strategy”, Electrical Engineering Review 88 (1 A), 51-55 (2012).
 D. Grabowski and J. Walczak, “Strategies for optimal allocation and sizing of active power filters”, Proc. 11-th Int. Conf. on Environment and Electrical Engineering EEEIC 1, 1-4 (2012).
 K. Mikołajuk and M. Dzieciątko, “The Boltzmann machine - algorithm for combinatorial optimization problems”, Electrical Engineering Review 78 (12), 358-362 (2002).
 M. Maciążek, “Power theories applications to control active compensators”, Power Theories for Improved Power Quality, Springer Power Systems Series 1, 49-116 (2012).
 Task Force on Harmonics Modeling and Simulation, “Test systems for harmonics modeling and simulation”, IEEE Trans. on Power Delivery 14, 579-585 (1999).
 Task Force on Harmonics Modeling and Simulation, “The modeling and simulation of the propagation of harmonics in electric power networks. Part II: Sample systems and examples”, IEEE Trans. on Power Delivery 11 (1), 466-474 (1996).
 R. Christie, Power Systems Test Case Archive, http://www.ee.washington.edu/research/pstca/ (1993).
 IEEE Std 519-1992 IEEE Recommended Practices and Requirements for Harmonic Control in Electric Power Systems.
 D. Buła, D. Grabowski, M. Lewandowski, M. Maciążek, M. Pasko, A. Piwowar, and J. Walczak, Analysis and Optimization of Active Power Filter Allocation, The Publishing House of The Silesian University of Technology, Gliwice, 2013.
 M. Lewandowski, M. Maciążek, and D. Grabowski, “Integration of Matlab and PCFLO for harmonic flow analysis in a power system containing APF”, Proc. XXXIV Int. Conf. on Fundamentals of Electrotechnics and Circuit Theory ICSPETO 1, 89-90 (2011).