Data Manager
10.9 Spreadsheet Format Data Import/Export
The “DZ"-file will be analyzed and error messages will be displayed when the file is not a genuine PowerFactory data file, or if it is corrupted. If the file format has been found to be correct, a dialogue will appear which shows the data and version of the file. The default target folder is shown also, which is the original folder of the saved data. If this is not desired, another target folder can be selected by pressing theDrop Down button. This button will bring a small version of the database tree. A new target folder can be selected from this tree.
10.8.1 Notes
By exporting a folder from the database, only the information in that folder and all its subfolders will be stored. If the exported objects use information (e.g. power system types like line or transformer types) that is saved somewhere else, then that information will not be stored. Make sure that the used power system types and all other referenced information is exported too.
When importing a file that contains objects which use data outside the import-file, a search for that data is started.
For instance, assume a project is exported. One of the line-models uses a type from a library outside the project. When exporting, the path and name of this type is written in the export-file, but the type itself is not exported, as is does not reside in the exported project.
At importing, the stored path and name of the ’external’ type is used to find the type again and to restore the link. However, if the ’external’ type is not found, then it will be created, using the stored path and name. Of course, the created object has default data, as the original data was not exported.
Additionally, an error message is written to the output window.
Suppose that you are working with a large library, which is stored in a special user-account to make it read-only. The library is made accessible by sharing it to all users.
When export the projects, the objects from the external library are not exported. However, a colleague which has access to the same library may still import your projects without problems. The external objects used in your projects will be found in the same location, and the links to these objects will be correctly restored.
10.9 Spreadsheet Format Data Import/Export
The PowerFactory data browser in the data manager’s window looks and acts like a spreadsheet pro-gram as far as creating and editing power system objects is concerned. To enable and simplify the use of power system element data which is stored in spreadsheet programs such as the Microsoft Excel or the Lotus 123 programs, the data browser offers ’Spreadsheet Format’ import and export facilities.
10.9.1 Export to Spreadsheet Programs (e. g. MS EXCEL)
All data visible in the data browser may be exported as it is. The export format is such that most common spreadsheet programs can read in the data directly (space separated ASCII). Exporting data is performed as follows.
• Select a range of data in the data browser. Such a range may contain more than one column and more than one row.
• Right-click the selected range.
• Now you have different options:
– If you want to copy the content of the marked cells only, simply select Copy from the context-sensitive menu.
– If you want to copy the content of the marked cells together with a description header, select the Spread Sheet Format option. This opens a second menu which offers the choice between writing the Spreadsheet export to a file (Write to File), or to put it on the Windows Clipboard (Copy (with column headers)). See Figure10.9.1.
• The exported data can now be imported into a Spreadsheet program. When the Clipboard was used, using the Paste option of the spreadsheet program or pressing Ctrl-V will Paste the data into the spreadsheet.
• The imported data may now be edited, or additional calculations may be made. The PowerFactory data is imported as numbers and descriptions. The example in Figure10.9.2calculates a mean value from a range of line loading percentages.
Figure 10.9.1: Exporting a range of data
10.9. SPREADSHEET FORMAT DATA IMPORT/EXPORT
Figure 10.9.2: Imported data in a spreadsheet program
10.9.2 Import from Spreadsheet Programs (e. g. MS EXCEL)
There are two methods available for importing data from a spreadsheet program. The first method uses a direct import of ’anonymous’ numerical data, i. e. of the values stored in the cells of the table. This method is used to change parameter of existing objects by importing columns of parameter values.
The second method can be used to create new objects (or replace whole objects) by importing all the data from a spreadsheet.
Any range of parameter values can be copied from a spreadsheet program and imported into the database manager. The import is performed by overwriting existing parameter values by ’anonymous’
values. The term ’anonymous’ expresses the fact that the imported data has no parameter description.
The size of the imported value range and the required data are tested. Importing invalid values (i.e. a power factor of 1.56) will result in an error message.
Spreadsheet Import of Values
The import of values (anonymous variables), i. e. cells of a table, is explained by the following example.
In Figure10.9.3, a range of active and reactive power values is copied in a spreadsheet program. In Figure 10.9.4, this range is pasted to the corresponding fields of 6 load objects by right-clicking the upper left most field which is to be overwritten. The result of this action is shown in Figure10.9.5.
In contrast to the import of whole objects, the anonymous import of data does not need a parameter description. This would complicate the import of complete objects, as the user would have to enter all parameters in the correct order.
Figure 10.9.3: Copying a range of spreadsheet data
Figure 10.9.4: Pasting spreadsheet data from clipboard
Figure 10.9.5: Database browser with imported data
Spreadsheet Import of Objects and Parameters
With this kind of import, it is possible to import whole objects (in contrast to the import of pure values, which is described above). The object import uses a header line with the parameter names (which is necessary in addition to the cells with the pure values). This header must have the following structure:
• The first header must be the class name of the listed objects.
• The following headers must state a correct parameter name.
This is shown in Figure10.9.6.
10.9. SPREADSHEET FORMAT DATA IMPORT/EXPORT
Figure 10.9.6: DExcel required format
Figure 10.9.7 shows an example of valid spreadsheet data of some line types and some 2-winding transformer types.
Figure 10.9.7: Example of valid spreadsheet data
The import of the spreadsheet data into PowerFactory is performed as follows.
• Select the header line and one or more objects lines.
• Copy the selection. See Figure10.9.8for example.
• Right-click the folder browser in the database manager to which the objects are to be imported.
Select Spread Sheet Format → Import Objects from Clipboard. See Figure10.9.9for example.
Figure 10.9.8: Selecting object data in spreadsheet
Figure 10.9.9: Importing objects from clipboard
The result of the object import depend on whether or not objects of the imported class and with the imported names already exist or not in the database folder. In the example of Figure10.9.10, none of the imported objects existed in the database an all were created new therefore. The example shows the database in detail mode.
Figure 10.9.10: Result of spreadsheet object import
Note: New objects are created in the PowerFactory database folder only when no object of the imported class and with the imported name is found in that folder. If such an object is found then its data will be overwritten by the imported data
Because new objects are only created when they do not exist already, and only the imported parameters are overwritten when the object did exists already, the import is always a save action.
Remarks Object Names
Object names may not contain any of the characters
*? =" , ∖ ∼ |
10.9. SPREADSHEET FORMAT DATA IMPORT/EXPORT
Default Data
When an imported object is created newly, the imported data is used to overwrite the correspond-ing default data. All parameters that are not imported will keep their default value.
Units
The spreadsheet values are imported without units. No conversion from MW to kW, for exam-ple, will be possible. All spreadsheet values therefore have to be in the same units as used by PowerFactory.
Chapter 11
Study Cases
11.1 Introduction
The concept of Study Cases was introduced in Chapter 4 (PowerFactory Overview). Study Cases (IntCase, ) define the studies to be performed in the modelled system. They store all the definitions created by the user to perform calculations, allowing the easy reproduction of results even after the deactivation of the project. By means of the objects stored inside them objects the program recognizes:
• The parts of the network model (grids and expansion stages) to be considered for calculation.
• The calculations (and their settings) to be performed over the selected parts of the network.
• The study time.
• The active variations.
• The active operation scenario.
• The calculation results to be stored for reporting.
• The graphics to be displayed during the study.
A study case with a reference to at least one grid or expansion stage has to be activated in order to enable calculations. A project that contains more than one grid, which has several expansion stages for design alternatives, or which uses different operation scenarios to model the various conditions under which the system should operate, requires multiple study cases. All the study cases of a project are stored inside the ’Study Cases’ folder ( ) in the project directory.
Note: Only one study case can be active. When activating a study case, all the grids, variations and operation scenarios that it refers become active.
Without study cases, it would be necessary to manually activate the correct grid and/or expansion stage over and over again in order to analyze the resulting power system configuration. Similarly, it would be necessary to define over and over again the same calculation command setup used to analyze the behaviour of the selected network.
Besides storing the objects that define a network study, study case objects set the output units for the performed calculations and allow the definition of certain calculation options for the solving algorithms.
The following sections describe the main objects stored inside the study cases, as mentioned before they are used to define the network studies. For information about defining and working with study cases please refer to Section11.2(Creating and Using Study Cases).