ClearAll["Global`*"];

n=3;
koeficientyNakladu={{100,0.1,0.01},{50,0.15,0.015},{150,0.08,0.006}};
minMaxVykony={{100,400},{50,200},{200,1000}};

fNaklady[vykon_,{a_,b_,c_}]:=a+b*vykon+c*(vykon^2);

vykony=(Subscript[P, #])&/@Range[n]
naklady=Plus@@MapThread[fNaklady,{vykony,koeficientyNakladu}]

fOmezeniVykonova[vykon_,{a_,b_}]:=a≤vykon≤b;
omezeniVykonova=MapThread[fOmezeniVykonova,{vykony,minMaxVykony}]

vykonCelkemZadany=500;
podminkaCelkovehoVykonu={vykonCelkemZadany==Plus@@vykony}

podminkyCelkem=Union[omezeniVykonova,podminkaCelkovehoVykonu]

NMinimize[Join[{naklady},podminkyCelkem],vykony]//Timing

strmost=3;
ClearAll[fPenale]
fPenale[x_,{a_,b_}]:=(2+(-Tanh[strmost*(x-a)]+Tanh[strmost*(x-b)]))*(((x-0.5*(a+b)))^2);

Plot[fPenale[x,{20,40}],{x,10,50},PlotRange->All,PlotStyle->Thick,AxesLabel->{"x","penale"}]

penaleCelkovyVykon=100*(((vykonCelkemZadany-Plus@@vykony))^2);
penaleVykonovaOmezeni=Plus@@MapThread[fPenale,{vykony,minMaxVykony}];

FminNeomezena=naklady+penaleCelkovyVykon+penaleVykonovaOmezeni

startHledani=minMaxVykony/.{a_,b_}:>((a+b)/2.)
zacatek=Thread[{vykony,startHledani}]
Quiet@FindMinimum[FminNeomezena,zacatek]//Timing