-
Notifications
You must be signed in to change notification settings - Fork 7
/
DistFlowOpenDSSAlternateLoss.m
45 lines (43 loc) · 1.32 KB
/
DistFlowOpenDSSAlternateLoss.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
% clc;
% clear ;
% close all;
%
%
% %% OpenDSS Integration
% [DSSObj, DSSText, gridpvpath] = DSSStartup;
% DSSCircuit=DSSObj.ActiveCircuit;
% DSSSolution=DSSCircuit.Solution;
% DSSMon=DSSCircuit.Monitors;
% DSSText.command = 'Clear';
%
% DSSText.command = 'Compile C:\feeders\feeder13_B_R\feeder13BR.dss';
% % Easy way to change parameters for all the loads , making them ZIPV
% % The last parameter refers to the minimum voltage threshhold
% DSSText.Command= 'BatchEdit Load..* Model=1';
% % DSSText.Command='BatchEdit Load..* ZIPV=(0.2,0.05,0.75,0.2,0.05,0.75,0.6)';
%
% DSSSolution.Solve();
% LoadInfo=getLoadInfo(DSSObj);
% LoadBusNames={LoadInfo.name};
% BusInfo=getBusInfo(DSSObj);
% BusNames={BusInfo.name};
% BusMap=containers.Map;
% BusMap('sourcebus')=1;
% counter=2;
% for bus=2:length(BusNames)
% test=BusNames(bus);
% test=test{1};
% if (sum(ismember(LoadBusNames,test))==0)
% BusMap(test)=counter;
% counter=counter+1;
% end
% end
%% OpenDSS simulation
[DSSObj, DSSText, gridpvpath] = DSSStartup;
DSSCircuit=DSSObj.ActiveCircuit;
DSSSolution=DSSCircuit.Solution;
DSSMon=DSSCircuit.Monitors;
% DSSText.command = 'Clear';
DSSText.command = 'Compile C:\feeders\Radial5Busd\simulation.dss';
BusInfo=getBusInfo(DSSObj);
VoltageOpenDSS=[BusInfo.voltagePU];