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

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

startvalue=bar_u;

[z,fval,exitflag] = fsolve(@(v_bar) firmpayoff(v_bar,eta,mu,sigma)-bar_u,startvalue);
