OpenDSS Training Material
Last update: 1st Dec 2022
The training material below has been designed for power engineering students (undergraduate and postgraduate), power engineers, researchers, consultants, etc. It requires coding knowledge - of course! But not too advanced. If you are a decent coder, you will manage ;-)
Enjoy! And share the knowledge!
OpenDSS For Beginners
Presentations and Files to Run Simple Simulations
We have put together training material (presentations and files to run simulations) designed to give you a quick exposure to:
time-series analyses of distribution networks (critical for studies involving solar PV, electric vehicles, etc.); and,
the use of the COM server via MS Excel VBA and Python (which will facilitate more complex studies).
This training material, all available on Research Gate, has multiple parts (listed below) that should be done sequentially. Each of them has a presentation. In addition, from part 3, there are also files for you to run your own simulations according to the examples. Since this material is for beginners, the examples consider very simple MV and LV networks. Nonetheless, the OpenDSS implementation aspects that will be learned can be generalised to any distribution network.
State-of-the-Art Modelling of Distribution Networks
This preso will give you an introduction to challenges faced by distribution companies due to the uptake of distributed energy resources and why it is important to have adequate models when investigating impacts and solutions.
This preso is a general intro to OpenDSS, what it is, key features, etc.
Simple MV Network (and here are the files to practice)
With this preso, we start the hands-on training. You will learn important modelling considerations of OpenDSS, put together a simple MV network, and run basic hourly time-series analyses involving OLTCs and a generator.
LV Networks 3ph+n (and here are the files to practice)
This preso moves the hands-on training to the LV part. Here you will model single-phase houses and play with minute-by-minute time-series analyses involving solar PV.
OpenDSS via Excel VBA and COM (and here are the files to practice)
OpenDSS is great. But even better when we drive it from a more flexible environment (also known as co-simulation). With this preso, you will learn how to do so from MS Excel VBA using the COM interface. More importantly, you will learn how to do basic control of elements or participants in the network. All using Excel!
OpenDSS via Python and COM (and here are the files to practice)
The serious research starts with Python :-) This preso will show you how to drive OpenDSS using Python and do the basic control from the previous part. You will also learn how to improve performance when dealing with the COM interface.
Advanced Analysis (and here are the files to practice)
This preso takes the analysis of solar PV and LV networks to a slightly more advanced level. Here you will learn how to carry out more realistic analyses using multiple residential demand profiles, multiple solar PV generation profiles, and a real LV circuit (aka feeder) from the UK. This is done with Excel VBA but the principles apply to Python or any other programming language.
PV Inverter Functions (and here are the files to practice)
With this preso, you will learn how to use the PV inverter functions (which are common these days) embedded in OpenDSS.
All the training material can also be found in this Research Gate project: https://www.researchgate.net/project/OpenDSS-Training-Material.
Note: Since OpenDSS continues to evolve (thanks EPRI!), the content above might not necessarily consider the latest functionality. But the principles will be similar :-)
Once you go through the material above, you can move on to more sophisticated uses of OpenDSS, driving it through Python, using the native dss_python, and applying all of this to realistic case studies. More info in the next section.
Advanced OpenDSS Applications: DER Hosting Capacity
GitHub Repositories to carry out detailed DER Hosting Capacity Studies
To really see the power of OpenDSS in action, you need to use it for specific distribution network studies. We have put together advanced training material focusing on DER Hosting Capacity, using realistic low voltage (LV) and medium voltage (MV) networks as well as time-series demand and DER profiles.
For these tutorials, we are using GitHub repositories and Jupyter Notebook - which enables running Python code on an interface that also provides explanations. So, once you have all installed on your laptop/PC, you will be able to run the Python code we have created for DER Hosting Capacity using our realistic case studies.
This repo is the first step as it shows you how to use dss_python, a Python-native alternative to the COM interface used by OpenDSS.
Time-Series Analysis of Three-Phase Unbalanced LV Networks
With this repo, you will gain more understanding of the characteristics and behaviour of residential, three-phase LV distribution networks, specifically, using a realistic LV circuit (aka feeder) from Australia with 31 single-phase customers (houses) and a pool of time-series demand and PV generation profiles. You will also understand the simulation process necessary to study different solar PV penetration levels and assess the corresponding voltage rise and/or asset congestion issues. Finally, you will understand how to determine the solar PV hosting capacity of LV networks.
Some Tips
How to use OpenDSS more effectively
Using the Redirect Command
When writing significant volumes of code (e.g., for a big network) it is advisable to be organised and use the 'redirect' command. Basically, you can at any point in the main code redirect it to a TXT file containing more code. For instance, you can have a line stating "Redirect Lines.txt" in which the file "Lines.txt" (in the same path as the main code) will contain all the info re the lines.
Note that if the main code (containing redirects) is to be compiled externally (e.g., from Excel VBA or Matlab) then it should be a TXT file as well - not a DSS file.
Modifying Parameters of Network Elements
Although most parameters of network elements are accessible via the COM interface, in some cases this is not possible. An alternative to this is via the use of the Active Circuit Element (only to certain parameters, for instance "enabled"). You need first to define a variable and assign it to the CktElement interface sometime after you start things up. That would be something like
DSSElement = DSSObj.ActiveCircuit.ActiveCktElement
Then whenever you select, for instance, a load by whatever means (such as looping through the Loads collection), you can just use the command below when you get to one you want to disable.
DSSElement.Enabled=false
Also note that if the changes you want to do to a parameter is for all the corresponding elements in a circuit, then you can use the BatchEdit command. Here an example for the ZIPV of all loads.
DSSText.Command = [‘Batchedit Load..* ZIPV=[‘ num2str(num1) num2str(num2) … etc… num2str(num7) ‘]’ ]
Voltage Impact Analysis or Control - Be careful with the default voltages for loads and generators (Vmaxpu and Vminpu)
For loads the default values of Vmaxpu and Vminpu are 1.05 and 0.95, beyond these values the load model reverts to a constant impedance model. A similar default condition (but with different values) exists for generators. If you are carrying out voltage impact analysis or voltage control then it is crucial to set this values beyond what you are expecting to have as problems (e.g., Vmaxpu=1.15 and Vminpu=0.85). In this way you ensure the load or generator models you originally adopted are not reverted to constant impedance.
LV Networks (three phases plus neutral)
The neutral can be explicitly model in OpenDSS (see Training Material part 4). By doing this it is possible to place monitors (e.g., for the neutral currents). This, however, creates another problem: voltages monitored will be line-to-ground rather than line-to-neutral. So, unless it is necessary, it's better to avoid explicitly defining the neutral.
Note that not defining the neutral does not mean that OpenDSS does not consider it. If positive-sequence impedances (derived from four-wire cables) are provided, then it will automatically create the 4x4 matrices and compute the effects of the neutral. The phase voltage results will be line-to-neutral voltages (which is what we want).
Transformers and Taps
OpenDSS considers the impedance changes due to taps. The transformer object assumes the same percent impedance (%Z) for all tap positions on a 2-winding transformer. However, the ohmic impedance will be different looking into the winding assumed to have the taps. The ohmic value changes proportional to the %Z but by the square of the tap.
Doing research on LV Networks?
Links to real LV network models and time-series profiles
As part of the "Low Voltage Network Solutions" Project funded by ENWL in the UK and completed in 2014, we made available 25 real residential, underground UK LV networks fully modelled in OpenDSS, including large sets of time-series profiles of demand and low carbon technologies (e.g., PV, EVs, EHPs, uCHP). For the corresponding documentation and files use the links below.