-
Notifications
You must be signed in to change notification settings - Fork 10
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
PowerFlows.jl unified develop
branch
#53
base: main
Are you sure you want to change the base?
Conversation
Those sections being
Add fields to `PowerFlowEvaluationModel`s to support further PSI integration
Move reimporting code to PowerSystems, refine metadata format, misc code cleanup
) | ||
|
||
# Shapes to reuse | ||
zeros_bus_time = () -> zeros(Float64, n_buses, time_steps) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need to have anonymous functions do this. The compiler can't infer this until call time. Just use zeros(Float64, n_buses, time_steps)
src/newton_ac_powerflow.jl
Outdated
data.bus_angles[pq, t] .= angle.(V[pq]) | ||
data.bus_angles[pv, t] .= angle.(V[pv]) | ||
else | ||
data.bus_activepower_injection[:, t] .= NaN64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you just use NaN
@@ -270,7 +258,7 @@ function _power_redistribution_ref( | |||
@debug "Remaining residual $q_residual, $(PSY.get_name(bus))" | |||
p_set_point = PSY.get_active_power(device) + p_residual | |||
PSY.set_active_power!(device, p_set_point) | |||
p_limits = PSY.get_reactive_power_limits(device) | |||
p_limits = get_reactive_power_limits_for_power_flow(device) # TODO should this be active_power_limits? It was reactive in the existing codebase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has to be active yes
src/ac_power_flow_jacobian.jl
Outdated
@@ -24,18 +24,19 @@ function PolarPowerFlowJacobian(data::ACPowerFlowData, x0::Vector{Float64}) | |||
end | |||
|
|||
function _create_jacobian_matrix_structure(data::ACPowerFlowData) | |||
time_step = 1 # TODO placeholder time_step |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolution: the NLSolve implementation of AC power flow does not support multi period, so @rbolgaryn will implement code to throw an error if the user tries to do that, and then all these time_step
placeholders can be deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now, it is not even possible that the NLSolve is used with multiperiod power flow (see below). I think we can just safely remove it without raising an error.
# Multiperiod power flow
function solve_powerflow!(
data::ACPowerFlowData;
kwargs...,
)
pf = ACPowerFlow() # todo: somehow store in data which PF to use (see issue #50)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
time_step can remain in the functions because it is possible to provide time_step as an optional input to set which time step to use for the data
The
hrgks/psse_exporter_psy4
branch has become a unifieddevelop
-type branch for lots of new PowerFlows.jl functionality. It now contains the PSS/E exporter implementation as well as some new power flow implementations from @rbolgaryn. Pull requests include:PowerFlowData
fields for multi-period AC PF #78plus some more commits only in this branch.