use fsolve to find optimal reserve