资源简介
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代码
相关资源
- Pattern Recognition and Machine Learning(高清
- MATLAB 编程 第二版 Stephen J. Chapman 著
- 均值滤波和FFT频谱分析Matlab代码
- 《MATLAB扩展编程》代码
- HDB3码、AMI码的MATLAB实现
- 3点GPS定位MATLAB仿真
- MATLAB数字信号处理85个实用案例精讲入
- matlab从入门到精通pdf94795
- 欧拉放大论文及matlab代码
- 跳一跳辅助_matlab版本
- 全面详解LTE MATLAB建模、仿真与实现
- MIMO-OFDM无线通信技术及MATLAB实现_孙锴
- MATLAB Programming for Engineers 4th - Chapman
- matlab 各种谱分析对比
- 分数阶chen混沌matlab程序
- 基于粒子群算法的非合作博弈的matl
- MATLAB车流仿真 包括跟驰、延误
- matlab空间桁架计算程序
- 基于MATLAB的图像特征点匹配和筛选
- DMA-TVP-FAVAR
- GPS信号的码捕获matlab代码.7z
- 一维光子晶体MATLAB仿真代码吸收率折
- newmark法源程序
- 传统关联成像、计算鬼成像matlab
- pri传统分选算法
- 摆动滚子推杆盘形凸轮设计
- 医学图像重建作业matlab源码
- Matlab实现混沌系统的控制
- 检测疲劳驾驶
- Matlab锁相环仿真-Phase Locked Loop.rar
评论
共有 条评论