This module looks for all signals of the selected component throughout all simulated scenarios. In other words, the program goes through all *.mat files generated by run_sim (recall, one per scenario) and collects all signals for the same component into a single file.
The chosen format to export the results for all scenarios is *.hdf5 This data structure allows for hierarchical data organization, which is the same methodology employed by Modelica to export simulation results. The proposed hieararchy for organizing the simulation data for all scenarios is shown below. For each scenario, the time vector or time stamps are stored. This is required because the simulations may not complete the specified time window in sim_parameters_pc.yaml depending on whether numerical integration was completed or not (i.e., whether the system was stable or not after the occurrence of an event). In such unstable cases, the simulation can be interrupted by the solver before the final simulation time specified in the configuration settings.
Likewise, the eigenvalues obtained after the initial- and final-condition linearization are also stored for each scenario. Finally, the signals that are indicated by the user are also appended under the level of hierarchy of a single scenario. The *.hdf5 file is stored using the name of the model, the date of the execution, and a unique UUID so that the extract module can be executed several times to get different signals from a simulation batch. The structure is sketched below:
<scenario_number>/time
<scenario_number>/eigs/initial
<scenario_number>/eigs/final
<scenario_number>/<component>/<signal>
A pictorial example of such data hierarchy is shown in the Figure below.
First, we run the extract module after having executed a batch of simulations on the IEEE14 model using run_sim:
python main.py extract --tool dymola --model IEEE14The command prompt output is presented next:
---------------------------------------------
Summary for time-domain simulation data extraction
---------------------------------------------
Model name IEEE14
Tool dymola
Please enter a component type:
1. Bus
2. Line
3. Generator
Component type:
Depending on the component selection, different options become available. For instance, if signals of a generator are of interest, the program asks the user which of the machines in the model is to be considered first. In the case of the previous example (with the IEEE14 model), five machines are available. By selecting one machine, the user would have access to the active and reactive power outputs of the machine, and the signals inside the control systems as well as the internal states of the conventional generator.
Component type: 3
Extracting generator signals
List of available machines:
1. gen_Bus_1_1
2. gen_Bus_2_1
3. gen_Bus_3_1
4. gen_Bus_6_1
5. gen_Bus_8_1
Assume the goal of the user is to extract the Power System Stabilizer (PSS) output from the control system of the generator at bus 2. Because generator at bus 2 is of interest, 2 is inputted.
Afterward, the code lists down the available signals for extraction. This list varies depending on the class of the component. For our example, since a generator has several components inside it (such as the synchronous machine model, the exciter, and the turbine governor system), the program gives an option to navigate inside the signals embedded in the different blocks of the generator model. For our goal, this is the correct selection so 3 is given as an input. In the next prompt, the user must select the component of interest (that is, pSS2A). The last user prompt concerns the selection of the signal of interest: VOTHSG.
Finally, the program prints a summary of the extraction process, including a unique file ID (in blue) that has the name of the model, the component being extracted, the date on which the code was executed, and a unique identifier. If the user is interested in getting more signals from the simulation batch, extract must be run again.


