Optimal Design and Operation for a droplet-based PCR chip