I have exported a model out of another modeling program (Milsoft's WindMil), and have successfully performed a load flow study in OpenDSS. I am trying to follow a tutorial I found to assign a daily load profile to the load. I have successfully imported the load profile (verified by plotting it), but can't seem to apply it to the load. I'm trying to apply it to a Load.dss file... is that okay, or does it need to be applied to individual load elements?
new loadshape.daily npts=24 interval=1.0 csvfile=demand_daily.txt
Redirect Load.dss daily=daily status=variable
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
So I first define the external file that I wish to reference for load as:
Redirect Load.dss
I then define a per unit scaler or multiplier for the load shape as:
new loadshape.daily npts=24 interval=1.0 csvfile=demand_daily.txt
And then I must assign the loadshape defined as "daily" to the referenced load file as:
Load.dss.daily=daily status=variable
When I do this however I receive an error that says
Error! Object "dss" not found
Load.dss.daily=daily status=variable
I might also not understand how to verify the solution. If I define the loadshape and load as:
new loadshape.daily npts=24 interval=1.0 csvfile=demand_daily.txt
Redirect Load.dss daily=daily status=variable
And then look at the exp_meters.csv file (from a previously defined meter at the source), I am given a single row of data at hour 24, and the data matches what I expect for peak conditions. Am I evaluating the results incorrectly, or am I still defining the load improperly?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I see now how to correct the meter... the action "take" must be removed to allow for each time snapshot to be captured. I am now returning results for each of 24 hours, but the load curve is not applied
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Load.DSS is the name of the file that I assume contains your Load definitions. It is not the name of a Load object. The error message is telling you that it can't find the object.
The object of a Redirect command is a file name. That file will contain definitions of circuit elements -- either all the same class or it could be all mixed up. Could also be a series of OpenDSS commands like a little subroutine. It is your choice. The input stream for OpenDSS is redirected to the specified file.
There are 3 types of sequential time simulations OpenDSS can perform: Daily, Yearly, and Dutycycle. The process is slightly different for the three. So Power Conversion (PC) elements that have loadshape following capabilities will have properties also named Daily, Yearly, and Dutycycle that are assigned to a Loadshape object to designate the Loadshape to be used for each simulation mode. It could be the same or a different Loadshape. Dutycycle is generally used for simulations having short time step sizes of 1 s to 1 minute.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
So if I have a file Load.dss that contains all of the load elements, can I assign a loadshape object in some way to the file, so that the load objects within the file take on that property? Or do I need to edit that Load.dss file directly?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You will assign the Daily, Yearly, and Duty properties of each load to a loadshape object. Could be the same object. Could a different one for each load for each type of analysis.
I can generally do it with my favorite editor fairly quickly or write a simple VBA routine to program it.
If you want to set all Daily properties to the same Loadshape object, you can do it with one command:
Batchedit Load..* Daily=Mydailyloadshape
The ".*" is a so-called "regular expression" borrowed from Perl, I believe, that will match the name of any Load object.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Roger,
I had a similar questions regarding the load shape property. I'm looking to run opendss using Matlab and provide different loading conditions to my loads by using the "daily" property.
new LoadShape.HouseLoad npts=24 interval=1.0
~ mult=(File=House_Load.csv) useactual=yes
new load.houseA1_1 bus1=subA_11_1.1.2
~ phases=1 conn=delta kv=0.240 kW=6 pf=1 daily=HouseLoad
The csv file itself is simply a file with 24 rows with different values, created on Matlab using:
Basically when I run the script on Matlab, I'm trying to modify the kW value of the load with those in the csv file. Is the kW property and the pf needed? Would this be able to accomplish my desiered task?
new load.houseA1_1 bus1=subA_11_1.1.2
~ phases=1 conn=delta kv=0.240 daily=HouseLoad
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
But I am getting an error i.e., "Unresolved reference 'feature' " .
Moreover, suppose error is resoolved and i solve the circuit after these lines. kvAR part of my loadshape will be changed or it will remain the same as in original .dss circuit whiich is being called in python.
Thank you
Regards,
Kirn
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
"Feature" is a MATLAB statement, not DSS. Is it also a Python statement? I don't know.
The statement is converting the default MATLAB 2-dimension array into a single dimension SafeArray to you can push the array back up to OpenDSS via COM. I was thinking this was not necessary in Python, but some readers more familiar with Python may wish to comment.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks Roger, I am new to opendss as well as python and did not know about feature command of MATLAB as well. I am struggling to change the load of my .dss file using python COM interface. I have defined load using load shape.
Can you please help?
If this topic has been discussed here before. If so, can you please share the link?
Thank you so much
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Otherwise, you can just use some python code as follows:
DSSLoadShapes=DSSCircuit.LoadShapes;DSSLoadShapes.First;# Activates first load shapeOldPmult=DSSLoadShapes.Pmult;myNewPmult=[]foriinrange(0,24):# generating random profilemyNewPmult.append(random.random())DSSLoadShapes.Pmult=myNewPmultDSSSolution.SolvePmult=DSSLoadShapes.Pmult;
Best regards
Davis
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi everyone. I created a model using Milsoft Windmil and successfully exported it to OpenDSS without errors. However, I cannot seem to load the model in OpenDSS-G. Attached is the error message. Maybe someone can explain the cause of the error. I am also including the master.dss script. Thanks for your help.
!-----Settings--------
Set EarthModel = Carson
Set %growth=0.000
Set maxiterations =1000
Set Maxcontroliter =1000
!-----Load Flow------
Set VoltageBases=[12.470765 24.941530]
calcv
Redirect setBaseKv.dss
Solve
Show Voltages LN Node
Show Powers kVA Elem
Show Currents Elem
!-----Fault Current------
/** Block Comment
Edit "Vsource.source" Pu=1.00000
set mode=fault
Solve
Show faults / end Block Comment
What version of DSS-G are you using? Also, I would remove the "Block comment part". During the import, DSS-G will execute everything in the source file. I would remove the following lines:
Show Voltages LN Node
Show Powers kVA Elem
Show Currents Elem
!-----Fault Current------
/** Block Comment
Edit "Vsource.source" Pu=1.00000
set mode=fault
Solve
Show faults
/ end Block Comment
!-----Plot Circuit ------
plot circuit quantity=voltage 1ph=3
plot circuit power Max=2000 dots=n labels=n subs=n C1=$00FF0000 1ph=3
Leaving just the buscoords nodecoords.csv declaration after the first solve.
Best regards,
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello Dr. Davis. I tried your suggestion but I still got the same error. Attached are the DSS files created thru Windmil. The master file has been modified upon your suggestion.
The only issue that I saw when trying to load the model into OpenDSS was that the source impedances were not valid as provided.
So, I changed the VSource to ideal (model=ideal) as attached and was able to solve the circuit in OpenDSS and perform a snapshot power flow. Here are the solved values from the circuit:
Max pu. voltage = 1.05
Min pu. voltage = 0.96842
Total Active Power: 0.472422 MW
Total Reactive Power: 0.284028 Mvar
If you want to add impedance back in to the source, please see the following help:
There may be other issues with the model. The WindMil export to OpenDSS is typically not perfect (in my experience). Particularly when the WindMil model is more complex.
I think you should be able to import the OpenDSS files (replacing the VSource.dss with the one attached) into OpenDSS-G.
Note that the latest OpenDSS-G has new capabilities to perform edits in a scripting window or in the graphical interface and the changes are propagated across from one to the other.
Hi. I tried your method to a much larger network. But I got the same error as before. Maybe you can suggest ways as to how to troubleshoot the possible cause of translation error. I am attaching the complete set exported from Windmil. Thanks in advance.
As you can see all R, X and C entries are zero. This is an issue with the WindMil exporter.
I suggest constructing the Rmatrix and Xmatrix (at least) and possibly the Cmatrix with values that are reasonable for a 2 phase #2ACSR (with neutral) line. You may be able to do this with other entries in the exported LineGeometry.dss file, as a guide.
Or you may want to use the linegeometry class in OpenDSS and construct the layout of the conductors (wires, x-coordinates, heights, number of phases, kron reduction or not, etc.). The following help for the linegeometry class in OpenDSS may be useful:
Then repeat the process of loading the master.dss file in OpenDSS and see what other error messages it provides. Once you have a valid set of OpenDSS files, then you can import them into OpenDSS-G.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have exported a model out of another modeling program (Milsoft's WindMil), and have successfully performed a load flow study in OpenDSS. I am trying to follow a tutorial I found to assign a daily load profile to the load. I have successfully imported the load profile (verified by plotting it), but can't seem to apply it to the load. I'm trying to apply it to a Load.dss file... is that okay, or does it need to be applied to individual load elements?
new loadshape.daily npts=24 interval=1.0 csvfile=demand_daily.txt
Redirect Load.dss daily=daily status=variable
You simply need to assign the loadshape to the Daily property of the load(s).
Load.dss.daily=daily
Redirect is not used in the manner you showed. That redirects input to a file.
Then do
Set mode=daily
Solve
or, simply
Solve mode=daily.
So I first define the external file that I wish to reference for load as:
Redirect Load.dss
I then define a per unit scaler or multiplier for the load shape as:
new loadshape.daily npts=24 interval=1.0 csvfile=demand_daily.txt
And then I must assign the loadshape defined as "daily" to the referenced load file as:
Load.dss.daily=daily status=variable
When I do this however I receive an error that says
Error! Object "dss" not found
Load.dss.daily=daily status=variable
I might also not understand how to verify the solution. If I define the loadshape and load as:
new loadshape.daily npts=24 interval=1.0 csvfile=demand_daily.txt
Redirect Load.dss daily=daily status=variable
And then look at the exp_meters.csv file (from a previously defined meter at the source), I am given a single row of data at hour 24, and the data matches what I expect for peak conditions. Am I evaluating the results incorrectly, or am I still defining the load improperly?
Below is the entire script if it would be of use to you. I am defining my loadshape and load under the "!----Load Shapes----" heading
Clear
New Circuit.Ash_Ridge_Substation
!----Call Other .dss Exported Files----
Redirect Vsource.dss
Redirect Transformer.dss
Redirect Reactor.dss
Redirect RegControl.dss
Redirect CNData.dss
Redirect WireData.dss
Redirect LineGeometry.dss
Redirect Line.dss
Redirect Generator.dss
Redirect Device.dss
!Redirect Load.dss
!-----Settings--------
Set EarthModel = Carson
Set %growth=0.000
Set maxiterations =20
Set Maxcontroliter =20
Set DefaultBaseFrequency=60
!----Meter Location Definitions----
new monitor.SS element=line.prug5115 terminal=1 mode=1 ppolar=no !P,Q monitor
new monitor.Vbb element=line.prug5115 terminal=2 mode=0 !V,I monitor
new energymeter.Grid element=line.prug5115 terminal=1 !Energy meter
!----Load Shapes----
new loadshape.daily npts=24 interval=1.0 csvfile=demand_daily.txt
Redirect Load.dss daily=daily status=variable
!-----Load Flow------
Set Mode = Daily
Set VoltageBases=[0.480000 12.470765]
calcv
Redirect setBaseKv.dss
Solve
!Show Voltages LN Node
!Show Powers kVA Elem
!Show Currents Elem
!-----Fault Current------
/** Block Comment
Edit "Vsource.source" Pu=1.00000
set mode=fault
Solve
Show faults / end Block Comment
!----Meter Data Output----
!monitor.SS.action=clear
monitor.SS.action=take
monitor.Vbb.action=take
energymeter.Grid.action=take
export monitors SS
export monitors Vbb
export meters
!-----Plot Circuit ------
buscoords nodecoords.csv
!plot circuit quantity=voltage 1ph=3
!plot circuit power Max=3000 dots=n labels=n subs=n C1=red 1ph=3
!Plot Loadshape Object=daily
!Show eventlog
!Plot Loadshape Object=Loadshape1
!----------------------------
I see now how to correct the meter... the action "take" must be removed to allow for each time snapshot to be captured. I am now returning results for each of 24 hours, but the load curve is not applied
Load.DSS is the name of the file that I assume contains your Load definitions. It is not the name of a Load object. The error message is telling you that it can't find the object.
The object of a Redirect command is a file name. That file will contain definitions of circuit elements -- either all the same class or it could be all mixed up. Could also be a series of OpenDSS commands like a little subroutine. It is your choice. The input stream for OpenDSS is redirected to the specified file.
There are 3 types of sequential time simulations OpenDSS can perform: Daily, Yearly, and Dutycycle. The process is slightly different for the three. So Power Conversion (PC) elements that have loadshape following capabilities will have properties also named Daily, Yearly, and Dutycycle that are assigned to a Loadshape object to designate the Loadshape to be used for each simulation mode. It could be the same or a different Loadshape. Dutycycle is generally used for simulations having short time step sizes of 1 s to 1 minute.
So if I have a file Load.dss that contains all of the load elements, can I assign a loadshape object in some way to the file, so that the load objects within the file take on that property? Or do I need to edit that Load.dss file directly?
You will assign the Daily, Yearly, and Duty properties of each load to a loadshape object. Could be the same object. Could a different one for each load for each type of analysis.
I can generally do it with my favorite editor fairly quickly or write a simple VBA routine to program it.
If you want to set all Daily properties to the same Loadshape object, you can do it with one command:
The ".*" is a so-called "regular expression" borrowed from Perl, I believe, that will match the name of any Load object.
Hi Roger,
I had a similar questions regarding the load shape property. I'm looking to run opendss using Matlab and provide different loading conditions to my loads by using the "daily" property.
The csv file itself is simply a file with 24 rows with different values, created on Matlab using:
Basically when I run the script on Matlab, I'm trying to modify the kW value of the load with those in the csv file. Is the kW property and the pf needed? Would this be able to accomplish my desiered task?
Hi Team,
I am trying to change kVAR of Loadshap using Qmult in python com interface. These lines are from COM Help.
DSSLoadShapes = dssCircuit.LoadShapes
i = DSSLoadShapes.First
myMult = DSSLoadShapes.Qmult
feature('COM_SafeArraySingleDim',1)
DSSLoadShapes.Qmult = (myMult*0.9)
But I am getting an error i.e., "Unresolved reference 'feature' " .
Moreover, suppose error is resoolved and i solve the circuit after these lines. kvAR part of my loadshape will be changed or it will remain the same as in original .dss circuit whiich is being called in python.
Thank you
Regards,
Kirn
"Feature" is a MATLAB statement, not DSS. Is it also a Python statement? I don't know.
The statement is converting the default MATLAB 2-dimension array into a single dimension SafeArray to you can push the array back up to OpenDSS via COM. I was thinking this was not necessary in Python, but some readers more familiar with Python may wish to comment.
Thanks Roger, I am new to opendss as well as python and did not know about feature command of MATLAB as well. I am struggling to change the load of my .dss file using python COM interface. I have defined load using load shape.
Can you please help?
If this topic has been discussed here before. If so, can you please share the link?
Thank you so much
Hello,
There are different approaches for solving this problem, one is the classical approach using the text interface:
https://sourceforge.net/p/electricdss/discussion/861976/thread/d2fcba36/
Otherwise, you can just use some python code as follows:
Best regards
Davis
Thanks a lot Davis!
Hi everyone. I created a model using Milsoft Windmil and successfully exported it to OpenDSS without errors. However, I cannot seem to load the model in OpenDSS-G. Attached is the error message. Maybe someone can explain the cause of the error. I am also including the master.dss script. Thanks for your help.
Clear
New Circuit.SRC1
Redirect Vsource.dss
Redirect Transformer.dss
Redirect RegControl.dss
Redirect WireData.dss
Redirect LineGeometry.dss
Redirect Line.dss
Redirect Load.dss
!-----Settings--------
Set EarthModel = Carson
Set %growth=0.000
Set maxiterations =1000
Set Maxcontroliter =1000
!-----Load Flow------
Set VoltageBases=[12.470765 24.941530]
calcv
Redirect setBaseKv.dss
Solve
Show Voltages LN Node
Show Powers kVA Elem
Show Currents Elem
!-----Fault Current------
/** Block Comment
Edit "Vsource.source" Pu=1.00000
set mode=fault
Solve
Show faults
/ end Block Comment
!-----Plot Circuit ------
buscoords nodecoords.csv
plot circuit quantity=voltage 1ph=3
plot circuit power Max=2000 dots=n labels=n subs=n C1=$00FF0000 1ph=3
!----------------------------
Hello,
What version of DSS-G are you using? Also, I would remove the "Block comment part". During the import, DSS-G will execute everything in the source file. I would remove the following lines:
Leaving just the buscoords nodecoords.csv declaration after the first solve.
Best regards,
Hello Dr. Davis. I tried your suggestion but I still got the same error. Attached are the DSS files created thru Windmil. The master file has been modified upon your suggestion.
By the way, I am using Version 6.0.0.2. Thank you.
I tried to load it again without using preview and I got this message instead:
Last edit: jeffsman 2024-10-31
Thank you for sending the files.
The only issue that I saw when trying to load the model into OpenDSS was that the source impedances were not valid as provided.
So, I changed the VSource to ideal (model=ideal) as attached and was able to solve the circuit in OpenDSS and perform a snapshot power flow. Here are the solved values from the circuit:
Max pu. voltage = 1.05
Min pu. voltage = 0.96842
Total Active Power: 0.472422 MW
Total Reactive Power: 0.284028 Mvar
If you want to add impedance back in to the source, please see the following help:
https://opendss.epri.com/Vsource.html
There may be other issues with the model. The WindMil export to OpenDSS is typically not perfect (in my experience). Particularly when the WindMil model is more complex.
I think you should be able to import the OpenDSS files (replacing the VSource.dss with the one attached) into OpenDSS-G.
Note that the latest OpenDSS-G has new capabilities to perform edits in a scripting window or in the graphical interface and the changes are propagated across from one to the other.
Thank you very much! The model works now in OpenDSS-G. I will try it on other models and see what happens.
Hi. I tried your method to a much larger network. But I got the same error as before. Maybe you can suggest ways as to how to troubleshoot the possible cause of translation error. I am attaching the complete set exported from Windmil. Thanks in advance.
Do you have OpenDSS installed? If not, I suggest installing it from:
https://sourceforge.net/projects/electricdss/
At present it gives more information about the errors in the circuit files that will help troubleshoot those issues.
I will show some steps to troubleshoot the first issue, and then leave it to you to find and fix the that issue and the rest of the issues:
Loading in the master file (with all the other files in the same subdirectory), I see the following initial error in OpenDSS:
Error Description:
Matrix Inversion Error for Line "oh106"
Probable Cause:
Invalid impedance specified. Replaced with tiny conductance.
Looking in the Line.dss file, I search for "oh106" line and see the following:
There's nothing wrong here, the length is a reasonable number of feet (not a zero-length line).
So then looking in the LineGeometry.dss file for the LineCode (that's where the WindMil exporter stores both linecodes and linegeometries) called:
And here is what I find for that line code name:
As you can see all R, X and C entries are zero. This is an issue with the WindMil exporter.
I suggest constructing the Rmatrix and Xmatrix (at least) and possibly the Cmatrix with values that are reasonable for a 2 phase #2ACSR (with neutral) line. You may be able to do this with other entries in the exported LineGeometry.dss file, as a guide.
Or you may want to use the linegeometry class in OpenDSS and construct the layout of the conductors (wires, x-coordinates, heights, number of phases, kron reduction or not, etc.). The following help for the linegeometry class in OpenDSS may be useful:
https://opendss.epri.com/LineGeometry.html
Then repeat the process of loading the master.dss file in OpenDSS and see what other error messages it provides. Once you have a valid set of OpenDSS files, then you can import them into OpenDSS-G.
Hello @wsunderm1. Sorry for the very late rely. I will try your suggestions.. Thank you very much.