Design and optimization of nanowire betavoltaic generators