GridOPTICS / GridPACK

https://www.gridpack.org/
44 stars 20 forks source link

Discussion: LARGE_MATRIX #149

Open abhyshr opened 1 year ago

abhyshr commented 1 year ago

Flag LARGE_MATRIX used in power flow. What is it? Why is it used? Is it necessary to use it? What performance advantages does it offer for large matrices? @bjpalmer @wperkins

abhyshr commented 1 year ago

Is it documented in the manual?

bjpalmer commented 1 year ago

When we originally implemented powerflow, we experimented with making every bus contribute a 2x2 block, even if it only had 1 or 0 variables associated with it. For the missing variables, we set the diagonal element to 1 and the off-diagonal elements to zero so that they didn't interact with actual variables. Later on, we fixed up the implementation so that only the variables that appear in the problem are added to the matrix. The LARGE_MATRIX symbol allowed you to switch between the representations. I think @chenyousu could tell you more about it.

abhyshr commented 1 year ago

Was there a reason to use preprocessor flag instead of a run-time option? This seems to be a good case for using run-time option. Regardless, I am not sure if both these versions should be retained.

bjpalmer commented 1 year ago

I'm not sure if it is even worth retaining it as a runtime option, especially since we have not been using it for a while. I think the reason we originally had both versions was so we had a way of stress-testing the mapper (regular sized blocks vs irregular sized blocks).