Skip to content
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

Find a good way to test results for multi-period AC power flow calculation #99

Open
rbolgaryn opened this issue Feb 17, 2025 · 0 comments
Assignees
Labels
wontfix This will not be worked on

Comments

@rbolgaryn
Copy link
Contributor

The easiest way would be to fully implement the calculation using the time series data in sys.

Best to test results using two different approaches.

Refers to this test:

@testset "MULTI-PERIOD power flows evaluation: NR" for ACSolver in
                                                       (
    NLSolveACPowerFlow,
    KLUACPowerFlow,
    PowerFlows.LUACPowerFlow,
)
    # get system
    sys = PSB.build_system(PSB.PSITestSystems, "c_sys14"; add_forecasts = false)

    # create structure for multi-period case
    pf = ACPowerFlow(ACSolver)
    time_steps = 24
    data = PowerFlowData(pf, sys; time_steps = time_steps)

    # allocate timeseries data from csv
    prepare_ts_data!(data, time_steps)

    # get power flows with NR KLU method and write results
    solve_powerflow!(data; pf = pf)

    # check results
    # for t in 1:length(data.timestep_map)
    #     res_t = solve_powerflow(pf, sys, t)  # does not work - ts data not set in sys
    #     flow_ft = res_t["flow_results"].P_from_to
    #     flow_tf = res_t["flow_results"].P_to_from
    #     ts_flow_ft = results[data.timestep_map[t]]["flow_results"].P_from_to
    #     ts_flow_tf = results[data.timestep_map[t]]["flow_results"].P_to_from
    #     @test isapprox(ts_flow_ft, flow_ft, atol = 1e-9)
    #     @test isapprox(ts_flow_tf, flow_tf, atol = 1e-9)
    # end
end
@rbolgaryn rbolgaryn added the wontfix This will not be worked on label Feb 17, 2025
@rbolgaryn rbolgaryn self-assigned this Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant