Closed mzy2240 closed 1 year ago
Hello,
This is a nice news.
By any chance, would you have the time to make a pull request to include it ? I will unfortunately not have the time to do it in 2022. The code example are: https://github.com/BDonnot/lightsim2grid/blob/master/src/NICSLUSolver.h and https://github.com/BDonnot/lightsim2grid/blob/master/src/NICSLUSolver.cpp
This should be relatively quick to do if the new method is similar to NICSLU (which I suspect if CKTSO is the successor of NICSLU)
In any case, thanks for the information.
Benjamin
Hello
I did all the "glue" code to make the cktso linear available, see the branch cktso
(https://github.com/BDonnot/lightsim2grid/tree/cktso and the file https://github.com/BDonnot/lightsim2grid/blob/cktso/src/CKTSOSolver.cpp) but unfortunately, i did not manage to make it work due to error when solving linear system (error code -2: argument error
) when the software tries to solve the linear system even with the small case14 network (which works well for KLU and the default linear solver in Eigen)
You can reproduce it by running the test python3 test_CKTSOSolver.py
in lightsim2grid/tests after compilation.
I am not familiar with it maybe you can see what I did wrong ?
@chenxm1986 Hi Dr. Chen, do you have any idea why there is argument error for this thin wrapper?
If you want i can provide you with the ai, ap and ax of the matrix and the coefficients of the vector b if that can help you.
Hello
I did all the "glue" code to make the cktso linear available, see the branch
cktso
(https://github.com/BDonnot/lightsim2grid/tree/cktso and the file https://github.com/BDonnot/lightsim2grid/blob/cktso/src/CKTSOSolver.cpp) but unfortunately, i did not manage to make it work due to error when solving linear system (error code-2: argument error
) when the software tries to solve the linear system even with the small case14 network (which works well for KLU and the default linear solver in Eigen)You can reproduce it by running the test
python3 test_CKTSOSolver.py
in lightsim2grid/tests after compilation.I am not familiar with it maybe you can see what I did wrong ?
-2 typically means that some argument is null. Which function returns -2?
It seems that before Solve the vector x is not allocated?
Hello,
Thank you very much for the quick reply. I will double check thanks for the hint.
The same code works when I use KLU or NICSLU (last time I checked, a few months ago). I would be surprised if the x
argument were to be un initialized in case of cktso. But for sure I will double check and let you know asap.
Thanks
I found another small issue. Please do not delete iparm[] and oparm[]. The just point to internal arrays and cktso will delete them when the handle is destroyed.
Ok i'll modify this, thanks
Hello,
You were correct on every aspect:
x
to be uninitialized (causing the -2 return error in CKTSO)Thanks a lot, it all seems to work and i'll include it in the next release (i need to do a bit of documentation)
CKTSO is the successor of NICSLU, with better performance. Support of CKTSO should be beneficial for pushing the computing of power flow to the next level.