Skip to content

Commit b0ae69f

Browse files
authored
Merge pull request #39 from GenXProject/Dev
Version Upgrade of GenX for running on Julia 1.5.x and 1.6.x
2 parents 2749fd1 + bd318d0 commit b0ae69f

57 files changed

Lines changed: 416 additions & 281 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ notifications:
44
email: false
55
julia:
66
#- 1.0
7-
- 1.3
8-
#- nightly
7+
#- 1.3
8+
- 1.5
9+
- 1.6
10+
- nightly
911
coveralls: true
1012
branches:
1113
only:

Example_Systems/RealSystemExample/ISONE_Singlezone/Settings/gurobi_settings.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ Feasib_Tol: 1.0e-06 # Constraint (primal) feasibility tolerances.
44
Optimal_Tol: 1e-6 # Dual feasibility tolerances.
55
TimeLimit: 110000 # Limits total time solver.
66
Pre_Solve: 1 # Controls presolve level.
7-
Method: 4 # Algorithm used to solve continuous models (including MIP root relaxation).
7+
Method: 2 # Algorithm used to solve continuous models (including MIP root relaxation).
88

99
#Gurobi-specific solver settings
1010
MIPGap: 1e-4 # Relative (p.u. of optimal) mixed integer optimality tolerance for MIP problems (ignored otherwise).
1111
BarConvTol: 1.0e-08 # Barrier convergence tolerance (determines when barrier terminates).
1212
NumericFocus: 0 # Numerical precision emphasis.
13-
Crossover: -1 # Barrier crossver strategy.
13+
Crossover: 0 # Barrier crossver strategy.
1414
BarObjRng: 1e+75 # Sets the maximum absolute value of the objective function
1515
PreDual: 0 # Decides whether presolve should pass the primal or dual linear programming problem to the LP optimization algorithm.
1616
AggFill: 10 # Allowed fill during presolve aggregation.

Example_Systems/RealSystemExample/ISONE_Trizone/Settings/genx_settings.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ OverwriteResults: 0 # Overwrite existing results in output folder or create a ne
33
PrintModel: 0 # Write the model formulation as an output; 0 = active; 1 = not active
44
NetworkExpansion: 1 # Transmission network expansionl; 0 = not active; 1 = active systemwide
55
Trans_Loss_Segments: 1 # Number of segments used in piecewise linear approximation of transmission losses; 1 = linear, >2 = piecewise quadratic
6-
Reserves: 0 # Regulation (primary) and operating (secondary) reserves; 0 = not active, 1 = active systemwide
6+
Reserves: 1 # Regulation (primary) and operating (secondary) reserves; 0 = not active, 1 = active systemwide
77
EnergyShareRequirement: 1 # Minimum qualifying renewables penetration; 0 = not active; 1 = active systemwide
88
CapacityReserveMargin: 1 # Number of capacity reserve margin constraints; 0 = not active; 1 = active systemwide
99
CO2Cap: 1 # 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
@@ -12,7 +12,7 @@ MinCapReq: 1 # Activate minimum technology carveout constraints; 0 = not active
1212
Solver: Clp # Available solvers: Gurobi, CPLEX, CLP, CBC
1313
ParameterScale: 1 # Turn on parameter scaling wherein load, capacity and power variables are defined in GW rather than MW. 0 = not active; 1 = active systemwide
1414
WriteShadowPrices: 1 # Write shadow prices of LP or relaxed MILP; 0 = not active; 1 = active
15-
UCommit: 0 # Unit committment of thermal power plants; 0 = not active; 1 = active using integer clestering; 2 = active using linearized clustering
15+
UCommit: 2 # Unit committment of thermal power plants; 0 = not active; 1 = active using integer clestering; 2 = active using linearized clustering
1616
OperationWrapping: 1 # Sets temporal resolution of the model; 0 = single period to represent the full year, with first-last time step linked; 1 = multiple representative periods
1717
LongDurationStorage: 0 # Inter-period energy exchange for storage technologies; 0 = not active; 1 = active systemwide
1818
TimeDomainReductionFolder: "TDR_Results" # Directory name where results from time domain reduction will be saved. If results already exist here, these will be used without running time domain reduction script again.

Example_Systems/RealSystemExample/ISONE_Trizone/Settings/gurobi_settings.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ Feasib_Tol: 1.0e-06 # Constraint (primal) feasibility tolerances.
44
Optimal_Tol: 1e-6 # Dual feasibility tolerances.
55
TimeLimit: 110000 # Limits total time solver.
66
Pre_Solve: 1 # Controls presolve level.
7-
Method: 4 # Algorithm used to solve continuous models (including MIP root relaxation).
7+
Method: 2 # Algorithm used to solve continuous models (including MIP root relaxation).
88

99
#Gurobi-specific solver settings
1010
MIPGap: 1e-4 # Relative (p.u. of optimal) mixed integer optimality tolerance for MIP problems (ignored otherwise).
1111
BarConvTol: 1.0e-08 # Barrier convergence tolerance (determines when barrier terminates).
1212
NumericFocus: 0 # Numerical precision emphasis.
13-
Crossover: -1 # Barrier crossver strategy.
13+
Crossover: 0 # Barrier crossver strategy.
1414
BarObjRng: 1e+75 # Sets the maximum absolute value of the objective function
1515
PreDual: 0 # Decides whether presolve should pass the primal or dual linear programming problem to the LP optimization algorithm.
1616
AggFill: 10 # Allowed fill during presolve aggregation.

Example_Systems/RealSystemExample/ISONE_Trizone_FullTimeseries/Settings/genx_settings.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ CapacityReserveMargin: 1 # Number of capacity reserve margin constraints; 0 = no
99
CO2Cap: 1 # 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
1010
StorageLosses: 1 # 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)
1111
MinCapReq: 1 # Activate minimum technology carveout constraints; 0 = not active; 1 = active
12-
Solver: Gurobi # Available solvers: Gurobi, CPLEX, CLPs
12+
Solver: Clp # Available solvers: Gurobi, CPLEX, CLPs
1313
ParameterScale: 1 # Turn on parameter scaling wherein load, capacity and power variables are defined in GW rather than MW. 0 = not active; 1 = active systemwide
1414
WriteShadowPrices: 1 # Write shadow prices of LP or relaxed MILP; 0 = not active; 1 = active
1515
UCommit: 0 # Unit committment of thermal power plants; 0 = not active; 1 = active using integer clestering; 2 = active using linearized clustering

Example_Systems/RealSystemExample/MGA_ISONE_Trizone_FullTimeseries/Run.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,12 @@ outpath = "$inpath/Results"
7373
write_outputs(EP, outpath, mysetup, myinputs)
7474
if mysetup["ModelingToGenerateAlternatives"] == 1
7575
println("Starting Model to Generate Alternatives (MGA) Iterations")
76-
mga(EP,inpath,mysetup,myinputs,outpath)
76+
if Sys.isunix()
77+
sep = "/"
78+
elseif Sys.iswindows()
79+
sep = "\U005c"
80+
else
81+
sep = "/"
82+
end
83+
mga(EP,inpath,mysetup,myinputs,outpath, sep)
7784
end

Example_Systems/RealSystemExample/MGA_ISONE_Trizone_FullTimeseries/Settings/gurobi_settings.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ Feasib_Tol: 1.0e-06 # Constraint (primal) feasibility tolerances.
44
Optimal_Tol: 1e-6 # Dual feasibility tolerances.
55
TimeLimit: 110000 # Limits total time solver.
66
Pre_Solve: 1 # Controls presolve level.
7-
Method: 4 # Algorithm used to solve continuous models (including MIP root relaxation).
7+
Method: 2 # Algorithm used to solve continuous models (including MIP root relaxation).
88

99
#Gurobi-specific solver settings
1010
MIPGap: 1e-4 # Relative (p.u. of optimal) mixed integer optimality tolerance for MIP problems (ignored otherwise).
1111
BarConvTol: 1.0e-08 # Barrier convergence tolerance (determines when barrier terminates).
1212
NumericFocus: 0 # Numerical precision emphasis.
13-
Crossover: -1 # Barrier crossver strategy.
13+
Crossover: 0 # Barrier crossver strategy.
1414
BarObjRng: 1e+75 # Sets the maximum absolute value of the objective function
1515
PreDual: 0 # Decides whether presolve should pass the primal or dual linear programming problem to the LP optimization algorithm.
1616
AggFill: 10 # Allowed fill during presolve aggregation.

Project.toml

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ Distances = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7"
1818
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
1919
DocumenterTools = "35a29f4d-8980-5a13-9543-d66fff28ecb8"
2020
GLPK = "60bf3e95-4087-53dc-ae20-288a0d20c6a6"
21-
Gurobi = "2e9cd046-0924-5485-92f1-d5272153d98b"
2221
Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9"
2322
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
2423
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
@@ -30,27 +29,26 @@ StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
3029
YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"
3130

3231
[compat]
33-
CSV = "0.6.0, 0.8"
34-
BenchmarkTools = "1.0.0"
32+
BenchmarkTools = "1.1.1"
33+
CSV = "0.8.5"
3534
Cbc = "0.8.0"
36-
Clp = "0.8.1"
35+
Clp = "0.8.4"
3736
Clustering = "0.14.2"
3837
Combinatorics = "1.0.2"
39-
DataStructures = "0.17.20, 0.18"
40-
DataFrames = "0.20.2, 1"
41-
DiffEqSensitivity = "6.33.0"
42-
Distances = "0.10.2"
43-
Documenter = "0.24.7, 0.27"
44-
DocumenterTools = "0.1.9"
45-
GLPK = "0.14.8"
46-
Ipopt = "0.6.0, 0.7"
47-
Gurobi = "0.7.6, 0.9"
48-
JuMP = "0.21.3"
38+
DataFrames = "1.0.0"
39+
DataStructures = "0.18.9"
40+
DiffEqSensitivity = "6.52.1"
41+
Distances = "0.10.3"
42+
Documenter = "0.27.3"
43+
DocumenterTools = "0.1.13"
44+
GLPK = "0.14.12"
45+
Ipopt = "0.7.0"
46+
JuMP = "0.21.8"
4947
MathProgBase = "0.7.8"
50-
OrdinaryDiffEq = "5.42.3"
48+
OrdinaryDiffEq = "5.60.1"
5149
QuasiMonteCarlo = "0.2.3"
52-
StatsBase = "0.33.0"
53-
YAML = "0.4.3"
50+
StatsBase = "0.33.8"
51+
YAML = "0.4.7"
5452
julia = "1"
5553

5654
[extras]

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,10 @@ The 'main' branch is the current master branch of GenX. The various subdirectori
2323

2424
## Requirements
2525

26-
GenX.jl runs on Julia v1.3.x series, where x>=0 and a minimum version of JuMP v0.21.3, and is currently setup to use one of the following open-source freely available solvers: A) [Clp](https://github.com/jump-dev/Clp.jl) for linear programming (LP) problems and (B) [Cbc](https://github.com/jump-dev/Cbc.jl) for mixed integer linear programming (MILP) problems. We also provide the option to use one of these two commercial solvers: C) [Gurobi](https://www.gurobi.com), and D) [CPLEX](https://www.ibm.com/analytics/cplex-optimizer). Note that using Gurobi and CPLEX requires a valid license on the host machine. There are two ways to run GenX with either type of solver options (open-source free or, licensed commercial) as detailed in the section, `Running an Instance of GenX`.
26+
GenX currently exists in version 0.1.0 and runs only on Julia v1.6.x and v1.5.x series, where x>=0 and a minimum version of JuMP v0.21.x. There is also an older version of GenX, which is also currently maintained and runs on Julia 1.3.x and 1.4.x series (For those users who has previously cloned GenX, and has been running it successfully so far, and therefore might be unwilling to run it on the latest version of Julia: please look into the GitHub branch, [old_version](https://github.com/GenXProject/GenX/tree/old_version)). It is currently setup to use one of the following open-source freely available solvers: A) [Clp](https://github.com/jump-dev/Clp.jl) for linear programming (LP) problems and (B) [Cbc](https://github.com/jump-dev/Cbc.jl) for mixed integer linear programming (MILP) problems. We also provide the option to use one of these two commercial solvers: C) [Gurobi](https://www.gurobi.com), and D) [CPLEX](https://www.ibm.com/analytics/cplex-optimizer). Note that using Gurobi and CPLEX requires a valid license on the host machine. There are two ways to run GenX with either type of solver options (open-source free or, licensed commercial) as detailed in the section, `Running an Instance of GenX`.
2727

2828
The file `julenv.jl` in the parent directory lists all of the packages and their versions needed to run GenX. You can see all of the packages installed in your Julia environment and their version numbers by running `pkg> status` on the package manager command line in the Jula REPL.
2929

30-
You can see all of the packages installed in your Julia environment and their version numbers by running pkg> status on the package manager command line.
31-
3230
## Documentation
3331

3432
Detailed documentation for GenX can be found [here](https://genxproject.github.io/GenX/dev). It includes details of each of GenX's methods, required and optional input files, and outputs. Interested users may also want to browse through prior publications that have used GenX to understand the various features of the tool. Full publication list is available [here](https://energy.mit.edu/genx/#publications).
@@ -56,28 +54,28 @@ Here are step-by-step instructions for running Run.jl, following the two slightl
5654

5755
Execution of the entire sequence of the four steps above should look like the figure below:
5856

59-
![Creating the Julia environment and installing dependencies from Project.toml file from inside the GenX folder: Steps 1-4](docs/src/assets/Method1_Julia_Kernel_from_inside_GenX_Step1.png)
57+
![Creating the Julia environment and installing dependencies from Project.toml file from inside the GenX folder: Steps 1-4](docs/src/assets/Method1_Julia_Kernel_from_inside_GenX_Step1_Updated.png)
6058
*Figure.Creating the Julia environment and installing dependencies from Project.toml file from inside the GenX folder: Steps 1-4*
6159

6260
5. Type the back key to come back to the `julia>` prompt.
6361
6. Run the script by executing the command `julia> include(“<path to your case>/Run.jl”)`. For example, in order to run the ISONE_Singlezone case within the Example_Systems/RealSystemExample/, type `include("Example_Systems/RealSystemExample/ISONE_Singlezone/Run.jl")` from the `julia>` prompt (while being still in the GenX i.e. the root level in the folder hierarchy)
6462

6563
Execution of the steps 5 and 6 above should look like the figure below:
6664

67-
![Creating the Julia environment and installing dependencies from Project.toml file from inside the GenX folder: Steps 5-6](docs/src/assets/Method1_Julia_Kernel_from_inside_GenX_Step2.png)
65+
![Creating the Julia environment and installing dependencies from Project.toml file from inside the GenX folder: Steps 5-6](docs/src/assets/Method1_Julia_Kernel_from_inside_GenX_Step2_Updated.png)
6866
*Figure.Creating the Julia environment and installing dependencies from Project.toml file from inside the GenX folder: Steps 5-6*
6967

7068
7. After the script runs to completion, results will be written to a folder called “Results”, also located in the same directory as `Run.jl`.
7169

7270
If however, the user opens a julia kernel, while not yet inside the GenX folder, it's still possible to reach to the GenX folder while being inside the Julia REPL by executing the `pwd()` command first to check where on the directory structure the user is currently, and then by executing the `cd(<path to GenX>)` command. Afterwards, the steps are the same as above. This is shown in the three figures below:
7371

74-
![Creating the Julia environment and installing dependencies from Project.toml file from outside the GenX folder: Changing path to GenX](docs/src/assets/Method1_Julia_Kernel_from_outside_GenX_Step1.png)
72+
![Creating the Julia environment and installing dependencies from Project.toml file from outside the GenX folder: Changing path to GenX](docs/src/assets/Method1_Julia_Kernel_from_outside_GenX_Step1_Updated.png)
7573
*Figure.Creating the Julia environment and installing dependencies from Project.toml file from inside the GenX folder: Changing path to GenX*
7674

77-
![Creating the Julia environment and installing dependencies from Project.toml file from outside the GenX folder: Steps 1-4](docs/src/assets/Method1_Julia_Kernel_from_outside_GenX_Step2.png)
75+
![Creating the Julia environment and installing dependencies from Project.toml file from outside the GenX folder: Steps 1-4](docs/src/assets/Method1_Julia_Kernel_from_outside_GenX_Step2_Updated.png)
7876
*Figure.Creating the Julia environment and installing dependencies from Project.toml file from inside the GenX folder: Steps 1-4*
7977

80-
![Creating the Julia environment and installing dependencies from Project.toml file from outside the GenX folder: Steps 5-6](docs/src/assets/Method1_Julia_Kernel_from_outside_GenX_Step3.png)
78+
![Creating the Julia environment and installing dependencies from Project.toml file from outside the GenX folder: Steps 5-6](docs/src/assets/Method1_Julia_Kernel_from_outside_GenX_Step3_Updated.png)
8179
*Figure.Creating the Julia environment and installing dependencies from Project.toml file from inside the GenX folder: Steps 5-6*
8280

8381
### Method 2: Creating the Julia environment and installing the dependencies by building the Project.toml files by running activation script
156 KB
Loading

0 commit comments

Comments
 (0)