资源简介
RPC.rar
![](http://www.nz998.com/pic/31387.jpg)
代码片段和文件信息
function [sysx0strts] = BPF_Tustin(txuflag)
%SFUNTMPL General M-file S-function template
%global DT=2e-4;
switch flag
%%%%%%%%%%%%%%%%%%
% Initialization %
%%%%%%%%%%%%%%%%%%
case 0
[sysx0strts]=mdlInitializeSizes;
%%%%%%%%%%%%%%%
% Derivatives %
%%%%%%%%%%%%%%%
case 1
sys=mdlDerivatives(txu);
%%%%%%%%%%
% Update %
%%%%%%%%%%
case 2
sys=mdlUpdate(txu);
%%%%%%%%%%%
% Outputs %
%%%%%%%%%%%
case 3
sys=mdlOutputs(txu);
%%%%%%%%%%%%%%%%%%%%%%%
% GetTimeOfNextVarHit %
%%%%%%%%%%%%%%%%%%%%%%%
case 4
sys=mdlGetTimeOfNextVarHit(txu);
%%%%%%%%%%%%%
% Terminate %
%%%%%%%%%%%%%
case 9
sys=mdlTerminate(txu);
%%%%%%%%%%%%%%%%%%%%
% Unexpected flags %
%%%%%%%%%%%%%%%%%%%%
otherwise
DAStudio.error(‘Simulink:blocks:unhandledFlag‘ num2str(flag));
end
% end sfuntmpl
%
%=============================================================================
% mdlInitializeSizes
% Return the sizes initial conditions and sample times for the S-function.
%=============================================================================
%
function [sysx0strts]=mdlInitializeSizes
sizes = simsizes;
sizes.NumContStates = 0;
sizes.NumDiscStates = 5;
sizes.NumOutputs = 1;
sizes.NumInputs = 2;
sizes.DirFeedthrough = 0;
sizes.NumSampleTimes = 1; % at least one sample time is needed
sys = simsizes(sizes);
%
% initialize the initial conditions
%
x0 = [0 0 0 0 0];
str = [];
ts = [-2 0]; % inherited sample time
% end mdlInitializeSizes
function sys=mdlDerivatives(txu)
sys = [];
% end mdlDerivatives
%=============================================================================
% mdlUpdate
% Handle discrete state updates sample time hits and major time step
% requirements.
%=============================================================================
%
function sys=mdlUpdate(txu)
DT=2e-4;
Wr=u(2);
K=0.065;%0.065
WrxDt=Wr*DT;
WrxDt_Sqr=WrxDt*WrxDt;
KxWrxDt=K*WrxDt;
Temp1=x(1)+x(1)-x(2);
%Temp2=x(3)-x(4)-x(1)+x(2);
Temp2=u(1)-x(3)-x(1)+x(2);
Temp3=KxWrxDt*Temp2;
Temp4=WrxDt_Sqr*x(2);
x(5)=Temp1+Temp3-Temp4;
%x(4)=x(3);
x(3)=u(1);
x(2)=x(1);
x(1)=x(5);
sys =x; %返回当前状态变量值
% end mdlUpdate
%=============================================================================
% mdlOutputs
% Return the block outputs.
%=============================================================================
%
function sys=mdlOutputs(txu)
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
sys=x(5);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%=============================================================================
% mdlGetTimeOfNextVarHit
% Return the time of the next hit for this block. Note that the result is
% absolute time. Note that this function is only used when you specify a
% variable discrete-time sample time [-2 0] in the sample time array in
% mdlInitializeSizes.
%===
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3312 2017-04-11 15:55 RPC\LPF_Tustin.m
文件 3905 2017-04-11 11:10 RPC\Rep_Ctrl.m
文件 186013 2017-04-11 17:03 RPC\Full_bridgeRep.mdl
文件 3443 2017-04-11 14:16 RPC\HPF_Tustin.m
文件 3544 2017-01-15 20:29 RPC\BPF_Tustin.m
目录 0 2017-04-11 17:03 RPC
----------- --------- ---------- ----- ----
200217 6
相关资源
- OpenGL参考手册
- Python中Numpy库最新教程
- SPD博士V5.3.exe
- 直流无刷电机方波驱动 stm32 例程代码
- layui后台管理模板
- 仿知乎界面小程序源代码
- 云平台-阿里云详细介绍
- photoshop经典1000例
- scratch垃圾分类源码(最终版本).sb
- IAR ARM 7.8破解
- TI CCS V5.4 安装步骤及破解文件
- 松下plc FP-XH的驱动
- 局域网硬件信息收集工具
- 加快Windows XP操作系统开机速度
- 联想启天M4350 BIOS升级文件
- 操作系统教程课后答案华中科技大学
- 用友ERP考试系统练习题库及答案
- 北京邮电大学数据结构历年考研真题
- 真正!!!概率论与数理统计浙江大
- TMS320VC5509A_开发板使用手册
- hxdef100源码、远控、后门
- CentOS-6.7-x86_64-bin-DVD1to2
- 点阵字库显示中英文
- caxa实体设计2019破解补丁
- Dibrugarh地区牛场土壤中潜在的益生菌
- nasm-2.15-x64
- RADMIN 3.4 注册机WIN10可用
- Radmin Server-3.5 完美绿色破解版x32 x64通
- Radmin 3.5 简体中文版附完美破解
- radmin3.51完美破解版(支持win10)
评论
共有 条评论