Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
ITCPG.jl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julian Stuermer
ITCPG.jl
Commits
e9f891ea
Commit
e9f891ea
authored
4 years ago
by
Julian Stürmer
Browse files
Options
Downloads
Patches
Plain Diff
Add NLsolve as method for power flow calculation
parent
73423502
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/PowerFlow.jl
+14
-8
14 additions, 8 deletions
src/PowerFlow.jl
with
14 additions
and
8 deletions
src/PowerFlow.jl
+
14
−
8
View file @
e9f891ea
...
...
@@ -53,12 +53,19 @@ end
Calculates the AC power flow solution for the given NDD and updates it in the NDD.
CAUTION: Overwrites any previous AC solution contained in the NDD!
=#
function
calc_ac_pf!
(
network_data
::
Dict
{
String
,
<:
Any
})
### Calculate AC-PF solution using PowerModels.jl and Ipopt
pf_result
=
run_ac_pf
(
network_data
,
optimizer_with_attributes
(
Ipopt
.
Optimizer
,
"print_level"
=>
0
)
)
function
calc_ac_pf!
(
network_data
::
Dict
{
String
,
<:
Any
},
method
=:
JuMP
)
if
method
==
:
JuMP
# calculate AC-PF solution using a JuMP model
pf_result
=
run_ac_pf
(
network_data
,
optimizer_with_attributes
(
Ipopt
.
Optimizer
,
"print_level"
=>
0
)
)
elseif
method
==
:
NLsolve
# calculate AC-PF solution using NLsolve.jl
pf_result
=
Dict
{
String
,
Any
}()
pf_result
[
"solution"
]
=
compute_ac_pf
(
network_data
)
else
throw
(
ArgumentError
(
"Unknown method
$
method."
))
end
update_pf_data!
(
network_data
,
pf_result
,
model
=:
ac
)
# update PF in NDD
return
network_data
end
...
...
@@ -121,8 +128,7 @@ function calc_branchloads!(network_data::Dict{String,<:Any}; model=:ac)
end
update_data!
(
network_data
,
branchloads
)
# add branchloads to NDD
return
branchloads
return
nothing
end
#*------------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment