function z=resvbar(eta,bar_u,mu,sigma)

global x_lbar;
global x_bar;


%computes the the value of v_bar at which contstraint (8) holds with
%equality.




startvalue=bar_u;

if firmpayoff(x_bar,eta,mu,sigma)>=bar_u %in this case constraint (8)
                                         %is always satisfied
    z=x_bar;
else
    [z,fval,exitflag] = fsolve(@(v_bar) firmpayoff(v_bar,eta,mu,sigma)-bar_u,startvalue);
end;
