资源简介
matlab软件通过COM接口与OPENDSS软件的连接,可以在matlab中编程对PENDSS内的程序进行更改。以 IEEE-13节点系统潮流计算作为opendss与matlab交互编程的标准示例,可以帮助学习者更快的掌握opendss与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:\Users\Admin\Desktop\SaturdayExample\ToUpload\MasterIEEE13.dss)‘;% Path where Master and its associated files are stored.
DSSText.Command=‘batchedit load..* Vmin=0.8‘; % Set Vmin so that load model property will remain same
DSSTransformers=DSSCircuit.Transformers;
%DSSText.Command=‘Batchedit regcontrol..* Enabled=no‘; % uncomment for tap change as per user‘s choice
DSSText.Command=‘batchedit load..* daily=PQmult‘; % Loadshape
DSSText.Command=‘New EnergyMeter.Main Line.650632 1‘;% Energy meter
nt=24*1;
TimeArray=1:nt;
%% Uncomment following for Tap chang as per user choice (manually)
% Xtap=[15 7 6 6 6 7 8 9 11 12 13 14 14 14 14 14 14 14 14 14 14 14 13 12
% 10 5 4 4 4 4 5 6 7 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9
% 15 6 5 5 5 6 7 9 10 12 13 13 14 14 14 14 14 14 14 14 14 14 13 12 ];
% Reg1Tap=Xtap(1:)-5;
% Reg2Tap=Xtap(2:)-5;
% Reg3Tap=Xtap(3:)-5;
% Vreg1=1+0.00625*Reg1Tap;
% Vreg2=1+0.00625*Reg2Tap;
% Vreg3=1+0.00625*Reg3Tap;
DSSText.Command=‘set mode=daily stepsize=1h number=1‘;
DSSText.Command=‘set hour=0‘; % Start at second 0 of hour 5
for i=1:nt
DSSText.Command=‘get hour‘;
hour=DSSText.Result;
%% Uncomment following for change in Tap Positions of Regulator as per user choice
% DSSText.command = [‘Transformer.Reg1.Tap=‘num2str(Vreg1(i))];
% DSSText.command = [‘Transformer.Reg2.Tap=‘num2str(Vreg2(i))];
% DSSText.command = [‘Transformer.Reg3.Tap=‘num2str(Vreg3(i))];
DSSText.Command=‘Solve‘;
SystemLosses(i:)=(DSSCircuit.Losses)/1000; % Will Give you Distribution System Losses in kWs and kVArs
%% 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 = ‘? Transformer.Reg1.Taps‘;
Reg1=str2num(DSSText.Result);
Vreg1S(i:)=Reg1(2);% Secondary winding voltage of Reg1 in 24-hr
DSSText.Command = ‘? Transformer.Reg2.Taps‘;
Reg2=str2num(DSSText.Result);
Vreg2S(i:)=Reg2(2);% Secondary winding voltage of Reg2 in 24-hr
DSSText.Command = ‘? Transformer.Reg3.Taps‘;
Reg3=str2num(DSSText.Result);
Vreg3S(i:)=Reg3(2);% Secondary winding voltage of Reg3 in 24-hr
DSSText.Command=‘Export Meter‘; % A MasterIEEE13_EXP_METERS.CSV file will be saved in same path
end
EM=csvread(‘MasterIEEE13_EXP_METERS.CSV‘14);
SubkWh=EM(:1);
SubkVArh=EM(:2);
SubkW24=[SubkWh(TimeArray(1)); SubkWh(TimeArray(2):TimeArray(end))-SubkWh(TimeArray(1):TimeArray(nt-1))];
SubkVAr24=[SubkVArh(TimeArray(1)); SubkVArh(TimeArray(2):TimeArray(end)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 152380 2018-04-26 09:36 DistributionPowerFlowusingOpenDSS.ppsx
目录 0 2018-04-26 09:40 Matlab code for Distribution power Flow using OpenDSS Matlab Interface\
文件 135 2016-07-15 19:11 Matlab code for Distribution power Flow using OpenDSS Matlab Interface\Capacitors.txt
文件 3435 2016-08-08 00:48 Matlab code for Distribution power Flow using OpenDSS Matlab Interface\DailyLoadFlow.m
文件 2572 2016-08-07 22:04 Matlab code for Distribution power Flow using OpenDSS Matlab Interface\Lines.txt
文件 1372 2016-08-07 21:51 Matlab code for Distribution power Flow using OpenDSS Matlab Interface\Loads.txt
文件 402 2016-08-07 23:14 Matlab code for Distribution power Flow using OpenDSS Matlab Interface\MasterIEEE13.dss
文件 853693 2016-08-08 01:08 Matlab code for Distribution power Flow using OpenDSS Matlab Interface\ReadMe.pdf
文件 1399 2016-08-08 00:49 Matlab code for Distribution power Flow using OpenDSS Matlab Interface\SnapLoadFlow.m
文件 1397 2016-08-07 23:09 Matlab code for Distribution power Flow using OpenDSS Matlab Interface\Transformers.txt
文件 6781 2016-07-31 09:32 Matlab code for Distribution power Flow using OpenDSS Matlab Interface\loadshapes.DSS
- 上一篇:SNN-STLAPID.m
- 下一篇:CRC32的matlab代码
相关资源
- matlab_OFDM调制解调(来自剑桥大学)
- Matlab路面裂缝识别69319
- 高灵敏度GPS接收机MATLAB仿真,附捕获
- 基于MATLAB的质点弹道计算与外弹道优
- 阵列天线的matlab仿真
- MATLAB 经典程序源代码大全
- MATLAB小波软阈值去噪代码33473
- 天线阵的波束形成在MATLAB仿真程序及
- 非线性SVM算法-matlab实现
- 《MATLAB 智能算法超级学习手册》-程序
- 组合导航matlab程序
- 读取txt文件内容matlab代码实现
- Matlab实现基于相关的模板匹配程序
- matlab优化工具箱讲解
- 基于MATLAB的快速傅里叶变换
- 光纤传输中的分布傅立叶算法matlab实
- 基于matlab的图像处理源程序
- matlab 椭圆拟合程序
- 算术编码解码matlab源代码
- optical_flow 光流法 matlab 实现程序
- 引导图像滤波器 Matlab实现
- 分形几何中一些经典图形的Matlab画法
- OFDM系统MATLAB仿真代码
- SVM工具箱(matlab中运行)
- 图像小波变换MatLab源代码
- LU分解的MATLAB实现
- 冈萨雷斯数字图像处理matlab版(第三
- 替代数据法的matlab程序
- 用matlab实现的多站定位系统性能仿真
- 通过不同方法进行粗糙集属性约简m
评论
共有 条评论