Skip to content

Clear bus_hvdc_net_power in clear_injection_data!#395

Closed
luke-kiernan wants to merge 1 commit into
mainfrom
lk/clear-hvdc-net-power
Closed

Clear bus_hvdc_net_power in clear_injection_data!#395
luke-kiernan wants to merge 1 commit into
mainfrom
lk/clear-hvdc-net-power

Conversation

@luke-kiernan

Copy link
Copy Markdown
Collaborator

Zero bus_hvdc_net_power each solve, alongside the other injection fields, so construction-time native HVDC setpoints don't double-count and per-solve writes don't accumulate.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Performance Results

Precompile Time

Main This Branch Delta
2.456 s 2.389 s -2.7%

Solve Time

Polar AC

Test Main This Branch Delta
NewtonRaphsonACPowerFlow First Solve 15.178 s 15.819 s +4.2%
NewtonRaphsonACPowerFlow Second Solve 78.1 ms 78.7 ms +0.8%
RobustHomotopyPowerFlow First Solve 15.948 s 16.386 s +2.7%
RobustHomotopyPowerFlow Second Solve 9.115 s 8.7 s -4.5%
NewtonRaphsonACPowerFlow(iwamoto) First Solve 194.9 ms 199.3 ms +2.3%
NewtonRaphsonACPowerFlow(iwamoto) Second Solve 78.6 ms 499.8 ms +535.9%
TrustRegionACPowerFlow(iwamoto) First Solve 2.227 s 1.69 s -24.1%
TrustRegionACPowerFlow(iwamoto) Second Solve 78.2 ms 77.8 ms -0.5%
NewtonRaphsonACPowerFlow First Solve 1.005 s 1.097 s +9.2%
NewtonRaphsonACPowerFlow Second Solve 1.002 s 1.017 s +1.4%
TrustRegionACPowerFlow First Solve 1.106 s 1.471 s +33.0%
TrustRegionACPowerFlow Second Solve 952.9 ms 998.2 ms +4.8%

Rectangular CI

Test Main This Branch Delta
ACRectangularPowerFlow{NR} First Solve 5.46 s 5.12 s -6.2%
ACRectangularPowerFlow{NR} Second Solve 40.2 ms 38.3 ms -4.7%
ACRectangularPowerFlow{NR}(iwamoto) First Solve 160.8 ms 159.4 ms -0.9%
ACRectangularPowerFlow{NR}(iwamoto) Second Solve 38.2 ms 38.8 ms +1.5%
ACRectangularPowerFlow{TR} First Solve 5.782 s 5.626 s -2.7%
ACRectangularPowerFlow{TR} Second Solve 40.5 ms 40.0 ms -1.3%
ACRectangularPowerFlow{TR}(iwamoto_fallback) First Solve 163.4 ms 160.3 ms -1.9%
ACRectangularPowerFlow{TR}(iwamoto_fallback) Second Solve 56.8 ms 40.0 ms -29.5%

Mixed CPB

Test Main This Branch Delta
ACMixedPowerFlow{NR} First Solve 5.06 s 5.478 s +8.3%
ACMixedPowerFlow{NR} Second Solve 41.4 ms 40.9 ms -1.1%
ACMixedPowerFlow{NR}(iwamoto) First Solve 259.3 ms 161.3 ms -37.8%
ACMixedPowerFlow{NR}(iwamoto) Second Solve 41.5 ms 41.2 ms -0.8%
ACMixedPowerFlow{TR} First Solve 5.263 s 5.114 s -2.8%
ACMixedPowerFlow{TR} Second Solve 42.3 ms 42.0 ms -0.8%
ACMixedPowerFlow{TR}(iwamoto_fallback) First Solve 163.3 ms 162.2 ms -0.7%
ACMixedPowerFlow{TR}(iwamoto_fallback) Second Solve 61.7 ms 42.5 ms -31.1%
ACMixedPowerFlow{LM} First Solve 7.366 s 7.033 s -4.5%
ACMixedPowerFlow{LM} Second Solve 916.7 ms 904.6 ms -1.3%

DC

Test Main This Branch Delta
DCPowerFlow First Solve 3.826 s 3.849 s +0.6%
DCPowerFlow Second Solve 14.3 ms 14.2 ms -0.4%
PTDFDCPowerFlow First Solve 1.542 s 1.527 s -0.9%
PTDFDCPowerFlow Second Solve 66.7 ms 64.1 ms -3.9%
vPTDFDCPowerFlow First Solve 6.212 s 6.369 s +2.5%
vPTDFDCPowerFlow Second Solve 4.196 s 4.305 s +2.6%
DCPowerFlow First Solve 174.3 ms 193.1 ms +10.8%
DCPowerFlow Second Solve 173.7 ms 184.1 ms +6.0%

@jd-lara

jd-lara commented Jun 19, 2026

Copy link
Copy Markdown
Member

unconditionally zeroing it inside clear_injection_data! introduces a silent regression in the DC PF, so I'm proposing we close this in favor of handling the reset on the PowerSimulations side in Sienna-Platform/PowerSimulations.jl#1637

I tested the fix on the Argentina system too and corrected the issues found

@jd-lara jd-lara closed this Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants