How hallvar-h/tops works
Main Components
• Simulator Core: Represent the engine that handles the dynamic simulation routines (e.g., src/tops/dynamic.py, src/tops/simulator.py).
• Dynamic Models Module: Highlight the collection of power system component models used in dynamic simulations. This includes the models for generators, loads, governors, exciters, etc. – found under src/tops/dyn_models.
• Power System Models (ps_models): A separate set of exemplary power system network models (such as IEEE 39, IEEE 68, k2a, etc.) located in src/tops/ps_models, used for simulation scenarios.
• Solvers: Include both the standard solvers (src/tops/solvers.py) and the SDE (stochastic differential equation) solvers (src/tops/solvers_sde.py), which are key to time stepping and solution of simulation equations.
• Data Handling & Utility Modules: Components for plotting (src/tops/plotting.py), utility functions, and any other helper routines.
• Testing Framework: Although not part of the runtime architecture, illustrating the tests subdirectory helps capture the project’s focus on validation and quality, reflecting its research orientation.
• CI/CD Components: Optionally include the GitHub workflows shown under .github/workflows as part of the overall development infrastructure.
Component Relationships and Flow
• Data/Input Flow: Show how simulation parameters, network topologies, and initial conditions (possibly described in the examples or passed during runtime) feed into the simulator core.
• Solver Integration: Demonstrate the connection between the simulator core and the numerical solvers – indicating data exchange during timestep resolution.
• Output/Visualization: Represent the plotting functions and interfaces (examples/interfaces, plotting.py) that transform simulation outputs into visualizations, handled also by example notebooks.
• Extensibility via User Models: Outline how user-extended models (found in examples/user_models) plug into the simulation framework.
• Testing & Validation Loop: Optionally, include a separate testing block that validates simulation outcomes using provided test data (from tests/test_validation).
Architectural Patterns & Essential Design Elements
• Modular Design: The project is organized into clearly separated modules (dynamic, models, solvers, etc.). Emphasize these modules as independent components that interact through well-defined interfaces.
• Research and Experimentation Flexibility: Since the README notes experimental features, highlight extension points such as user models and experimental solvers.
• Technology Stack: Note that lightweight Python libraries (numpy, scipy, pandas, matplotlib) are used throughout.