Skip to content

Commit a67d0ce

Browse files
committed
new version, see release notes
1 parent cbc17b1 commit a67d0ce

25 files changed

Lines changed: 361 additions & 370 deletions

File tree

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "JuliaGrid"
22
uuid = "040ba96c-7d3d-4d4a-931c-37903f53a565"
33
authors = ["Mirsad Cosovic <mirsad.cosovic@gmail.com>"]
4-
version = "0.5.0"
4+
version = "0.5.1"
55

66
[deps]
77
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"

docs/src/background/releasenotes.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# [Release Notes](@id ReleaseNotes)
22

3+
4+
---
5+
6+
## Version 0.5.1
7+
8+
Release Date: July 12, 2025
9+
10+
#### Added
11+
* Introduced the `optimal` keyword in the function [`powerSystem`](@ref powerSystem) to skip importing data related to optimal power flow analyses, see [Partial Load for Faster Import](@ref PartialLoadFasterImportManual).
12+
13+
#### Other
14+
* Removed unused parameters from the `PowerSystem` type.
15+
316
---
417

518
## Version 0.5.0

docs/src/manual/powerSystemModel.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,15 @@ system = powerSystem("C:/hdf5/case14.h5")
6767

6868
---
6969

70+
##### [Partial Load for Faster Import](@id PartialLoadFasterImportManual)
71+
A significant portion of data in input files may relate to optimal power flow analysis. If AC or DC optimal power flow is not needed, users can skip importing this additional data by setting the `optimal` keyword to `false`. For example:
72+
```julia
73+
system = powerSystem("C:/matpower/case14.m"; optimal = false)
74+
```
75+
This reduces memory usage and speeds up data loading, which is especially useful for large-scale systems.
76+
77+
---
78+
7079
##### Model from Scratch
7180
Alternatively, the model can be built from scratch using built-in functions, for example:
7281
```@example buildModelScratch

src/backend/internal.jl

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Changing the unit of `active` power is reflected in the following quantities:
5656
[`@branch`](@ref @branch): if `type = 2`: `minFromBus`, `maxFromBus`, `minToBus`, `maxToBus`;
5757
* [`addGenerator!`](@ref addGenerator!), [`updateGenerator!`](@ref updateGenerator!),
5858
[`@generator`](@ref @generator): `active`, `minActive`, `maxActive`, `lowActive`,
59-
`upActive`, `loadFollowing`, `reserve10min`, `reserve30min`;
59+
`upActive`;
6060
* [`cost!`](@ref cost!): if `active`: `piecewise`, `polynomial`;
6161
* [`addWattmeter!`](@ref addWattmeter!), [`updateWattmeter!`](@ref updateWattmeter!):
6262
`active`, `variance`;
@@ -67,7 +67,7 @@ Changing the unit of `reactive` power unit is reflected in the following quantit
6767
`reactive`, `susceptance`;
6868
* [`addGenerator!`](@ref addGenerator!), [`updateGenerator!`](@ref updateGenerator!),
6969
[`@generator`](@ref @generator): `reactive`, `minReactive`, `maxReactive`,
70-
`minLowReactive`, `maxLowReactive`, `minUpReactive`, `maxUpReactive`, `reactiveRamp`;
70+
`minLowReactive`, `maxLowReactive`, `minUpReactive`, `maxUpReactive`;
7171
* [`cost!`](@ref cost!): if `reactive`: `piecewise`, `polynomial`;
7272
* [`addVarmeter!`](@ref addVarmeter!), [`updateVarmeter!`](@ref updateVarmeter!):
7373
`reactive`, `variance`;
@@ -482,17 +482,7 @@ macro default(mode::Symbol)
482482
template.generator.maxUpReactive.value = 0.0
483483
template.generator.maxUpReactive.pu = true
484484

485-
template.generator.loadFollowing.value = 0.0
486-
template.generator.loadFollowing.pu = true
487-
template.generator.reactiveRamp.value = 0.0
488-
template.generator.reactiveRamp.pu = true
489-
template.generator.reserve10min.value = 0.0
490-
template.generator.reserve10min.pu = true
491-
template.generator.reserve30min.value = 0.0
492-
template.generator.reserve30min.pu = true
493-
494485
template.generator.status = Int8(1)
495-
template.generator.area = 0
496486
template.generator.label = "?"
497487
template.generator.key = String
498488
end

src/backend/precompile.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,8 @@ PrecompileTools.@setup_workload begin
5858
########## Observability Analysis ###########
5959
islands = islandTopologicalFlow(mt)
6060
restorationGram!(mt, mt, islands)
61+
62+
########## Default ###########
63+
@default(template)
6164
end
6265
end

src/backend/utility.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,15 @@ function errorCovariance(pmu::PMU, varianceIm::Float64, L2::Float64, idx::Int64)
762762
end
763763
end
764764

765+
function errorOptimal(system::PowerSystem)
766+
if !system.bus.layout.optimal
767+
throw(ErrorException(
768+
"The power system object lacks optimal power flow data, likely due to " *
769+
"optimal = false in the powerSystem function call.")
770+
)
771+
end
772+
end
773+
765774
##### Info Messages #####
766775
function infoObjective(label::IntStr)
767776
@info(

src/data/case14.h5

-2.5 KB
Binary file not shown.

src/data/case14.m

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -87,20 +87,20 @@
8787

8888
%% bus names
8989
mpc.bus_name = {
90-
'Bus 1 HV';
91-
'Bus 2 HV';
92-
'Bus 3 HV';
93-
'Bus 4 HV';
94-
'Bus 5 HV';
95-
'Bus 6 LV';
96-
'Bus 7 ZV';
97-
'Bus 8 TV';
98-
'Bus 9 LV';
99-
'Bus 10 LV';
100-
'Bus 11 LV';
101-
'Bus 12 LV';
102-
'Bus 13 LV';
103-
'Bus 14 LV';
90+
'Bus 1 HV';
91+
'Bus 2 HV';
92+
'Bus 3 HV';
93+
'Bus 4 HV';
94+
'Bus 5 HV';
95+
'Bus 6 LV';
96+
'Bus 7 ZV';
97+
'Bus 8 TV';
98+
'Bus 9 LV';
99+
'Bus 10 LV';
100+
'Bus 11 LV';
101+
'Bus 12 LV';
102+
'Bus 13 LV';
103+
'Bus 14 LV';
104104
};
105105

106106
% Warnings from cdf2matp conversion:

src/definition/internal.jl

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,7 @@ Base.@kwdef mutable struct GeneratorTemplate
165165
upActive::ContainerTemplate = ContainerTemplate()
166166
minUpReactive::ContainerTemplate = ContainerTemplate()
167167
maxUpReactive::ContainerTemplate = ContainerTemplate()
168-
loadFollowing::ContainerTemplate = ContainerTemplate()
169-
reactiveRamp::ContainerTemplate = ContainerTemplate()
170-
reserve10min::ContainerTemplate = ContainerTemplate()
171-
reserve30min::ContainerTemplate = ContainerTemplate()
172168
status::Int8 = Int8(1)
173-
area::Int64 = 0
174169
label::String = "?"
175170
key::DataType = String
176171
end
@@ -369,7 +364,6 @@ end
369364

370365
Base.@kwdef struct GeneratorKey
371366
label::IntStrMiss = missing
372-
area::IntMiss = missing
373367
status::IntMiss = missing
374368
active::FltIntMiss = missing
375369
reactive::FltIntMiss = missing
@@ -384,10 +378,6 @@ Base.@kwdef struct GeneratorKey
384378
upActive::FltIntMiss = missing
385379
minUpReactive::FltIntMiss = missing
386380
maxUpReactive::FltIntMiss = missing
387-
loadFollowing::FltIntMiss = missing
388-
reserve10min::FltIntMiss = missing
389-
reserve30min::FltIntMiss = missing
390-
reactiveRamp::FltIntMiss = missing
391381
end
392382

393383
Base.@kwdef struct CostKey

src/definition/system.jl

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ mutable struct BusLayout
2626
slack::Int64
2727
label::Int64
2828
pattern::Int64
29+
const optimal::Bool
2930
end
3031

3132
mutable struct BusSupply
@@ -130,13 +131,6 @@ mutable struct GeneratorCapability
130131
maxUpReactive::Vector{Float64}
131132
end
132133

133-
mutable struct GeneratorRamping
134-
loadFollowing::Vector{Float64}
135-
reserve10min::Vector{Float64}
136-
reserve30min::Vector{Float64}
137-
reactiveRamp::Vector{Float64}
138-
end
139-
140134
mutable struct Cost
141135
model::Vector{Int8}
142136
polynomial::OrderedDict{Int64, Vector{Float64}}
@@ -154,7 +148,6 @@ end
154148

155149
mutable struct GeneratorLayout
156150
bus::Vector{Int64}
157-
area::Vector{Float64}
158151
status::Vector{Int8}
159152
inservice::Int64
160153
label::Int64
@@ -169,7 +162,6 @@ A composite type used in [`PowerSystem`](@ref PowerSystem) to store generator-re
169162
- `label::LabelDict`: Generator labels.
170163
- `output::GeneratorOutput`: Active and reactive power outputs.
171164
- `capability::GeneratorCapability`: Power output constraints.
172-
- `ramping::GeneratorRamping`: Ramp rate limits.
173165
- `voltage::GeneratorVoltage`: Voltage magnitude setpoints.
174166
- `cost::GeneratorCost`: Costs associated with active and reactive power outputs.
175167
- `layout::GeneratorLayout`: Generator layout, including operational statuses.
@@ -179,7 +171,6 @@ mutable struct Generator
179171
label::LabelDict
180172
output::GeneratorOutput
181173
capability::GeneratorCapability
182-
ramping::GeneratorRamping
183174
voltage::GeneratorVoltage
184175
cost::GeneratorCost
185176
layout::GeneratorLayout

0 commit comments

Comments
 (0)