EC-ENGINE

Energy consumption simulator and optimizer


Project Overview

  • Project Name : EC-ENGINE
  • Version : v1.0
  • Last Modified : 10.09.2024

Thank you for taking the time to visit the EC-ENGINE project! The Energy Consumption Engine project is focused on simulating the operation of production machines and measuring their power consumption over time based on a predefined machine operation schedule.

This object-oriented simulator allows users to activate any number of defined machines and simulate their energy consumption over time. The simulator takes into account environmental factors such as temperature and enables the definition of objects like fans, which start operating once a defined temperature threshold is reached.

The engine was developed with the goal of optimizing the difference in energy consumption between the average daytime and nighttime usage.


Simulation Engine

The simulator allows users to define devices such as machines or office equipment and set their operation times according to a planned schedule. This enables the simulation of energy consumption over the course of a single day or multiple days, depending on the simulation's requirements.

The simulation runs in real time using Matplotlib animation, and it aggregates the results by calculating the average energy consumption during the day and night. Additionally, the simulator computes the percentage difference between average daytime and nighttime consumption, which serves as the optimization target in this project.


Schedule Optimization

Running a simulation for a specific machine schedule provides insight into whether the schedule is efficient or not. To automate this process, an algorithm was developed to search through the space of possible machine operation schedules and find the one with the smallest objective function value, which is the difference in average energy consumption between day and night.

The optimizer takes a constraint dictionary as input, which defines when each machine is allowed to operate by specifying the hours it can run and the minimum number of shifts required.

This constraint dictionary generates the space of all possible machine operation schedules that meet the defined constraints. The optimization algorithm treats random chunk of this space as an initial population, using a genetic algorithm to find the schedule with the lowest objective function value. The genetic algorithm ensures that successive populations, through crossover and mutation, continue to meet the constraints defined in the dictionary. This is crucial for ensuring that the final schedule adheres to all operational restrictions. As a result of the optimization algorithm, the system produces a schedule with the smallest possible objective function value.



Analysis of the Schedule Neighborhood

As a side analysis, I explored the neighborhood of the optimized schedules that exhibited the smallest objective function values. The goal was to determine whether similar or potentially better schedules could be found in the vicinity and to visualize this neighborhood.

Since the schedules were represented as n x n matrices, it was not possible to define two variables that would generate a bijective mapping of these schedules onto a two-dimensional space for visualization. Therefore, I utilized Hamming distance to visualize the neighborhood in the form of rings, with the optimized schedule at the center. Similar schedules were positioned on rings, with the radius of each ring corresponding to the Hamming distance between the optimized schedule and its neighbors. Additionally, I visualized the neighborhood in three-dimensional space for deeper analysis.


Real-World Application and Results

We aimed to reduce the difference between average energy consumption during the day and night to less than 15%, as additional electricity fees were tied to this percentage difference. Therefore, it was crucial to minimize this difference, which was achieved through the optimization algorithm.

We observed that the existing machine scheduling methods were generating significant discrepancies. The optimization algorithm allowed us to discover a more efficient scheduling method to minimize this difference as much as possible.

After several months of monitoring the implemented changes, we successfully reduced the day-night energy consumption difference to an average of below 5%, which resulted in significant reductions in energy costs. This led to savings of approximately 20,000 PLN per month.