-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bc318de
commit 6cf2d88
Showing
11 changed files
with
129 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ | |
*.swo | ||
*.eps | ||
*.png | ||
docs/build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,36 @@ | ||
# Clustering | ||
|
||
Text | ||
`run_clust()` takes the full `data` and gives a struct with the clustered data as the output. | ||
|
||
The input parameter `n_clust` determines the number of clusters,i.e., representative periods. | ||
|
||
## Supported clustering methods | ||
|
||
The following combinations of clustering method and representations are supported by `run_clust`: | ||
|
||
Name | method | representation | ||
---- | --------------- | ----------------------- | ||
k-means clustering | `<kmeans>` | `<centroid>` | ||
k-means clustering with medoid representation | `<kmeans>` | `<medoid>` | ||
k-medoids clustering (partitional) | `<kmedoids>` | `<centroid>` | ||
k-medoids clustering (exact) [requires Gurobi] | `<kmedoids_exact>` | `<centroid>` | ||
hierarchical clustering with centroid representation | `<hierarchical>` | `<centroid>` | ||
hierarchical clustering with medoid representation | `<hierarchical>` | `<medoid>` | ||
|
||
For use of DTW barycenter averaging (DBA) and k-shape clustering on single-attribute data (e.g. electricity prices), please use branch `v0.1-appl_energy-framework-comp`. | ||
|
||
```@docs | ||
run_clust | ||
``` | ||
|
||
### Example running clustering | ||
```@example | ||
using ClustForOpt | ||
state="GER_1" | ||
# laod ts-input-data | ||
ts_input_data, = load_timeseries_data("CEP", state; K=365, T=24) | ||
ts_clust_data = run_clust(ts_input_data).best_results | ||
using Plots | ||
plot(ts_clust_data.data["solar-germany"], legend=false, linestyle=:solid, width=3, xlabel="Time [h]", ylabel="Solar availability factor [%]") | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Load Data | ||
## Load Timeseries Data | ||
`load_timeseries_data()` loads the data for a given `application` and `region`. | ||
Possible applications are | ||
- `DAM`: Day ahead market price data | ||
- `CEP`: Capacity Expansion Problem data | ||
|
||
Possible regions are: | ||
- `GER`: Germany | ||
- `CA`: California | ||
- `TX`: Texas | ||
|
||
The optional input parameters to `load_timeseries_data()` are the number of periods `K` and the number of time steps per period `T`. By default, they are chosen such that they result in daily time slices. | ||
|
||
```@docs | ||
load_timeseries_data | ||
``` | ||
### Example loading timeseries data | ||
```@example | ||
using ClustForOpt | ||
state="GER_1" | ||
# laod ts-input-data | ||
ts_input_data, = load_timeseries_data("CEP", state; K=365, T=24) | ||
using Plots | ||
plot(ts_input_data.data["solar-germany"], legend=false, linestyle=:dot, xlabel="Time [h]", ylabel="Solar availability factor [%]") | ||
``` | ||
|
||
|
||
## Load CEP Data | ||
`load_cep_data()` lodes the extra data for the `CEP` and can take the following regions: | ||
- `GER`: Germany | ||
- `CA`: California | ||
- `TX`: Texas | ||
|
||
```@docs | ||
load_cep_data | ||
``` | ||
### Example loading CEP Data | ||
```@example | ||
using ClustForOpt | ||
state="GER_1" | ||
# laod ts-input-data | ||
cep_data = load_cep_data(state) | ||
cep_data.fix_costs | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Optimization | ||
The function `run_opt()` runs the optimization problem and gives as an output a struct that contains optimal objective function value, decision variables, and additional info. The `run_opt()` function infers the optimization problem type from the input data. See the example folder for further details. | ||
|
||
More detailed documentation on the [Capacity Expansion Problem](@ref) can be found in its documentation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
## Workflow | ||
|
||
Generally, the workflow requires three steps: | ||
- load data | ||
- clustering | ||
- optimization | ||
|
||
## CEP Specific Workflow | ||
The input data is distinguished between time series independent and time series dependent data. They are kept separate as just the time series dependent data is used to determine representative periods (clustering). | ||
![drawing](https://raw.githubusercontent.com/YoungFaithful/ClustForOpt_priv.jl/master/data/CEP/workflow.png?token=AKEm3UkwMa8SEmxWqWoqj8bR5Mm1J-0Nks5cbI0bwA%3D%3D) | ||
|
||
|
||
## Example Workflow | ||
```julia | ||
using ClustForOpt | ||
|
||
# load data (electricity price day ahead market) | ||
ts_input_data, = load_timeseries_data("DAM", "GER";K=365, T=24) #DAM | ||
|
||
# run standard kmeans clustering algorithm to cluster into 5 representative periods, with 1000 initial starting points | ||
clust_res = run_clust(ts_input_data;method="kmeans",representation="centroid",n_clust=5,n_init=1000) | ||
|
||
# battery operations optimization on the clustered data | ||
opt_res = run_opt(clust_res) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters