No project description provided
Project description
Dynamic programming optimisation tool
This project implements the dynamic programming tool proposed in this paper and available in the R Software in the ConConPiWiFun package
Table of Contents
1. Installation
If you want to install the package from source, you can do
pip install git+https://github.com/robingirard/dynprogstorage#egg=dynprogstorage
Documentation
optimisation problem
This tool allows you to solve problems with the form
## min_x sum_i phi_i(x_i) phi_i : convex piecewise linear function
## P_i^-<= x_i <=P_i^+
## C_i^-<= x_0 + sum_j=0^i x_j <= C_i^+
Examples
Let us give a few examples of use
storage operation example
While participating in the market with a 100% efficiency storage you want to maximize the profit
## min_x sum_i Pi_i x_i ( phi_i linear function)
## -p_max <= x_i <=p_max
## 0<= x_0 + sum_j=0^i x_j <= c_max
## x_i>0 : consumption from the network
## x_i<0 : producing (injection to network)
### --> phi_i(x_i) is a buying cost we want to minimize
The code you need to use is :
## Definition of values
x_0=0
nbTime=250
Prices=random.uniform(1, 1000, nbTime)
p_max=1.
c_max=10.*p_max
## Generation of a vector of cost functions
cpl_func = GenCostFunctionFromMarketPrices(Prices.tolist())
cpl_func.vec_get(0).getBreakPoints() ## what does the first cost function look like
## now solve the optimisation problem
res = cpl_func.OptimMargInt([-p_max]*nbTime,[p_max]*nbTime,[-x_0]*nbTime,[c_max-x_0]*nbTime)
print(res)
## Visualisation of results (power) with prices
period=100
plt.plot(res[:100])
plt.plot(-(Prices[:100]-Prices.mean())/Prices.max())
plt.ylabel("Puissance (MW)")
plt.xlabel("Index")
plt.show()
## Visualisation of Energy evolution
energie=np.cumsum(res)
plt.plot(energie[:100], color='g')
plt.plot([0]*100, color='b')
plt.plot([c_max]*100, color='b')
plt.ylabel("Energie (MWh)")
plt.xlabel("Index")
plt.show()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dynprogstorage-0.1.9.tar.gz
(66.4 kB
view hashes)
Built Distributions
Close
Hashes for dynprogstorage-0.1.9-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65b4f35b2b30b3342f561d0136d986d243098cebad387f3653ad6a3cf814f9c1 |
|
MD5 | 2a7bd55360eed7a73435d238a9a133f4 |
|
BLAKE2b-256 | ebb7a9e1863b665618f8428ed0e1193bd793b0f837d49af7da600735c114747d |
Close
Hashes for dynprogstorage-0.1.9-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb180b365175208bbbdd84174bb308d78d5e635bdbae2c31c16a574a2439f610 |
|
MD5 | 89da2527c00f460f27bccd78fb3153d1 |
|
BLAKE2b-256 | 8e636efdd7994e4696378c65036b1e95a5bd7704c026f55db202165b5efea144 |