Welcome to LightSim2Grid’s documentation!
LightSim2Grid is a simulator that can be used to accelerate the computation (leading to approximately the same results) when using the Grid2Op platform.
It is a port in c++ of some part of the excellent PandaPower package to make the computation faster.
As from version 0.3.0:
LightSimBackend is available on windows (you don’t need to compile KLU anymore)
LightSimBackend is compatible with the “pickle” library, so you can use it with multiprocessing on windows, and with frameworks that requires it (for example ray rllib).
As from version 0.5.3:
lightsim2grid is available on pypi, you can install it (on windows, macos and linux) with pip install lighsim2grid
Quickstart
Benchmarkings
Technical Documentation (work in progress)
This is a work in progress at the moment
Technical Documentation
- LSGrid module
- Installation from source
- LightSimBackend
- Available powerflow algorithms
- Types of powerflow algorithms
- Linear-solver diagnostics:
LinearSolverStats - Retrying a failed refactor:
NRRefactorRetry_* - KLU with a static-pivot refactorization:
*_KLUStaticPivot - Ordering for the rows the outer loops switch:
constrained_ordering - Default algorithm selection
- Correspondence between class and
AlgorithmTypeenum - Usage
- Fine-tuning the Newton-Raphson iteration
- Detailed API
- Naming conventions: “solver” vs “algorithm”
- OpenLoadFlow’s outer loops: the
NROuter_*algorithms - Physical limits and controls a solution does not apply
- Islands, the main component and the distributed slack
- Result arrays: views, copies and the lifetime of the grid
- Time Series
- Contingency Analysis
- Scenario Sweep
- Light environment
- Continuation Power Flow
- Differentiable powerflow (pytorch)
- Using lightsim2grid as a C++ library
- External Algorithm Plugins
- Fast binary serialization (
save_binary/load_binary) - Security and trust boundaries
- The short version
- Pickle, plugins and grid2op environments are trusted-input-only by design
- The binary format is the least dangerous channel
check_grid(): whole-grid consistency validation- The memory-safety invariant: raise, never corrupt
- Methods ending in
_internal: your own responsibility - A note for solver-plugin authors