ANL-CEEESA / UnitCommitment.jl

Optimization package for the Security-Constrained Unit Commitment Problem
Other
104 stars 24 forks source link

Interface #44

Open hejun0524 opened 1 year ago

hejun0524 commented 1 year ago
  1. Edited doc.
  2. source code:
    • read.jl, structs.jl, build.jl add interfaces
    • interface.jl adds constraints & objective to the model
    • line.jl, sensitivity.jl add the interface ISF
    • slice.jl adds interface slicing
    • solution.jl reports transmission line flows and interface flows
  3. new tests:
    • 4 json.gz added (one of them is the storage benchmark test case which I forgot to merge to prev PR).
    • slice, sensitivity, read, interface optimization
    • storage optimization
  4. 8 other test files: replaced Cbc with HiGHS
hejun0524 commented 1 year ago

The commit replace for loops with matrices changed the solution.jl by calculating the bus injection matrix of size $B \times T$ first, and then using the ISF matrix (size $L \times (B-1)$ ) to get the line flow matrix. Using the matrix slicing we can get all non-slack buses' net injection.

  1. For lines, the calculation gives $[L \times (B-1)] \times [(B-1) \times T] = L \times T$
  2. For interfaces, the calculation gives $[I \times (B-1)] \times [(B-1) \times T] = I \times T$

Then the code constructs the dictionary by directly assigning each row to the corresponding line/interface name. I have manually compared the results by running the old code with nested for-loops and this updated matrix version, and the results were the same.