亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? motorsfuntion.m

?? 雙饋電機的matlab/simulink源碼
?? M
字號:
function [sys,x0,str,ts] = motorsfuntion(t,x,u,flag,Rs,Rr,Ls,Lr,Lm)
%SFUNTMPL General M-file S-function template
%   With M-file S-functions, you can define you own ordinary differential
%   equations (ODEs), discrete system equations, and/or just about
%   any type of algorithm to be used within a Simulink block diagram.
%
%   The general form of an M-File S-function syntax is:
%       [SYS,X0,STR,TS] = SFUNC(T,X,U,FLAG,P1,...,Pn)
%
%   What is returned by SFUNC at a given point in time, T, depends on the
%   value of the FLAG, the current state vector, X, and the current
%   input vector, U.
%
%   FLAG   RESULT             DESCRIPTION
%   -----  ------             --------------------------------------------
%   0      [SIZES,X0,STR,TS]  Initialization, return system sizes in SYS,
%                             initial state in X0, state ordering strings
%                             in STR, and sample times in TS.
%   1      DX                 Return continuous state derivatives in SYS.
%   2      DS                 Update discrete states SYS = X(n+1)
%   3      Y                  Return outputs in SYS.
%   4      TNEXT              Return next time hit for variable step sample
%                             time in SYS.
%   5                         Reserved for future (root finding).
%   9      []                 Termination, perform any cleanup SYS=[].
%
%
%   The state vectors, X and X0 consists of continuous states followed
%   by discrete states.
%
%   Optional parameters, P1,...,Pn can be provided to the S-function and
%   used during any FLAG operation.
%
%   When SFUNC is called with FLAG = 0, the following information
%   should be returned:
%
%      SYS(1) = Number of continuous states.
%      SYS(2) = Number of discrete states.
%      SYS(3) = Number of outputs.
%      SYS(4) = Number of inputs.
%               Any of the first four elements in SYS can be specified
%               as -1 indicating that they are dynamically sized. The
%               actual length for all other flags will be equal to the
%               length of the input, U.
%      SYS(5) = Reserved for root finding. Must be zero.
%      SYS(6) = Direct feedthrough flag (1=yes, 0=no). The s-function
%               has direct feedthrough if U is used during the FLAG=3
%               call. Setting this to 0 is akin to making a promise that
%               U will not be used during FLAG=3. If you break the promise
%               then unpredictable results will occur.
%      SYS(7) = Number of sample times. This is the number of rows in TS.
%
%
%      X0     = Initial state conditions or [] if no states.
%
%      STR    = State ordering strings which is generally specified as [].
%
%      TS     = An m-by-2 matrix containing the sample time
%               (period, offset) information. Where m = number of sample
%               times. The ordering of the sample times must be:
%
%               TS = [0      0,      : Continuous sample time.
%                     0      1,      : Continuous, but fixed in minor step
%                                      sample time.
%                     PERIOD OFFSET, : Discrete sample time where
%                                      PERIOD > 0 & OFFSET < PERIOD.
%                     -2     0];     : Variable step discrete sample time
%                                      where FLAG=4 is used to get time of
%                                      next hit.
%
%               There can be more than one sample time providing
%               they are ordered such that they are monotonically
%               increasing. Only the needed sample times should be
%               specified in TS. When specifying than one
%               sample time, you must check for sample hits explicitly by
%               seeing if
%                  abs(round((T-OFFSET)/PERIOD) - (T-OFFSET)/PERIOD)
%               is within a specified tolerance, generally 1e-8. This
%               tolerance is dependent upon your model's sampling times
%               and simulation time.
%
%               You can also specify that the sample time of the S-function
%               is inherited from the driving block. For functions which
%               change during minor steps, this is done by
%               specifying SYS(7) = 1 and TS = [-1 0]. For functions which
%               are held during minor steps, this is done by specifying
%               SYS(7) = 1 and TS = [-1 1].

%   Copyright 1990-2002 The MathWorks, Inc.
%   $Revision: 1.18 $

%
% The following outlines the general structure of an S-function.
%
switch flag,

  %%%%%%%%%%%%%%%%%%
  % Initialization %
  %%%%%%%%%%%%%%%%%%
  case 0,
    [sys,x0,str,ts]=mdlInitializeSizes;

  %%%%%%%%%%%%%%%
  % Derivatives %
  %%%%%%%%%%%%%%%
  case 1,
    sys=mdlDerivatives(t,x,u,Rs,Rr,Ls,Lr,Lm);
  
  case 2,
    sys=mdlUpdate(t,x,u);
    
    
  case 3,
    sys=mdlOutputs(t,x,u);
 
  
  case 9,
    sys=mdlTerminate(t,x,u);

  %%%%%%%%%%%%%%%%%%%%
  % Unexpected flags %
  %%%%%%%%%%%%%%%%%%%%
  otherwise
    error(['Unhandled flag = ',num2str(flag)]);

end

% end sfuntmpl

%
%=============================================================================
% mdlInitializeSizes
% Return the sizes, initial conditions, and sample times for the S-function.
%=============================================================================
%
function [sys,x0,str,ts]=mdlInitializeSizes

%
% call simsizes for a sizes structure, fill it in and convert it to a
% sizes array.
%
% Note that in this example, the values are hard coded.  This is not a
% recommended practice as the characteristics of the block are typically
% defined by the S-function parameters.
%
sizes = simsizes;

sizes.NumContStates  = 4;
sizes.NumDiscStates  = 0;
sizes.NumOutputs     = 4;
sizes.NumInputs      = 5;
sizes.DirFeedthrough = 1;
sizes.NumSampleTimes = 1;   % at least one sample time is needed

sys = simsizes(sizes);

%
% initialize the initial conditions
%
x0  = [0,0,0,0];

%
% str is always an empty matrix
%
str = [];

%
% initialize the array of sample times
%
ts  = [0 0];

% end mdlInitializeSizes

%
%=============================================================================
% mdlDerivatives
% Return the derivatives for the continuous states.
%=============================================================================
%
function sys=mdlDerivatives(t,x,u,Rs,Rr,Ls,Lr,Lm)

dx(1)=[-1*Rs*Lr/(Ls*Lr-Lm*Lm), 100*pi+u(5)*Lm*Lm/(Ls*Lr-Lm*Lm), Rr*Lm/(Ls*Lr-Lm*Lm), u(5)*Lr*Lm/(Ls*Lr-Lm*Lm)]*[x(1),x(2),x(3),x(4)]'+[Lr/(Ls*Lr-Lm*Lm),0,-1*Lm/(Ls*Lr-Lm*Lm),0]*[u(1),u(2),u(3),u(4)]';

dx(2)=[-100*pi-u(5)*Lm*Lm/(Ls*Lr-Lm*Lm), -1*Rs*Lr/(Ls*Lr-Lm*Lm), -1*Lr*Lm*u(5)/(Ls*Lr-Lm*Lm), Rr*Lm/(Ls*Lr-Lm*Lm)]*[x(1),x(2),x(3),x(4)]'+[0,Lr/(Ls*Lr-Lm*Lm),0,-1*Lm/(Ls*Lr-Lm*Lm)]*[u(1),u(2),u(3),u(4)]';

dx(3)=[Rs*Lm/(Ls*Lr-Lm*Lm), -1*Lm*Ls*u(5)/(Ls*Lr-Lm*Lm), -1*Rr*Ls/(Ls*Lr-Lm*Lm), 100*pi-Ls*Lr*u(5)/(Ls*Lr-Lm*Lm)]*[x(1),x(2),x(3),x(4)]'+[-1*Lm/(Ls*Lr-Lm*Lm),0,Ls/(Ls*Lr-Lm*Lm),0]*[u(1),u(2),u(3),u(4)]';

dx(4)=[Ls*Lm*u(5)/(Ls*Lr-Lm*Lm), Rs*Lm/(Ls*Lr-Lm*Lm), -100*pi+Ls*Lr*u(5)/(Ls*Lr-Lm*Lm), -1*Rr*Ls/(Ls*Lr-Lm*Lm)]*[x(1),x(2),x(3),x(4)]'+[0,-1*Lm/(Ls*Lr-Lm*Lm),0,Ls/(Ls*Lr-Lm*Lm)]*[u(1),u(2),u(3),u(4)]';

sys = dx;

% end mdlDerivatives

%
%=============================================================================
% mdlUpdate
% Handle discrete state updates, sample time hits, and major time step
% requirements.
%=============================================================================
%
function sys=mdlUpdate(t,x,u)

sys = [];


%
%=============================================================================
% mdlOutputs
% Return the block outputs.
%=============================================================================
%
function sys=mdlOutputs(t,x,u)

sys = [x(1),x(2),x(3),x(4)];

% end mdlOutputs

%
%=============================================================================
% 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.
%=============================================================================
%


%
%=============================================================================
% mdlTerminate
% Perform any end of simulation tasks.
%=============================================================================
%
function sys=mdlTerminate(t,x,u)

sys = [];

% end mdlTerminate

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区国产视频| 亚洲人午夜精品天堂一二香蕉| fc2成人免费人成在线观看播放| 欧美日韩高清在线播放| 99久久er热在这里只有精品15| 久久久精品中文字幕麻豆发布| 精品一区二区三区视频| 又紧又大又爽精品一区二区| 中文字幕+乱码+中文字幕一区| 白白色 亚洲乱淫| 成人国产精品免费观看| av在线不卡电影| 一本到一区二区三区| 在线视频国内自拍亚洲视频| 99r精品视频| 91极品美女在线| 欧美区一区二区三区| 日韩精品中文字幕一区| xnxx国产精品| 国产精品久久久久影视| 亚洲色图一区二区| 夜夜嗨av一区二区三区网页| 香蕉久久夜色精品国产使用方法 | 亚洲成人综合在线| 亚洲一区二区美女| 久久er99热精品一区二区| 国产精品1区2区3区| a亚洲天堂av| 精品视频在线免费观看| 日韩欧美不卡一区| 综合久久综合久久| 亚洲无线码一区二区三区| 久久99精品国产.久久久久久| 亚洲乱码中文字幕| 日韩电影一区二区三区| 成人午夜av影视| 欧美日韩一本到| 精品国产99国产精品| 17c精品麻豆一区二区免费| 亚洲精品国产a| 激情五月激情综合网| 99精品视频在线免费观看| 欧美日韩国产电影| 国产精品久久久久久久裸模| 日韩影视精彩在线| 99久免费精品视频在线观看 | 豆国产96在线|亚洲| 色婷婷亚洲精品| 久久你懂得1024| 亚洲成人av一区二区| 成人一级片在线观看| 91精品国产综合久久久久久久| 欧美日韩免费电影| 国产精品成人一区二区艾草| 美女一区二区三区| 精品视频在线免费看| 亚洲欧美日韩国产成人精品影院| 中文字幕av一区二区三区| 免费看欧美美女黄的网站| 91久久久免费一区二区| 久久久欧美精品sm网站| 五月综合激情婷婷六月色窝| 99国产精品久久| 国产欧美一区二区精品性色| 久久精品久久99精品久久| 欧美色大人视频| 亚洲国产精品尤物yw在线观看| 亚洲国产一区视频| 成人美女视频在线看| 日韩三区在线观看| 日韩高清在线电影| 在线不卡中文字幕| 天堂影院一区二区| 8v天堂国产在线一区二区| 亚洲一区二区三区爽爽爽爽爽| 日韩在线a电影| 欧美日韩不卡一区二区| 亚洲午夜国产一区99re久久| 成人av网址在线| 中文字幕亚洲欧美在线不卡| av亚洲精华国产精华精华 | 色天使久久综合网天天| 亚洲欧洲国产专区| 97精品久久久久中文字幕| 国产精品天天看| 色综合中文综合网| 一区二区三区蜜桃| 91国模大尺度私拍在线视频| 一区二区三区四区在线播放| 在线亚洲高清视频| 五月综合激情日本mⅴ| 日韩一级片网址| 国产一区91精品张津瑜| 国产婷婷色一区二区三区| 成人av在线网| 亚洲国产婷婷综合在线精品| 67194成人在线观看| 精品无人区卡一卡二卡三乱码免费卡 | 91视频com| 五月婷婷综合网| 久久综合资源网| 日本高清不卡在线观看| 视频一区在线播放| 久久一区二区三区四区| 97超碰欧美中文字幕| 成人免费一区二区三区在线观看| 秋霞成人午夜伦在线观看| 日韩欧美亚洲国产精品字幕久久久| 亚洲日本护士毛茸茸| 欧美精品v国产精品v日韩精品| 欧美国产日韩一二三区| 91免费在线看| 免费一级欧美片在线观看| 国产精品私人影院| 欧美日韩一区二区在线观看视频| 亚洲日本在线观看| 日韩欧美电影一区| 日本韩国一区二区三区| 紧缚捆绑精品一区二区| 一区二区三区日韩欧美精品| 欧美sm美女调教| 欧美色视频在线| 国产69精品久久久久777| 亚洲成人综合视频| 亚洲视频香蕉人妖| 久久这里只有精品6| 欧美日韩国产大片| 成人av在线看| 国产综合久久久久影院| 午夜精品福利一区二区三区av| 欧美影视一区在线| 99国产麻豆精品| 国产精品91一区二区| 久久精品国产99国产| 亚洲国产欧美在线| 国产精品久久久一本精品| 精品伦理精品一区| 欧美一区二视频| 欧美日韩视频第一区| 色噜噜狠狠色综合中国| 国产91丝袜在线播放| 极品少妇xxxx精品少妇| 日韩电影一区二区三区| 午夜av一区二区三区| 亚洲亚洲人成综合网络| 一区二区三区日韩在线观看| 中文字幕一区二区不卡| 国产精品激情偷乱一区二区∴| 色偷偷88欧美精品久久久| 成人久久视频在线观看| 成人网页在线观看| 国产91在线观看丝袜| 国产91精品欧美| 99久久99久久精品国产片果冻 | 4438亚洲最大| 在线不卡a资源高清| 欧美日韩国产不卡| 91精品国产乱| 欧美一区二区三区色| 欧美大肚乱孕交hd孕妇| 日韩欧美激情在线| 日韩免费在线观看| 精品日韩一区二区三区| 国产调教视频一区| 亚洲欧洲性图库| 一区二区三区四区不卡视频| 亚洲一区二区精品视频| 日本欧美久久久久免费播放网| 国产欧美中文在线| 国产精品美女久久久久久久网站| 欧美在线观看视频一区二区三区| 老司机午夜精品| 国产成人在线观看免费网站| 成人免费观看男女羞羞视频| 99久久精品国产观看| 色噜噜狠狠色综合中国| 欧美日韩精品欧美日韩精品| 日韩亚洲欧美高清| 欧美激情一区在线观看| 一区二区三区日韩精品| 久草精品在线观看| 99久久婷婷国产精品综合| 欧美日韩免费高清一区色橹橹| 不卡在线观看av| 欧美精品久久99| 中文字幕第一区二区| 亚洲第一久久影院| 精品一区二区免费在线观看| a亚洲天堂av| 日韩一卡二卡三卡国产欧美| 国产精品福利一区| 午夜精品久久久久久久99樱桃| 亚洲日本韩国一区| 久久激情五月激情| 91看片淫黄大片一级| 欧美一区二区啪啪| 一区在线中文字幕| 久久精品国产一区二区| 91极品视觉盛宴| 国产精品久久久久久久久久久免费看|