Team Status report for 4/20

Overall progress:

The webapp is showing continued improvement through better visuals and more charts.

The machine learning pipeline is further improved, with increased accuracy for load forecasting using a different ML method.

Optimization is not converging for some specific cases but showing correct behavior for partially charged operation. Validation and testing are still being performed on each period and the multi-period problem.

Significant risks and risk management:

Risk:  Slow convergence of across multiple epochs

Description:  The multi-period DDP algorithm is not converging over multiple periods due to oscillations through the back-propagation of the battery SOC equality constraint lambda.

Severity: The convergence issue means the algorithm takes too long to test effectively on different test cases and is a high-severity issue.

Resolution: To fix the underlying issue, I will analyze the behavior of the DDP using simple testcases and if no immediate solution is found, I will borrow existing known working DDP code.

Alby’s Status Report for 4/20

Accomplishments This Week:

  • Added IO functionality to support multi-period specific testcases.
  • Built a residual visualizer to verify battery constraints met at each period.
  • Added validation function to test generation and load mismatch and calculate line losses.

Challenges Encountered:

  • Multi-period optimizer is converging slowly and showing incorrect behavior due to errors in the DDP process. These oscillations are preventing battery from behaving correctly when fully discharged, but correct behavior is observed during operation when partially charged.

Next Steps:

  • Investigate multi-period convergence across multiple epochs
  • Produce more example grid models to test the webapp

Individual Question:

Because my optimization code is incredibly complex, it became necessary to learn how to properly debug in python. I started using the PDB debugging tool and writing debug functions. One of the most useful debugging methods I learnt was assessing my intermediate results visually through plotting by asking chatgpt to write plotting functions.

Alby’s status report for April 6th

Accomplishments This Week:

  • Setup submodule repo for sugar and updated EC2 instance with latest version of code to allow other non-linux team members to run easier.

Challenges Encountered:

  • Multi-period optimizer is converging slowly and showing unintuitive behavior.
  • Line-powers are still incorrect by a factor of 2

Next Steps:

  • Investigate multi-period convergence across multiple epochs
  • Produce more example grid models to test the webapp
  • Further test the modifications of PQ loads to find limits
  • Fix line-power bug

Team Status Report for April 6

Overall progress:

The webapp has been successfully integrated with the optimization pipeline. The machine learning pipeline was improved with better accuracy.

Significant risks and risk management:

Risk:  Slow convergence of across multiple epochs

Description:  The multi-period DDP algorithm is converging with the correct direction but extremely slowly. Furthermore, the battery is slightly violating its constraints at certain time periods.

Severity: The convergence issue means the algorithm takes too long to test effectively on different test cases and is a high-severity issue.

Resolution: To fix the underlying issue, I will implement multiple tests that simplify the testcase to 2 epochs and aim to produce the expected behavior. I will then analyze the relevant battery equation gradients at each period using my plotting program and verify correct behavior. I will use the errors in the outputs to identify the underlying cause and then analyze the code to locate and fix the issue.

Changes to the existing design:

There are currently no significant changes to the existing design.

Changes to the project schedule:

The optimization verification testing is behind schedule by 2 weeks due to the convergence issue, and more intense work will be needed.

Alby’s Status Report for Mar 30

Accomplishments This Week:

  • Migrate all optimization code to a github submodule to clean up file hierarchy and simplify programming pipeline through a mirrored repo that fetches from the CMU SUGAR-D gitlab repo.
  • Added line-power functions to lines class and verified correct scaling with changes in load

Challenges Encountered:

  • Battery lambda gradient no longer converges with correct Lb equation stamp due to numerical tolerance issues.
  • Line-powers are incorrect by a factor of 2
  • Created an output function that generates a datastructure containing relevant optimization outputs for each period across all epochs.
    • line powers
    • generation powers
    • total generation
    • total cost
    • maximum and minimum voltages
    • battery state of charge
    • battery charge rate

Next Steps:

  • Fix numerical tolerance issues and investigate multi-period convergence across multiple epochs
  • Produce more example grid models to test the webapp
  • Further test the modifications of PQ loads to find limits

Alby’s Status Report for Mar 23

Accomplishments This Week:

  • Added renewable generators as negative PQ loads within the grid models and verified correct modification of powers at each period.
  • Rewrote battery Lb and Bt equation stamps to explicitly define all terms and avoid confusion from cancelled out terms.
  • Added the codebase to an EC2 instance and setup a working optimizer environment
  • Created a parser wrapper script that provides a dictionary of the grid model for easy accessibility by the web app.

Challenges Encountered:

  • Battery lambda gradient no longer converges with correct Lb equation stamp due to numerical tolerance issues.

Next Steps:

  • Fix numerical tolerance issues and investigate multi-period convergence across multiple epochs
  • Produce more example grid models to test the webapp
  • Further test the modifications of PQ loads to find limits
  • Add line-current/power functions to lines class, add stamps to infeasibility, and verify correctness by running a simulation with changing powers
  • Create an output function that generates a datastructure containing relevant optimization outputs for each period.
    • line powers
    • generation powers
    • total generation
    • total cost
    • maximum and minimum voltages
    • battery state of charge
    • battery charge rate

Alby’s Status Report for Mar 15

Accomplishments This Week:

  • Added battery equality constraint dual variable feedback into multi-period solver, verified correctly updated across epochs through a “folded in” backward pass.

Challenges Encountered:

  • Battery lambda gradient is slow to converge due to large step between epochs

Next Steps:

  • Rewrite battery Lb and Bt equation stamps to explicitly define all terms and avoid confusion from cancelled out terms
  • Create a GLD file with specifically labeled negative PQ loads for Solar and Wind generators.
  • Add to Multi.py a method to modify renewable PQ loads at each time step based on load factors.

Alby’s Status Report for Feb 23

Accomplishments:

  • Updated Multiperiod class to extract the SOC variable and related constraint dual variables during each iteration. I ran for 15 periods and battery SOC decreased linearly as expected until depletion.
  • With latest battery model, SUGAR3 converges with a depleted battery SOC.
  • Added previous solution initialization to the multiperiod class, which decreases solve times by 3X for each period after the initial one.

Progress Reflection:

  • Multi-period is developing smoothly in cooperation with the Pileggi group battery model. I am happy with my progress, but I need to understand DDP better and how the algorithm converges across multiple epochs

Next Weeks Goals:

  • Understand DDP, talk with Aayush
  • Add renewable generation as negative PQ loads within the GLD file with a nominal power modified by a specific capacity factor each period.
  • Validate single period solutions using a Grid-lab D testcase for 2bus network – talk with Elizabeth.

Convergence!

Alby’s Status Report for Feb 17

Accomplishments:

  • incorporated feedback from proposal presentation into design presentation:
    • made a full system block diagram
    • made a optimization algorithm process chart
  • verified multi-period class interacts correctly with SUGAR3 InfeasabilityAnalysis class during the main DDP loop

Progress Reflection:

  • Didn’t meet last week goals because of an update to the battery model by the development team that made me wait until a stable build.
  • Need to work closer with development team to understand how to best work on evolving codebase

Next Week’s Goals:

  • change slack and SOC variables to class variables in battery class each period and run the inner loop for 2 periods. Then check battery SOC variable from results and verify it correctly changes – it should discharge all in the first period.

Alby’s Status Report – Feb 10

Accomplishments:

  • presented the project proposal and received good feedback.
  • made a first rough draft of the multi-period code architecture
  • implemented a simple multi-period class that runs sugar3 at each time step with specified input load

Progress Reflection:

  • met with my research advisor to discuss the next steps in building the multi-period optimization tool – need to focus more on getting initial results than polishing codebase.
  • need to speed up my work to get results soon and uncover any initial convergence issues

Next Week’s Goals:

  • test multi-period class is changing loads correctly by seeing changes in slack bus power
  • change slack and SOC variables to class variables in Batteries.py and run the inner loop for 2 periods, check battery SOC variable and verify it correctly changes