Cost calculation and analysis