资源简介
孤岛算法,自己拿去仿真,懂的人自然懂,里面有比较多的描述,包括论文
代码片段和文件信息
function [sysx0strts] = afd(txuflag)
switch flag
case 0
[sysx0strts]=mdlInitializeSizes;
case 1
sys=[];
case 2
sys=[];
case 3
sys=mdlOutputs(txu);
case 4
sys=[];
case 9
sys=[];
otherwise
error([‘Unhandled flag = ‘num2str(flag)]);
end
%=============================================================================
% mdlInitializeSizes
function [sysx0strts]=mdlInitializeSizes %初始化
global f_vo theta_i theta_vo isIslanding cf %并网电流电压及其相位和孤岛标志
f_vo=50; %50Hz
theta_i=0; %I
theta_vo=0; %V
isIslanding=0; %Island
cf=0;
sizes = simsizes;
sizes.NumContStates = 0;
sizes.NumDiscStates = 0;
sizes.NumOutputs = 3;
sizes.NumInputs = 3;
sizes.DirFeedthrough = 1;
sizes.NumSampleTimes = 1; % at least one sample time is needed
sys = simsizes(sizes);
x0 = [];
str = [];
ts = [1e-4 0];
%=============================================================================
% mdlOutputs
function sys=mdlOutputs(txu)
global f_vo theta_i theta_vo isIslanding cf
theta_vo=u(2); %数字锁相环输出的电压频率
if abs(theta_vo)<0.04 % 电压相位为0时更新频率
f_vo=u(1);
cf=u(2)+0.2*(f_vo-50);
if (f_vo>50.5 || f_vo<49.5) %判断频率是否越界
sys=[0 0 cf];
isIslanding=1;%频率越界则输出为0,置孤岛标志
end
end
if(isIslanding==0) %判断是否孤岛效应
if cf>=0
if (theta_vo>=0)&&(theta_vo<=0.5*pi*cf)
theta_i=0;
elseif (abs(pi-theta_vo))<=0.5*pi*cf
theta_i=pi;
elseif (theta_vo>=pi*(2-0.5*cf))&&(theta_vo<=2*pi)
theta_i=2*pi;
elseif(theta_vo>0.5*pi*cf)&&(theta_vo<(pi-0.5*pi*cf))
theta_i=(theta_vo-0.5*pi*cf)/(1-cf);
elseif(theta_vo>=pi+0.5*pi*cf)&&(theta_vo<=pi*(2-0.5*cf))
theta_i=(theta_vo-1.5*pi*cf)/(1-cf);
end
elseif cf<0
if (theta_vo>0)&&(theta_vo theta_i=(theta_vo-0.5*pi*cf)/(1-cf);
elseif(theta_vo>pi)&&(theta_vo<2*pi)
theta_i=(theta_vo-1.5*pi*cf)/(1-cf);
end
end
sys(1)=sin(theta_i);
else
sys(1)=0;
end
sys(2)=f_vo;
sys(3)=cf;
- 上一篇:Matlab特征提取代码
- 下一篇: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
评论
共有 条评论