Julia library for solving the transmission capacity expansion problem, implemented as linear program using JuMP. The documentation contains more details about the model.
The library is authored by Lucas Condeixa, Fabricio Oliveira, and Jaan Tollander de Balsch in Systems Analysis Laboratory in Aalto university.
Inside the examples directory, we have run.jl file, which demonstrates the usage of this library by running the example instance.
using Gurobi, JuMP
using EnergySystemModeling
# Load parameters.
parameters = Params(joinpath("examples", "instance"))
# Define specs.
specs = Specs(
renewable_target=true,
storage=true,
ramping=false,
voltage_angles=false
)
# Create the model.
model = EnergySystemModel(parameters, specs)
# Optimizer the model using Gurobi optimizer.
optimizer = optimizer_with_attributes(
() -> Gurobi.Optimizer(Gurobi.Env()),
"TimeLimit" => 5*60
)
optimize!(model, optimizer)
# Extract values from the model.
variables = Variables(model)
objectives = Objectives(model)Saving values to JSON.
save_json(specs, joinpath("output", "specs.json"))
save_json(parameters, joinpath("output", "parameters.json"))
save_json(variables, joinpath("output", "variables.json"))
save_json(objectives, joinpath("output", "objectives.json"))Loading values from JSON.
specs = load_json(Specs, joinpath("output", "specs.json"))
parameters = load_json(Params, joinpath("output", "parameters.json"))
variables = load_json(Variables, joinpath("output", "variables.json"))
objectives = load_json(Objectives, joinpath("output", "objectives.json"))We recommend to check out the documentation for plotting.
This library can be installed directly from GitHub
pkg> add https://github.com/gamma-opt/EnergySystemModeling.jl
Install Julia programming language.
Clone the repository
git clone https://github.com/gamma-opt/EnergySystemModeling.jl.gitIn the project root directory, install packages locally using Julia's package manager.
pkg> dev .
Install a solver such as Gurobi.
It's up to the user to choose a suitable solver for solving the JuMP model. For small instances, GLPK is sufficient, but for large instances, we recommend commercial solvers such as Gurobi or CPLEX.
Gurobi is a powerful commercial optimizer that provides a free academic license. We can interface with Gurobi in Julia using Gurobi.jl. Here are the steps to install Julia and Gurobi to run the program:
-
Obtain a license of Gurobi and install Gurobi solver by following the instructions on Gurobi's website.
-
Make sure the
GUROBI_HOMEenvironmental variable is set to the path of the Gurobi directory. This is part of standard installation. The Gurobi library will be searched for inGUROBI_HOME/libon Unix platforms andGUROBI_HOME\binon Windows. If the library is not found, check that your version is listed indeps/build.jl. The environmental variable can be set by appendingexport GUROBI_HOME="<path>/gurobi811/linux64"to.bashrcfile. Replace the<path>, platformlinux64and version number811with the values of your Gurobi installation. -
Install
Gurobi.jlin Julia's package manager by running commandspkg> add Gurobi pkg> build Gurobi
The project documentation is created using Documenter.jl. To build the documentation, navigate inside the docs directory and run the command
julia make.jl