Hello,
I have a doubt with loadshape in a daily simulation.
When i try to run this script i get no power to the loads. Have I made some mistakes? Can someone help me?
Thank you.
Here's my script:
// Per il plot profile
New Energymeter.em1 line.L1
New Energymeter.em2 line.L2
New Energymeter.em3 line.L3
New Energymeter.em4 line.L4
New monitor.N3a load.loadN3a mode=0
Set voltagebases=(0.4)
CalcVoltageBases
Solve mode=daily stepsize=1.0h number=24
Show monitor object=N3a
plot profile
Show powers
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dear Saran Satsangi,
Thank you very much for your answer. I saw that you defined loadshape but then you didn't use them it in load definition: "New Load.670c Bus1=670.3 Phases=1 Conn=Wye Model=1 kV=2.4 kW=117 kvar=68 "
How could it works?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dear Saran,
where & how do we define PQmult?
It is not mentioned in pdf file. Btw I am doing power flow for IEEE 123 bus system for 24 hrs (1 hour interval). For me everything (eg Transformer, regulators position) is same as in IEEE 123 system except 24 hrs load data.
This is how I am writing in MATLAB.
%%%%%%%%%%%%%%%%%
clear all;
clc;
DSSObj = actxserver('OpenDSSEngine.DSS');
if ~DSSObj.Start(0),
disp('Unable to start the OpenDSS Engine');
return
end
DSSText = DSSObj.Text; % Used for all text interfacing from matlab to opendss
DSSCircuit = DSSObj.ActiveCircuit; % active circuit
DSSText.Command='Compile (C:\Program Files\OpenDSS\IEEETestCases\123Bus\IEEE123Master.dss)';
%%%%%%%%%
% DSSText.Command='solve mode=snap';
% DSSText.Command='solve';
% DSSText.Command='Export Losses';
% DSSText.Command='Export Voltages';
% DSSText.Command='Export Currents';
%%%%%%%%%%
DSSText.Command='batchedit load..* Vmin=0.8'; % Set Vmin so that load model property will remain same
DSSTransformers=DSSCircuit.Transformers;
DSSText.Command='New EnergyMeter.Main Line.L115 1';% Energy meter
nt=24*1;
TimeArray=1:nt;
DSSText.Command='set mode=daily stepsize=1h number=1';
DSSText.Command='set hour=0';
for i=1:nt
DSSText.Command='get hour';
hour=DSSText.Result;
DSSText.Command='Solve';
SystemLosses(i,:)=(DSSCircuit.Losses)/1000;
% %%% Line Losses
LineLosses(i,:)=DSSCircuit.Linelosses;
% %%%% Transformer Losses
%
TranLosses(i,:)=SystemLosses(i,:)-LineLosses(i,:);
%
% %%%% Voltage Magnitude in p.u. for 24-hours can be obtained in this way
V1pu(i,:)=DSSCircuit.AllNodeVmagPUByPhase(1);
V2pu(i,:)=DSSCircuit.AllNodeVmagPUByPhase(2);
V3pu(i,:)=DSSCircuit.AllNodeVmagPUByPhase(3);
DSSText.Command='show current';
DSSText.Command='Export Meter';
end
%%%%%%%%%%%%%%%%%%%%%%%
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you for the videos. I have watched these. Actually, I can't edit anything in IEEE 123 system files (access denied). So, only through MATLAB I can do. Loadshape I came to know that using this feature I can run load flow for 24 hours. Your videos tells how to do it in OpenDSS but i need it in MATLAB.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello Abhimanyu,
You might have found issues to edit the content of the IEEE123 test system because of the file location in your system. You can copy the model from the installation folder to any other location (e.g. My Documents), and you should be able to edit the content without issues.
Best regards.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dear Miguel,
Thank you very much. This solves my editing problem. You can't believe how big it was for me. Rest of the things hopefully I will complete after learning already asked questions in this forum.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I have created a new file with the following code in OpenDSS and kept that file in same folder with other relevant files. It shows error in opening CSVFile.
Clear
redirect IEEE123Master.dss
! The following are the modification of IEEE123
Couple of changes I made but still same error is there.
Changes I made: Export monitor after solve command
in setDailyLoadshape.DSS file, replaced 'default' by 'day'
What is happening is that, by using the command "Show powers" you're asking OpenDSS to show the sequential powers (positive, negative and zero sequence), which doesn't apply for single-phase elements (like your loads).
Try to use "Show Powers kva Elements" instead.
Another thing that I noticed is that you set the load's parameter "status" to fixed. It means that the loadshape will be ignored, is that really what you want?
Hope it helps!!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I have a doubt with loadshape in a daily simulation.
When i try to run this script i get no power to the loads. Have I made some mistakes? Can someone help me?
Thank you.
Here's my script:
Clear
New circuit.Simulazione3
basekv=0.4 pu=1.05 angle=0 frequency=50 phases=3
set Basefrequency=50
//Linecode
New linecode.LineaTipo1 Nphases=3 Units=km
~ rmatrix=[0.211 0.049 0.049 | 0.049 0.211 0.049 | 0.049 0.049 0.211]
~ xmatrix=[0.747 0.673 0.651 | 0.673 0.747 0.673 | 0.651 0.673 0.747]
//Linee
New Line.L1 Phases=3 Bus1=SourceBus Bus2=2 LineCode=LineaTipo1 Length=150 Units=m
New Line.L2 Phases=3 Bus1=SourceBus Bus2=3 LineCode=LineaTipo1 Length=100 Units=m
New Line.L3 Phases=3 Bus1=SourceBus Bus2=6 LineCode=LineaTipo1 Length=100 Units=m
New Line.L4 Phases=3 Bus1=SourceBus Bus2=8 LineCode=LineaTipo1 Length=100 Units=m
New Line.L5 Phases=3 Bus1=3 Bus2=4 LineCode=LineaTipo1 Length=70 Units=m
New Line.L6 Phases=3 Bus1=4 Bus2=5 LineCode=LineaTipo1 Length=90 Units=m
New Line.L7 Phases=3 Bus1=6 Bus2=7 LineCode=LineaTipo1 Length=80 Units=m
//Carichi
new loadshape.day 24 1.0
~ mult=(0.1 0.1 0.1 0.1 0.1 0.1 0.8 0.8 0.8 0.8 1 1 0.8 0.8 1 1 0.8 0.8 0.8 0.1 0.1 0.1 0.1 0.1)
plot loadshape object=day
new load.loadN3a bus1=8.1 kv=0.230 kw=20 pf=0.98 Phases=1 model=1 class=1 daily=day status=fixed
new load.loadN3b bus1=8.2 kv=0.230 kw=15 pf=0.98 Phases=1 model=1 class=1 daily=day status=fixed
new load.loadN3c bus1=8.3 kv=0.230 kw=20 pf=0.98 Phases=1 model=1 class=1 daily=day status=fixed
new load.loadN4a bus1=6.1 kv=0.230 kw=11 pf=0.98 Phases=1 model=1 class=1 daily=day status=fixed
new load.loadN4b bus1=6.2 kv=0.230 kw=20 pf=0.98 Phases=1 model=1 class=1 daily=day status=fixed
new load.loadN4c bus1=6.3 kv=0.230 kw=25 pf=0.98 Phases=1 model=1 class=1 daily=day status=fixed
new load.loadN5a bus1=7.1 kv=0.230 kw=15 pf=0.98 Phases=1 model=1 class=1 daily=day status=fixed
new load.loadN5b bus1=7.2 kv=0.230 kw=17 pf=0.98 Phases=1 model=1 class=1 daily=day status=fixed
new load.loadN5c bus1=7.3 kv=0.230 kw=20 pf=0.98 Phases=1 model=1 class=1 daily=day status=fixed
new load.loadN6a bus1=3.1 kv=0.230 kw=14 pf=0.98 Phases=1 model=1 class=1 daily=day status=fixed
new load.loadN6b bus1=3.2 kv=0.230 kw=16 pf=0.98 Phases=1 model=1 class=1 daily=day status=fixed
new load.loadN6c bus1=3.3 kv=0.230 kw=10 pf=0.98 Phases=1 model=1 class=1 daily=day status=fixed
new load.loadN7a bus1=4.1 kv=0.230 kw=15 pf=0.98 Phases=1 model=1 class=1 daily=day status=fixed
new load.loadN7b bus1=4.2 kv=0.230 kw=20 pf=0.98 Phases=1 model=1 class=1 daily=day status=fixed
new load.loadN7c bus1=4.3 kv=0.230 kw=30 pf=0.98 Phases=1 model=1 class=1 daily=day status=fixed
new load.loadN8a bus1=5.1 kv=0.230 kw=20 pf=0.98 Phases=1 model=1 class=1 daily=day status=fixed
new load.loadN8b bus1=5.2 kv=0.230 kw=16 pf=0.98 Phases=1 model=1 class=1 daily=day status=fixed
new load.loadN8c bus1=5.3 kv=0.230 kw=25 pf=0.98 Phases=1 model=1 class=1 daily=day status=fixed
new load.loadN9a bus1=2.1 kv=0.230 kw=15 pf=0.98 Phases=1 model=1 class=1 daily=day status=fixed
new load.loadN9b bus1=2.2 kv=0.230 kw=18 pf=0.98 Phases=1 model=1 class=1 daily=day status=fixed
new load.loadN9c bus1=2.3 kv=0.230 kw=20 pf=0.98 Phases=1 model=1 class=1 daily=day status=fixed
// Per il plot profile
New Energymeter.em1 line.L1
New Energymeter.em2 line.L2
New Energymeter.em3 line.L3
New Energymeter.em4 line.L4
New monitor.N3a load.loadN3a mode=0
Set voltagebases=(0.4)
CalcVoltageBases
Solve mode=daily stepsize=1.0h number=24
Show monitor object=N3a
plot profile
Show powers
Refer https://www.researchgate.net/publication/305965105_Matlab_code_for_Unbalanced_Distribution_Load_Flow_using_OpenDSS_Matlab_COM_Interface
Dear Saran Satsangi,
Thank you very much for your answer. I saw that you defined loadshape but then you didn't use them it in load definition: "New Load.670c Bus1=670.3 Phases=1 Conn=Wye Model=1 kV=2.4 kW=117 kvar=68 "
How could it works?
Through Matlab COM
Just read ReadMe.pdf
Last edit: Saran Satsangi 2016-08-26
Dear Saran,
where & how do we define PQmult?
It is not mentioned in pdf file. Btw I am doing power flow for IEEE 123 bus system for 24 hrs (1 hour interval). For me everything (eg Transformer, regulators position) is same as in IEEE 123 system except 24 hrs load data.
This is how I am writing in MATLAB.
%%%%%%%%%%%%%%%%%
clear all;
clc;
DSSObj = actxserver('OpenDSSEngine.DSS');
if ~DSSObj.Start(0),
disp('Unable to start the OpenDSS Engine');
return
end
DSSText = DSSObj.Text; % Used for all text interfacing from matlab to opendss
DSSCircuit = DSSObj.ActiveCircuit; % active circuit
DSSText.Command='Compile (C:\Program Files\OpenDSS\IEEETestCases\123Bus\IEEE123Master.dss)';
%%%%%%%%%
% DSSText.Command='solve mode=snap';
% DSSText.Command='solve';
% DSSText.Command='Export Losses';
% DSSText.Command='Export Voltages';
% DSSText.Command='Export Currents';
%%%%%%%%%%
DSSText.Command='batchedit load..* Vmin=0.8'; % Set Vmin so that load model property will remain same
DSSTransformers=DSSCircuit.Transformers;
DSSText.Command='batchedit load..* daily=PQmult'; % Loadshape
DSSText.Command='New EnergyMeter.Main Line.L115 1';% Energy meter
nt=24*1;
TimeArray=1:nt;
DSSText.Command='set mode=daily stepsize=1h number=1';
DSSText.Command='set hour=0';
for i=1:nt
DSSText.Command='get hour';
hour=DSSText.Result;
DSSText.Command='Solve';
SystemLosses(i,:)=(DSSCircuit.Losses)/1000;
% %%% Line Losses
LineLosses(i,:)=DSSCircuit.Linelosses;
% %%%% Transformer Losses
%
TranLosses(i,:)=SystemLosses(i,:)-LineLosses(i,:);
%
% %%%% Voltage Magnitude in p.u. for 24-hours can be obtained in this way
V1pu(i,:)=DSSCircuit.AllNodeVmagPUByPhase(1);
V2pu(i,:)=DSSCircuit.AllNodeVmagPUByPhase(2);
V3pu(i,:)=DSSCircuit.AllNodeVmagPUByPhase(3);
DSSText.Command='show current';
DSSText.Command='Export Meter';
end
%%%%%%%%%%%%%%%%%%%%%%%
Abhimanyu
Do you mind to check if this video answers your question? https://www.youtube.com/watch?v=DAbzXVuaPZk&list=PLhdRxvt3nJ8yBSb1r64NB0JS5XHinBgGa&index=4&t=55s
Dear Paulo,
Thank you for the videos. I have watched these. Actually, I can't edit anything in IEEE 123 system files (access denied). So, only through MATLAB I can do. Loadshape I came to know that using this feature I can run load flow for 24 hours. Your videos tells how to do it in OpenDSS but i need it in MATLAB.
Hello Abhimanyu,
You might have found issues to edit the content of the IEEE123 test system because of the file location in your system. You can copy the model from the installation folder to any other location (e.g. My Documents), and you should be able to edit the content without issues.
Best regards.
Dear Miguel,
Thank you very much. This solves my editing problem. You can't believe how big it was for me. Rest of the things hopefully I will complete after learning already asked questions in this forum.
Hi,
I have created a new file with the following code in OpenDSS and kept that file in same folder with other relevant files. It shows error in opening CSVFile.
Clear
redirect IEEE123Master.dss
! The following are the modification of IEEE123
set mode=daily
New loadshape.day npts=24 interval=1 mult=(0.569 0.676 0.827 1.068 1.22 1.35 1.36 1.37 1.398 1.4 1.174 1.08 1.166 1.077 1.076 1.037 1.056 0.968 0.896 0.800 0.682 0.643 0.587 0.614)
New energymeter.Main element= Line.L115 terminal=1
New monitor.Line115 element=Line.L115 terminal=1 mode=0
Export monitors Line115
calcv
Solve
%%%%%%%%%%%%%%
ERROR:
(672) OpenDSS
Error opening CSVFile "C:\Users\HP\Documents\123Bus - Copy\ieee123_Mon_line115_1.csv" for writing
File access denied
Hi,
Couple of changes I made but still same error is there.
Changes I made: Export monitor after solve command
in setDailyLoadshape.DSS file, replaced 'default' by 'day'
%%%%%%%%%%%%
Clear
redirect IEEE123Master.dss
! The following are the modification of IEEE123
set mode=daily
New loadshape.day npts=24 interval=1 mult=(0.569 0.676 0.827 1.068 1.22 1.35 1.36 1.37 1.398 1.4 1.174 1.08 1.166 1.077 1.076 1.037 1.056 0.968 0.896 0.800 0.682 0.643 0.587 0.614)
New energymeter.Main element= Line.L115 terminal=1
New monitor.Line115 element=Line.L115 terminal=1 mode=0
calcv
Solve
Export monitors Line115
%%%%%%%%%%%%%%%%%%
ERROR:
(672) OpenDSS
Error opening CSVFile "C:\Users\HP\Documents\123Bus - Copy\ieee123_Mon_line115_1.csv" for writing
File access denied
Hi Francesco,
What is happening is that, by using the command "Show powers" you're asking OpenDSS to show the sequential powers (positive, negative and zero sequence), which doesn't apply for single-phase elements (like your loads).
Try to use "Show Powers kva Elements" instead.
Another thing that I noticed is that you set the load's parameter "status" to fixed. It means that the loadshape will be ignored, is that really what you want?
Hope it helps!!
Dear Celso Rocha,
Thanks for your help. It's clear now.