In this paper, a modified cost function is proposed in order to achieve the maximum noise attenuation using a set of secondary sources for a harmonically excited sound field. The modified cost function drives the error signal to the optimally attenuated sound field instead of minimizing the squared pressure. Moreover, changing the value to which the error signals must be driven allows change of the control strategy from global to local. The modified cost function requires the knowledge of the attenuated sound field, which is a condition that is well suited to narrowband noises, as is the case of turboprops. A numerical example of the application of the cost function is carried out using a finite element model/boundary element model of a real turboprop, with the goal of minimizing the interior sound field in the cabin to about 17 m 3 . A maximum averaged attenuation of 7 dB at blade-passage frequencies is achieved using six secondary sources and six error sensors, and 11 dB around the head of a seated crew member if the control system is tuned to achieve local control. = acoustic pressure after minimizing the weighted potential energy p Ω = acoustic pressure inside the local volume p 0 = acoustic pressure after minimizing the potential energy q s = secondary source strength q sJ = secondary source strength to minimize the cost function q sΩ = secondary source strength to minimize the local potential energy q s0 = secondary source strength to minimize the potential energy q α0 = secondary source strength to minimize the weighted potential energy V = volume of the enclosure x = location of error sensors y = location of sources α = potential energy weighting factor ΔE p0 = attenuation loss ρ 0 = air density ϕ = phase of the acoustic pressure ψ = acoustic mode shape Ω = local volume ω = angular frequency ω n = eigenfrequency