资源简介
RPC.rar
代码片段和文件信息
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
相关资源
- 微博自动评论助手.crx
- Axure高保真原型:移动客户端的设计与
- 200套PPT模版_带有索引.txt
- 飞狐加速器E版.rar
- CNNIC数字证书工具1.2和rootsupd.exe.zip
- rar(9)
- 课程设计.doc
- 20161031133804181.rar
- Vectorcontrolinductionmotor.rar
- bp.rar
- bianma.rar
- CS_recovery_algorithms_OMP_SP_IHT.zip
- 学生选课系统.rar
- PTHCJIEYA密碼.txt
- GodOfHacker-master.zip
- 中华石杉.txt
- ANSYS19.2破解版.zip
- WindowsServer2008R2(X64)MSDN镜像简体中文
- SAP视频教程地址.docx
- 帝国cmspaypal付款插件.rar
- 全国气象站stations.zip
- sklearn说明.txt
- pb.11.5.2506.rar
- 百度网盘地址.txt
- maxwell最全资料附Maxwell2019最新款.txt
- 小甲鱼课件视频全套.txt
- DJKK音乐器.rar
- 获取腾讯真实视频地址.zip
- gcc-g++.txt
- 相关内容地址.txt
评论
共有 条评论