function cases = calculate_energy(cases, case_ids, controller_ids)
%Calculates the energy generated by each turbine

for iC = 1:length(case_ids)
for iiC = 1:length(controller_ids)
    cases.energy{case_ids(iC), controller_ids(iiC)} = ...
        cumsum(cases.power{case_ids(iC), controller_ids(iiC)}.*.5/3600);
end
end

end

