Command line simulation
The instruction run-simulation will execute a simulation given existing definition files. The results are a PVsyst report, or a CSV output file.
The PVsystCLI simulation is fully equivalent to running a PVsyst simulation from the project window.
Preparing required files
The run-simulation command will run in the context of a given workspace and on a pre-existing project. This means that it is necessary to prepare in the desired workspace all necessary files.
Preparing a workspace
The easiest is to use a pre-existing PVsyst workspace. However it is also easy to create the necessary folder structure manually.
Project, variant, and other definitions
Currently the only way is to create these with PVsyst. When obtained from elsewhere however, it is possible to just paste the PRJ and VC* files in the Projects
workspace subfolder.
Note however that projects usually need extra files to run. Typical examples are PAN and OND files, each with their place in the workspace organisation: ComposPV/PVmodules
and ComposPV/Inverters
.
Finally, a project is bound to a given site, or SIT file. You may therefore need prepare the site in the Sites
workspace subfolder.
Input weather data (optional)
While projects are created in PVsyst with a default MET file containing weather data, it is possible to swap MET files when using PVsystCLI.
MET files do not need to be prepared within PVsyst, but can be prepared with PVsystCLI starting from raw CSV data, with the command convert-meteo.
Other optional files
Using PVsyst, you can prepare SFI and RVT files which define the contents of the results output file. While RVT files specify only variables, SFI files contain more information relating to formatting.
Use cases
Example 1: Running a large number of simulations
The basic use case is running several simulations for pre-existing projects variants and weather files. One example may be simply automating processes to handle several systems at a time.
Another example may be going through many existing projects and variants after a PVsyst update, to generate updated results and reports. Indeed, projects and variants are usually readable in later versions of PVsyst.
ScriptsBat\02_Demo_PVsystCLI_FromCSV.bat
Example 2: Pseudo-sub-hourly simulation
Sub-hourly simulations can be approximated with the pseudo-sub-hourly simulation procedure. This consists in splitting data based on the minute time stamps, and running the simulation separately for each group.
The first part consists in preparing weather data. This step is described in the Converting weather page.
Once all MET files have been created, PVsystCLI can then help automate the large number of simulations. There is one simulation per minute stamp, meaning that the number of required simulations can go up to 60 (for minute-level data) per year of data and per variant.
It is crucial to generate a CSV output file at each run. The individual CSV files for each minute stamp should then be combined to reconstruct the complete simulated time series.
ScriptsPython\04_Demo_PVsystCLI_PseudoSubHourly.py
ScriptsR\04_Demo_PVsystCLI_PseudoSubHourly.R
Example 3: Performance testing
Performance testing relies on a MET file obtained from measurement data. The generation of the MET file can also be handled with PVsystCLI (Converting weather). The simulations can then be run with PVsystCLI.
The IEC61724-2 standard for capacity testing recommends collecting 1-minute data, which allows to gather more data in the short time usually allocated for these tests. This increases the statistical significance of the test. To simulate the sub-hourly output of the system, it is therefore possible to leverage the (pseudo-sub-hourly simulation) procedure.
Example 4: Monitoring
With an corresponding generation of MET files, it is possible to run simulations on the fly with the most recent MET file. The simulation output is a CSV file, which can be parsed and compared to corresponding recent measurements of DC or AC power. Discrepancies above a certain level may trigger a warning.
ScriptsBat\03_Demo_PVsystCLI_NextDayForecast.bat
ScriptsPython\03_Demo_PVsystCLI_NextDayForecast.py
ScriptsR\05_PlanProdCompare.qmd
Output
Output CSV
Based on the RVT or SFI specifications, PVsyst will create a CSV output that contains several simulation variables.
PVsyst report
This is equivalent to the standard PVsyst report. Since report options are stored in the PRJ file, it is possible to retain customisations defined in PVsyst.