Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial setup for GenX #4

Merged
merged 2 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Manifest.toml
GenX/cases/*/results*
GenX/**/TDR_results*
instances/*.mps.gz
7 changes: 7 additions & 0 deletions GenX/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[deps]
GenX = "5d317b1e-30ec-4ed6-a8ce-8d2d88d7cfac"
HiGHS = "87dc4568-4c63-4d18-b0c0-bb2238e4078b"
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"

[compat]
GenX = "=0.4.1"
18 changes: 18 additions & 0 deletions GenX/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# GenX

GenX is a configurable power system capacity expansion model.

More details are available at [https://genx.mit.edu](https://genx.mit.edu)

Documentation is available at [genxproject.github.io/GenX.jl/](genxproject.github.io/GenX.jl/)

The GitHub repository is [GenXProject/GenX.jl](https://github.com/GenXProject/GenX.jl)

## License

GenX is licensed under the [GPL v2 license](https://github.com/GenXProject/GenX.jl/blob/v0.4.1/LICENSE).

## Structure

The example cases in this directory are taken from
[https://github.com/GenXProject/GenX.jl/tree/v0.4.1/example_systems](https://github.com/GenXProject/GenX.jl/tree/v0.4.1/example_systems).
4 changes: 4 additions & 0 deletions GenX/cases/10_IEEE_9_bus_DC_OPF/resources/Thermal.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Resource,Zone,Model,New_Build,Can_Retire,Existing_Cap_MW,Min_Cap_MW,Max_Cap_MW,Inv_Cost_per_MWyr,Fixed_OM_Cost_per_MWyr,Var_OM_Cost_per_MWh,Start_Cost_per_MW,Start_Fuel_MMBTU_per_MW,Cap_Size,Heat_Rate_MMBTU_per_MWh,Fuel,Min_Power,Ramp_Up_Percentage,Ramp_Dn_Percentage,Up_Time,Down_Time,Reg_Max,Rsv_Max,Reg_Cost,Rsv_Cost,MGA,Resource_Type,region,cluster
z1_natural_gas,1,1,0,1,250,10,0,0,5,0.1,0,0,250,0.1,natural_gas,0.04,1,1,0,0,1,1,0,0,1,natural_gas,BUS1,1
z2_natural_gas,2,1,0,1,300,10,0,0,1.2,0.1,0,0,300,0.1,natural_gas,0.033333333,1,1,0,0,1,1,0,0,1,natural_gas,BUS2,1
z3_natural_gas,3,1,0,1,270,10,0,0,1,0.1,0,0,270,0.1,natural_gas,0.037037037,1,1,0,0,1,1,0,0,1,natural_gas,BUS3,1
11 changes: 11 additions & 0 deletions GenX/cases/10_IEEE_9_bus_DC_OPF/settings/genx_settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
NetworkExpansion: 0 # Transmission network expansionl; 0 = not active; 1 = active systemwide
Trans_Loss_Segments: 0 # Number of segments used in piecewise linear approximation of transmission losses; 1 = linear, >2 = piecewise quadratic
EnergyShareRequirement: 0 # Minimum qualifying renewables penetration; 0 = not active; 1 = active systemwide
CapacityReserveMargin: 0 # Number of capacity reserve margin constraints; 0 = not active; 1 = active systemwide
CO2Cap: 0 # CO2 emissions cap; 0 = not active (no CO2 emission limit); 1 = mass-based emission limit constraint; 2 = load + rate-based emission limit constraint; 3 = generation + rate-based emission limit constraint
StorageLosses: 0 # Energy Share Requirement and CO2 constraints account for energy lost; 0 = not active (DO NOT account for energy lost); 1 = active systemwide (DO account for energy lost)
MinCapReq: 0 # Activate minimum technology carveout constraints; 0 = not active; 1 = active
MaxCapReq: 0 # Activate maximum technology carveout constraints; 0 = not active; 1 = active
WriteShadowPrices: 1 # Write shadow prices of LP or relaxed MILP; 0 = not active; 1 = active
DC_OPF: 1 #Flag for running DC-OPF: 0 = not active (transport model); 1 = active
WriteOutputs: "annual"
11 changes: 11 additions & 0 deletions GenX/cases/10_IEEE_9_bus_DC_OPF/settings/highs_settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# HiGHS Solver Parameters
# Common solver settings
Feasib_Tol: 1.0e-05 # Primal feasibility tolerance # [type: double, advanced: false, range: [1e-10, inf], default: 1e-07]
Optimal_Tol: 1.0e-05 # Dual feasibility tolerance # [type: double, advanced: false, range: [1e-10, inf], default: 1e-07]
TimeLimit: 1.0e23 # Time limit # [type: double, advanced: false, range: [0, inf], default: inf]
Pre_Solve: choose # Presolve option: "off", "choose" or "on" # [type: string, advanced: false, default: "choose"]
Method: ipm #HiGHS-specific solver settings # Solver option: "simplex", "choose" or "ipm" # [type: string, advanced: false, default: "choose"]

# run the crossover routine for ipx
# [type: string, advanced: "on", range: {"off", "on"}, default: "off"]
run_crossover: "off"
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
#####
#
# TIME DOMAIN REDUCTION SETTINGS
#
# Set parameters here that organize how your full timeseries
# data will be divided into representative period clusters.
# Ensure that time_domain_reduction is set to 1 in GenX_settings.yml
# before running. Run within GenX or use PreCluster.jl to test and
# examine representative period output before proceeding.
# Specify your data input directory as inpath within Run_test.jl
# or PreCluster.jl.
#
#####

# - TimestepsPerRepPeriod
# Typically 168 timesteps (e.g., hours) per period, this designates
# the length of each representative period.
TimestepsPerRepPeriod: 1

# - ClusterMethod
# Either 'kmeans' or 'kmedoids', this designates the method used to cluster
# periods and determine each point's representative period.
ClusterMethod: 'kmeans'

# - ScalingMethod
# Either 'N' or 'S', this designates directs the module to normalize ([0,1])
# or standardize (mean 0, variance 1) the input data.
ScalingMethod: "S"

# - MaxPeriods
# The maximum number of periods - both clustered periods and extreme periods -
# that may be used to represent the input data. If IterativelyAddPeriods is on and the
# error threshold is never met, this will be the total number of periods.
MaxPeriods: 11

# - MinPeriods
# The minimum number of periods used to represent the input data. If using
# UseExtremePeriods, this must be at least the number of extreme periods requests. If
# IterativelyAddPeriods if off, this will be the total number of periods.
MinPeriods: 8

# - IterativelyAddPeriods
# Either 'yes' or 'no', this designates whether or not to add periods
# until the error threshold between input data and represented data is met or the maximum
# number of periods is reached.
IterativelyAddPeriods: 1

# - IterateMethod
# Either 'cluster' or 'extreme', this designates whether to add clusters to
# the kmeans/kmedoids method or to set aside the worst-fitting periods as a new extreme periods.
# The default option is 'cluster'.
IterateMethod: "cluster"

# - Threshold
# Iterative period addition will end if the period farthest (Euclidean Distance)
# from its representative period is within this percentage of the total possible error (for normalization)
# or ~95% of the total possible error (for standardization). E.g., for a threshold of 0.01,
# every period must be within 1% of the spread of possible error before the clustering
# iterations will terminate (or until the max number of periods is reached).
Threshold: 0.05

# - nReps
# The number of times to repeat each kmeans/kmedoids clustering at the same setting.
nReps: 100

# - LoadWeight
# Default 1, this is an optional multiplier on load columns in order to prioritize
# better fits for load profiles over resource capacity factor profiles.
LoadWeight: 1

# - WeightTotal
# Default 8760, the sum to which the relative weights of representative periods will be scaled.
WeightTotal: 24

# - ClusterFuelPrices
# Either 'yes' ro 'no', this indicates whether or not to use the fuel price
# time series in Fuels_data.csv in the clustering process. If 'no', this function will still write
# Fuels_data_clustered.csv with reshaped fuel prices based on the number and size of the
# representative weeks, assuming a constant time series of fuel prices with length equal to the
# number of timesteps in the raw input data.
ClusterFuelPrices: 1

# - MultiStageConcatenate
# (Only considered if MultiStage = 1 in genx_settings.yml)
# If 1, this designates that the model should time domain reduce the input data
# of all model stages together. Else if 0, the model will time domain reduce each
# stage separately
MultiStageConcatenate: 0

# - UseExtremePeriods
# Either 'yes' or 'no', this designates whether or not to include
# outliers (by performance or load/resource extreme) as their own representative periods.
# This setting automatically includes the periods with maximum load, minimum solar cf and
# minimum wind cf as extreme periods.
UseExtremePeriods: 1

# STILL IN DEVELOPMENT - Currently just uses integral max load, integral min PV and wind.
# - ExtremePeriods
# Use this to define which periods to be included among the final representative periods
# as "Extreme Periods".
# Select by profile type: load ("Load"), solar PV capacity factors ("PV"), and wind capacity factors ("Wind").
# Select whether to examine these profiles by zone ("Zone") or across the whole system ("System").
# Select whether to look for absolute max/min at the timestep level ("Absolute")
# or max/min sum across the period ("Integral").
# Select whether you want the maximum ("Max") or minimum ("Min") (of the prior type) for each profile type.
ExtremePeriods:
Load:
Zone:
Absolute:
Max: 0
Min: 0
Integral:
Max: 0
Min: 0
System:
Absolute:
Max: 1
Min: 0
Integral:
Max: 0
Min: 0
PV:
Zone:
Absolute:
Max: 0
Min: 0
Integral:
Max: 0
Min: 1
System:
Absolute:
Max: 0
Min: 0
Integral:
Max: 0
Min: 0
Wind:
Zone:
Absolute:
Max: 0
Min: 0
Integral:
Max: 0
Min: 1
System:
Absolute:
Max: 0
Min: 0
Integral:
Max: 0
Min: 0
Loading