Skip to content

Enable sensitivity analysis #372

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

Draft
wants to merge 78 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
e7fc061
pass parameters (tests pass)
m-bossart Mar 29, 2024
35e2623
Merge branch 'main' into mb/differentiable
m-bossart Mar 30, 2024
80bfa14
make compatible with delay changes
m-bossart Mar 30, 2024
0f99dd4
simulation flow upgrades (re-use inputs and initial conditions)
m-bossart Apr 11, 2024
c7986b4
fix (simplify) simulation inputs flow
m-bossart Apr 16, 2024
291f4c7
append type to parameters of DynamicComponents
m-bossart Apr 17, 2024
b2b0607
sensitivity api (work in progress)
m-bossart Apr 24, 2024
4b71648
remove refs, handling user input, add docs
m-bossart Apr 30, 2024
cab8e2e
format
m-bossart Apr 30, 2024
94e9f65
add back refs for static and loads
m-bossart May 1, 2024
37d9ff9
add additional input in sensitivity api
m-bossart May 2, 2024
2b469ad
loosen tolerance on optimization result
m-bossart May 2, 2024
561954d
reduce tolerance on sensitivity test
m-bossart May 4, 2024
a80a9ce
not complete; start clean to revert some changes
m-bossart May 30, 2024
2635603
remove enable_sensitivity (passes test_case_OMIB)
m-bossart May 30, 2024
a0aef58
remove refs from dyn wrapper; add reactive_power field (OMIB passes)
m-bossart May 30, 2024
7c3bace
remove refs from StaticWrapper (test_case_OMIB passes)
m-bossart May 30, 2024
3047e39
handle refs for staticloadwrapper
m-bossart May 30, 2024
084977a
remove p_range formulation; pass dyn branch test (convert additional …
m-bossart May 31, 2024
c89e46a
remove CRC.@ignore_derivatives
m-bossart May 31, 2024
5fb081f
enzyme working without any initialization
m-bossart Jun 5, 2024
42c2103
add static_device to wrapper
m-bossart Jun 5, 2024
32d979f
4 tests passing
m-bossart Jun 7, 2024
3d6e18e
specify in place
m-bossart Jun 11, 2024
ca9eb9d
re-init working for OMIB case (H)
m-bossart Jun 11, 2024
bc26b91
make wrappers mutable
m-bossart Jun 11, 2024
7bf1f14
parameters that require reinitialization
m-bossart Jun 24, 2024
bfe7026
add simple test in Optimization problem
m-bossart Jun 24, 2024
38541f7
add degov; extend senseitivity to delays (incomplete, test still fails)
m-bossart Jun 24, 2024
c36759e
loosen enzyme loading requirements
m-bossart Jun 24, 2024
a2a305d
update enzyme (one bad release)
m-bossart Jun 24, 2024
8c5b547
passes test_base and test_enzyme
m-bossart Jun 24, 2024
57dca4b
update rev
m-bossart Jun 25, 2024
d9878ff
changes and convert models to pass surrogate tests
m-bossart Jun 25, 2024
068051e
revert change
m-bossart Jun 27, 2024
e2fe76f
remove td as parameter for degov
m-bossart Jun 30, 2024
96f64f3
loosen dispatch for common controls (for sensitivity compatibility)
m-bossart Jun 30, 2024
57cd61a
add avrs and tgs
m-bossart Jun 30, 2024
f4f9e73
add gensal gensae
m-bossart Jun 30, 2024
24ea509
more models (still debugging tests)
m-bossart Jul 1, 2024
beae601
more models; passes through test45 (except gast)
m-bossart Jul 2, 2024
9e671ab
small fix in pss
m-bossart Jul 2, 2024
3ec3bbd
use NLsolve (wrapped)
m-bossart Jul 2, 2024
4f570eb
sensitivity tests pass (no delays)
m-bossart Jul 2, 2024
4de5fb7
typo
m-bossart Jul 3, 2024
1f0a035
don't index parameter component array by symbol in cb
m-bossart Jul 3, 2024
9acd155
more model conversions
m-bossart Jul 10, 2024
a3bc682
loosen types on common controls
m-bossart Jul 10, 2024
a298340
add unique_timestamps
m-bossart Jul 10, 2024
8c7028f
add back Zygote option with simple test
m-bossart Jul 11, 2024
2fca627
remove single state restriction
m-bossart Jul 14, 2024
f7d464a
allow for voltage of bus in addition to device state
m-bossart Jul 16, 2024
70592ee
extend tests for multiple states
m-bossart Jul 16, 2024
0426bcf
add option for All parameters at once
m-bossart Jul 16, 2024
b1bd133
add SciMLSensitivity and sensealg for nl problem
m-bossart Jul 17, 2024
d01b094
remove sneaky closures in init
m-bossart Jul 18, 2024
38046e5
don't do full system nl solve
m-bossart Jul 18, 2024
d02f6db
add test for 9 bus and change values due to removing full system init
m-bossart Jul 18, 2024
4dd4dc0
add test that should pass with new cb api
m-bossart Jul 18, 2024
04e9d9e
test actual forward values
m-bossart Jul 18, 2024
41a5f24
take cb as input; fix bug from callbacks in problem with custom Enzym…
m-bossart Jul 19, 2024
b1a9350
option for reinitializing system
m-bossart Jul 21, 2024
8aa428f
add DuplicatedNoNeed dispatch
m-bossart Jul 21, 2024
793d765
add get_parameter_labels
m-bossart Jul 22, 2024
d78a3db
change api to take perturbations directly
m-bossart Jul 22, 2024
2911b5f
restore tests (pases without dev PowerSystems)
m-bossart Jul 22, 2024
6f3f023
pass p to loss function
m-bossart Aug 7, 2024
9b9514e
add option to force device_level
m-bossart Aug 7, 2024
9f2c38e
add dde tests
m-bossart Aug 10, 2024
c12582c
add functions for _get_refs to overload for surrogates
m-bossart Aug 12, 2024
f07655e
generalize get_setpoints
m-bossart Aug 14, 2024
9e6424b
workarounds for ml surrogates
m-bossart Aug 27, 2024
eb171d8
aux input to f_loss
m-bossart Sep 2, 2024
072a62b
convert some @errors to @warns
m-bossart Sep 4, 2024
b4b7bf9
parameter typo
m-bossart Sep 5, 2024
aabf6b8
allow for passing parameter labels directly
m-bossart Sep 8, 2024
31fc113
Merge branch 'main' into mb/differentiable
m-bossart Sep 23, 2024
db8fce6
fix Project.toml
m-bossart Sep 23, 2024
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
1 change: 1 addition & 0 deletions src/PowerSimulationsDynamics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -184,5 +184,6 @@ include("utils/immutable_dicts.jl")
include("utils/print.jl")
include("utils/kwargs_check.jl")
include("utils/logging.jl")
include("utils/parameters.jl")

end # module
4 changes: 4 additions & 0 deletions src/base/branch_wrapper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ struct BranchWrapper
bus_ix_to::Int
ix_range::Vector{Int}
ode_range::Vector{Int}
p_range::Vector{Int}
global_index::Base.ImmutableDict{Symbol, Int}
function BranchWrapper(
branch::PSY.DynamicBranch,
bus_ix_from::Int,
bus_ix_to::Int,
ix_range,
ode_range,
p_range,
sys_base_power,
sys_base_freq,
)
Expand All @@ -31,6 +33,7 @@ struct BranchWrapper
bus_ix_to,
ix_range,
ode_range,
p_range,
Base.ImmutableDict(Dict(branch_states .=> ix_range)...),
)
end
Expand All @@ -41,6 +44,7 @@ get_bus_ix_from(wrapper::BranchWrapper) = wrapper.bus_ix_from
get_bus_ix_to(wrapper::BranchWrapper) = wrapper.bus_ix_to
get_ix_range(wrapper::BranchWrapper) = wrapper.ix_range
get_ode_ouput_range(wrapper::BranchWrapper) = wrapper.ode_range
get_p_range(wrapper::BranchWrapper) = wrapper.p_range
get_global_index(wrapper::BranchWrapper) = wrapper.global_index
get_branch(wrapper::BranchWrapper) = wrapper.branch

Expand Down
8 changes: 8 additions & 0 deletions src/base/definitions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@ end
Base.to_index(ix::dq_ref) = Int(ix)
Base.to_index(ix::RI_ref) = Int(ix)

@enum ref_ix begin
Q_ref_ix = 1
V_ref_ix = 2
ω_ref_ix = 3
P_ref_ix = 4
end
Base.to_index(ix::ref_ix) = Int(ix)

const MAPPING_DICT = Dict{String, OrderedDict{Symbol, Int}}
const DEVICE_INTERNAL_MAPPING = Base.ImmutableDict{Int, Vector{Int}}

Expand Down
Loading