Breakthrough-Energy / PowerSimData

Simulation framework
https://breakthrough-energy.github.io/docs/
MIT License
50 stars 40 forks source link

Manage capacity expansion model (CEM) simulation data #640

Open danielolsen opened 2 years ago

danielolsen commented 2 years ago

:rocket:

Describe the workflow you want to enable

I wish I could customize a capacity expansion model (CEM) simulation, send the prepared information to a remote server (or container) where it will be solved, and then have all relevant inputs and outputs be accessible to everyone with server access through a simple user interface. There three tasks roughly correspond to the existing Create, Execute, and Analyze states of the existing Scenario object, which is designed to manage the information for a production cost model (PCM). The interface for managing and running CEM simulations could be an analogous user-facing class, containing child objects which perform more specific tasks (these could also be analogous to the existing Scenario child classes).

Describe your proposed implementation

Customization includes:

Once customization is complete, preparing the information would generate a unique ID for this simulation, apply the specified customizations and then create the required input files that can be run with a CEM tool and upload them to the appropriate place on the remote server. For PyPSA, this could be a pickled Network object; for Switch, this could be a set of CSVs; etc. The user would then be able to launch the CEM process on the server, specifying any additional information about the solution process (e.g. the solver to be used, the number of threads, etc.). There may also be a post-simulation step to transform the results into a format that's more standardized, to be able to more easily retrieve data from simulations which may have been run using different CEM tools. These 'launching' and 'extraction' functions may live in separate repositories which are thin wrappers around each CEM tool, e.g. SwitchWrapper, PyPSAWrapper, etc.

Once the simulation is complete, the user would be able to instantiate an object using the Scenario ID, and this object would be an interface to all relevant input and output information (retrieving each from the local machine or transferring from the remote server as applicable). This information would include:

Relevant sub-tasks

This list may be incomplete.

danielolsen commented 2 years ago

Here's a crude diagram of how we might enable user input in the Create state (blue boxes) as well as process the data during Execute state to produce a Network object (orange boxes). I've broken up the three top-level bullets for customization into three different data structures/objects, but this is only one potential design and we may want to rethink the user interface and the internal data storage. image