Skip to content

Commit 1fd686e

Browse files
committed
Merge branch 'main' of github.com:NREL-Sienna/PowerSystemsInvestments.jl
2 parents aefd453 + edc8c6a commit 1fd686e

Some content is hidden

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

59 files changed

+4699
-745
lines changed

Project.toml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,31 @@ version = "0.1.0"
77
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
88
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
99
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
10-
HiGHS = "87dc4568-4c63-4d18-b0c0-bb2238e4078b"
1110
InfrastructureSystems = "2cd47ed4-ca9b-11e9-27f2-ab636a7671f1"
1211
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
1312
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
13+
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
1414
MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee"
1515
PowerModels = "c36e90e8-916a-50a6-bd94-075b64ef4655"
1616
PowerNetworkMatrices = "bed98974-b02a-5e2f-9fe0-a103f5c450dd"
1717
PowerSystems = "bcd98974-b02a-5e2f-9ee0-a103f5c450dd"
1818
PowerSystemsInvestmentsPortfolios = "bed98974-b02a-5e2f-9fe0-a103f8c450dd"
1919
PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
20+
TimeSeries = "9e3dc215-6440-5c97-bce1-76c03772f85e"
21+
TimerOutputs = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f"
2022

2123
[compat]
22-
DocStringExtensions = "~0.8, ~0.9"
24+
DataStructures = "~0.18"
25+
Dates = "1"
26+
DocStringExtensions = "~v0.9"
27+
InfrastructureSystems = "2"
28+
JuMP = "1"
29+
Logging = "1"
30+
MathOptInterface = "1"
31+
PowerModels = "^0.21"
32+
PowerNetworkMatrices = "^0.11"
33+
PowerSystems = "4"
34+
PowerSystemsInvestmentsPortfolios = "0.1"
35+
PrettyTables = "2"
36+
TimeSeries = "^0.24.2"
2337
julia = "^1.6"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![main - CI](https://github.com/NREL-Sienna/PowerSystemsInvestments.jl/workflows/main%20-%20CI/badge.svg)](https://github.com/NREL-Sienna/PowerSystemsInvestments.jl/actions/workflows/main-tests.yml)
44
[![codecov](https://codecov.io/gh/NREL-Sienna/PowerSystemsInvestments.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/NREL-Sienna/PowerSystemsInvestments.jl)
55
[![Documentation Build](https://github.com/NREL-Sienna/PowerSystemsInvestments.jl/workflows/Documentation/badge.svg?)](https://nrel-sienna.github.io/PowerSystemsInvestments.jl/stable)
6-
[<img src="https://img.shields.io/badge/slack-@Sienna/PSYI.svg?logo=slack">](https://join.slack.com/t/nrel-sienna/shared_invite/zt-glam9vdu-o8A9TwZTZqqNTKHa7q3BpQ)
6+
[<img src="https://img.shields.io/badge/slack-@Sienna/PSINV.svg?logo=slack">](https://join.slack.com/t/nrel-sienna/shared_invite/zt-glam9vdu-o8A9TwZTZqqNTKHa7q3BpQ)
77
[![PowerSystemsInvestments.jl Downloads](https://shields.io/endpoint?url=https://pkgs.genieframework.com/api/v1/badge/PowerSystemsInvestments)](https://pkgs.genieframework.com?packages=PowerSystemsInvestments)
88

99
## Development

src/PowerSystemsInvestments.jl

Lines changed: 61 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import PowerModels
1010
import DataStructures
1111
import PowerNetworkMatrices
1212
import PrettyTables
13+
import TimeSeries
14+
import Logging
1315

1416
const IS = InfrastructureSystems
1517
const ISOPT = InfrastructureSystems.Optimization
@@ -20,21 +22,40 @@ const PM = PowerModels
2022
const PNM = PowerNetworkMatrices
2123

2224
### Exports ###
23-
2425
export InvestmentModel
25-
export SimpleCapacityExpansion
26+
export InvestmentModelTemplate
27+
export TransportModel
28+
29+
### Capital Model
30+
export DiscountedCashFlow
31+
export AggregateOperatingCost
32+
export RepresentativePeriods
33+
34+
export SingleRegionBalanceModel
2635

2736
## Variables ##
2837
export BuildCapacity
38+
export ActivePowerVariable
2939

3040
## Expressions ##
3141
export CumulativeCapacity
3242
export CapitalCost
3343
export TotalCapitalCost
34-
export FixedOMCost
44+
export FixedOperationModelCost
45+
export VariableOMCost
46+
export SupplyTotal
47+
export DemandTotal
48+
49+
#remove later, just for testing
50+
export objective_function!
51+
export add_expression!
52+
export add_to_expression!
3553

3654
using DocStringExtensions
3755

56+
# methods
57+
export build!
58+
3859
@template (FUNCTIONS, METHODS) = """
3960
$(TYPEDSIGNATURES)
4061
$(DOCSTRING)
@@ -92,27 +113,53 @@ import InfrastructureSystems.Optimization:
92113
convert_result_to_natural_units,
93114
to_matrix,
94115
get_store_container_type
116+
117+
import TimerOutputs
118+
95119
####
120+
# Order Required
121+
include("utils/mpi_utils.jl")
122+
include("base/definitions.jl")
96123

97-
include("base/formulations.jl")
98-
include("base/investment_model_store.jl")
99-
include("base/network_model.jl")
124+
include("base/abstract_formulation_types.jl")
125+
include("capital/technology_capital_formulations.jl")
126+
include("capital/capital_models.jl")
127+
include("operation/technology_operation_formulations.jl")
128+
include("operation/feasibility_model.jl")
129+
include("operation/operation_model.jl")
130+
include("base/transport_model.jl")
100131
include("base/constraints.jl")
101132
include("base/variables.jl")
102133
include("base/expressions.jl")
103134
include("base/parameters.jl")
104135
include("base/settings.jl")
105136
include("base/solution_algorithms.jl")
106-
include("base/operation_model.jl")
107-
include("base/feasibility_model.jl")
108-
include("base/investment_problem.jl")
109-
include("investment/investment_model.jl")
110-
111-
# Order Required
112137
include("base/technology_model.jl")
113-
include("investment/problem_template.jl")
114-
include("base/optimization_container.jl")
138+
include("base/investment_model_template.jl")
139+
140+
include("base/objective_function.jl")
141+
include("base/single_optimization_container.jl")
142+
include("base/multi_optimization_container.jl")
143+
144+
include("investment_model/investment_model_store.jl")
145+
include("investment_model/investment_model.jl")
146+
147+
include("model_build/SingleInstanceSolve.jl")
115148

116149
include("utils/printing.jl")
150+
include("utils/jump_utils.jl")
151+
include("technology_models/technologies/common/add_variable.jl")
152+
include("technology_models/technologies/common/add_to_expression.jl")
117153
include("technology_models/technologies/supply_tech.jl")
154+
include("technology_models/technologies/demand_tech.jl")
155+
include("technology_models/technologies/storage_tech.jl")
156+
include("network_models/singleregion_model.jl")
157+
158+
include("technology_models/technology_constructors/supply_constructor.jl")
159+
include("technology_models/technology_constructors/demand_constructor.jl")
160+
include("technology_models/technology_constructors/storage_constructor.jl")
161+
162+
include("technology_models/technologies/common/objective_function.jl/common_capital.jl")
163+
include("technology_models/technologies/common/objective_function.jl/common_operations.jl")
164+
include("technology_models/technologies/common/objective_function.jl/linear_curve.jl")
118165
end
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
abstract type AbstractTechnologyFormulation end
2+
3+
abstract type InvestmentTechnologyFormulation <: AbstractTechnologyFormulation end
4+
abstract type OperationsTechnologyFormulation <: AbstractTechnologyFormulation end
5+
abstract type FeasibilityTechnologyFormulation <: AbstractTechnologyFormulation end

src/base/capital_model.jl

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/base/constraints.jl

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
### Investment Constraints ###
2+
struct MaximumCumulativeCapacity <: ISOPT.ConstraintType end
3+
4+
struct MaximumCumulativePowerCapacity <: ISOPT.ConstraintType end
5+
6+
struct MaximumCumulativeEnergyCapacity <: ISOPT.ConstraintType end
7+
8+
### Operations Constraints ###
9+
110
struct SupplyDemandBalance <: ISOPT.ConstraintType end
211

3-
struct MaximumCumulativeCapacity <: ISOPT.ConstraintType end
12+
struct SingleRegionBalanceConstraint <: ISOPT.ConstraintType end
13+
14+
struct ActivePowerVariableLimitsConstraint <: ISOPT.ConstraintType end
15+
16+
struct ActivePowerLimitsConstraint <: ISOPT.ConstraintType end
17+
18+
struct OutputActivePowerVariableLimitsConstraint <: ISOPT.ConstraintType end
19+
20+
struct InputActivePowerVariableLimitsConstraint <: ISOPT.ConstraintType end
21+
22+
struct EnergyBalanceConstraint <: ISOPT.ConstraintType end
23+
24+
struct StateofChargeLimitsConstraint <: ISOPT.ConstraintType end

src/base/definitions.jl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const UNSET_HORIZON = Dates.Millisecond(0)
2+
const UNSET_RESOLUTION = Dates.Millisecond(0)
3+
const UNSET_INI_TIME = Dates.DateTime(0)
4+
5+
const SECONDS_IN_MINUTE = 60.0
6+
const MINUTES_IN_HOUR = 60.0
7+
const SECONDS_IN_HOUR = 3600.0
8+
const MILLISECONDS_IN_HOUR = 3600000.0
9+
const MAX_START_STAGES = 3
10+
const OBJECTIVE_FUNCTION_POSITIVE = 1.0
11+
const OBJECTIVE_FUNCTION_NEGATIVE = -1.0
12+
13+
# Type Alias for JuMP containers
14+
const GAE = JuMP.GenericAffExpr{Float64, JuMP.VariableRef}
15+
const JuMPAffineExpressionArray = Matrix{GAE}
16+
const JuMPAffineExpressionVector = Vector{GAE}
17+
18+
IS.@scoped_enum(SOSStatusVariable, NO_VARIABLE = 1, PARAMETER = 2, VARIABLE = 3,)

src/base/expressions.jl

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1-
struct SupplyTotal <: ISOPT.ExpressionType end
2-
struct DemandTotal <: ISOPT.ExpressionType end
1+
abstract type InvestmentExpressionType <: ISOPT.ExpressionType end
2+
abstract type OperationsExpressionType <: ISOPT.ExpressionType end
33

4-
struct CumulativeCapacity <: ISOPT.ExpressionType end
5-
struct CapitalCost <: ISOPT.ExpressionType end
6-
struct FixedOMCost <: ISOPT.ExpressionType end
4+
struct SupplyTotal <: OperationsExpressionType end
5+
struct DemandTotal <: OperationsExpressionType end
6+
struct ActivePowerBalance <: OperationsExpressionType end
7+
8+
struct CumulativeCapacity <: InvestmentExpressionType end
9+
10+
struct CumulativePowerCapacity <: InvestmentExpressionType end
11+
struct CumulativeEnergyCapacity <: InvestmentExpressionType end
12+
13+
struct CapitalCost <: InvestmentExpressionType end
14+
struct FixedOperationModelCost <: InvestmentExpressionType end
715

816
struct TotalCapitalCost <: ISOPT.ExpressionType end
917

10-
struct VariableOMCost <: ISOPT.ExpressionType end
18+
struct VariableOMCost <: OperationsExpressionType end

src/base/feasibility_model.jl

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/base/formulations.jl

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)