Carnot Battery Master thesis