Optimizing capacity extensions in power systems: A case study of Bavaria and a comparison to Texas