Setup
Most of the integrations require the relevant software to be installed and licensed on the system. As some of the software is only available for Windows, instructions are tested on Windows 10 and 11 only. The tested versions of the software are listed below.
Software |
Version |
|---|---|
Python |
3.10 |
Matlab |
R2022b |
Simulink |
10.7 |
Simscape |
5.5/Electrical 7.9 |
RSCAD FX |
1.2 |
PowerFactory |
2022 SP2 |
Installation
To install this project, perform the following steps:
Clone the project repository
cdinto the cloned directoryInstall Python 3.10
Create a virtual environment with
<path to python 3.10>/python -m venv <path to virtual environment>Activate the virtual environment with
<path to virtual environment>\Scripts\activate.bator<path to virtual environment>\Scripts\activate.ps1
For Basic Usage
pip install .orpip install -e .to install the project editable.
For Development
pip install .[dev]orpip install -e .[dev]to install the project editable.pre-commit installto install the pre-commit hooks.
VS Code Recommended Extensions
The following extensions are recommended for VS Code:
Python (Microsoft)
Black Formatter (Microsoft)
Extension Pack for Restructured Text (lextudio)
Mypy (Matan Gover)
Pylint (Microsoft)
autoDocstring - Python Docstring Generator (Nils Werner)
Matlab
Install the current Matlab version and the Simulink, Simscape and Simscape Electrical add-ons. The integration is provided by a pip package, no further configuration should be required. However, the package is not included in the default installation as not all users have the required Matlab license.
Use pip install .[simscape] to install the pinned version of the matlabengine package.
If this version does not match your installed version of Matlab, use pip install matlabengine==<version> to install the appropriate version.
Note
matlabengine is the pip package that provides the integration with Matlab. Each version of matlabengine typically supports one specific version of MATLAB and requires one of the versions of Python current at release of the package. Please check compatibility at PyPI before upgrading.
matlabengine is pinned to 9.13.9 to support Matlab R2022b and Python 3.11.4.
RSCAD FX / pyapi_rts
The integration is provided by the pyapi_rts package, RSCAD FX does not need to be installed. pyapi_rts might need additional configuration before use, please consult the relevant documentation. Please also check compatibility with your version of RSCAD FX.
PowerFactory
PowerFactory requires the path to the module to be added to the python environment. Different methods are available to do this, the following have been tested:
In your Python environment, e.g.
C:\Users\USERNAME\.conda\envs\ENVNAMEIn the directory
Lib\site-packagesAdd a file called
powerfactory.pthwith the location of the required PowerFactory Python library in a single line - e.g.C:\Program Files\DIgSILENT\PowerFactory 2022\Python\3.10
eASiMOV
eASiMOV does not need to be installed for the integration to work. Compatibility is tested with the version mentioned above, but other versions might work as well.