Git Product home page Git Product logo

reservoir-management's Introduction

Open in GitHub Codespaces Linux/Mac/Windows build status

Reservoir Management

Water reservoir levels must be carefully controlled to satisfy consumer demand while maintaining minimum water levels. To satisfy this demand and maintain at least a minimum level of water in the reservoir, pumps can be operated to provide water flow into the reservoir. To operate these pumps there is a cost, and we would like to choose which pumps to use throughout the day in order to minimize cost.

In this demo scenario, we have seven pumps that can be operated on 1-hour intervals throughout a 24-hour day.

Usage

To run the demo, type:

python demo.py

The demo outputs reservoir.html, a video of the reservoir water levels for a problem with seven pumps available, as shown below. This animation can be displayed in a web browser, or if using the Leap IDE by right-clicking on the file name and selecting "Open With" -> "Preview".

Example Solution

The command-line output displays which pumps are used in each time interval, using a 0 to indicate that the pump is off and a 1 to indicate that the pump is on. At the bottom of each time interval column is the water level at the time so that we may confirm that it is within the allowable ranges. Lastly, the total flow produced by the pumps over all time intervals and the total cost over all time intervals is displayed.

Problem Formulation

Objective

The general objective for this problem is to minimize cost. Cost is determined by which pumps are used in each time slot. To compute the cost for a given time slot, we must take into consideration the amount of power required for each pump in use as well as the cost of power at the given time. The cost per unit of power changes at different times of day, meaning that the cost to operate a pump also varies at different times of day. We can formulate this objective mathematically as:

min Σt Σp ct,p xt,p

where the summations are over time slots t and pumps p, and c(t,p) is the cost to operate pump p at time slot t.

Constraints

This problem consists of three groups of constraints.

  1. Each pump must be used at least once. This allows us to use pumps routinely so that they do not fall into disrepair. Mathematically, this constraint can be written as Σt xt,p ≥ 1, for each pump p.

  2. Each time slot must have at least one unused pump as a backup. Mathematically, this constraint can be written as Σp xt,p ≤ |P| - 1, for each time slot t.

  3. At each time slot, the water level must be within allowable levels. To more clearly represent this constraint mathematically, we introduce a placeholder variable vi that represents the reservoir water level at time i. For the first time slot, we define v1 = Σp fpx1,p + Vinit - d1, where fp is the flow of pump p, Vinit is the initial reservoir water level, and d1 is the consumer demand in time slot 1. For time slots after time slot 1, we define
    vi = Σp fpxi,p + vi-1 - di. At any given time slot t, we must enforce the constraint that Vmin ≤ vt ≤ Vmax.

For the full mathematical formulation of these constraints, please see the paper cited in the References section.

References

Kowalik, Przemysław, and Magdalena Rzemieniak. "Binary Linear Programming as a Tool of Cost Optimization for a Water Supply Operator." Sustainability 13.6 (2021): 3470.

reservoir-management's People

Contributors

vgoliber avatar randomir avatar hhtong avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.