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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? swp.m

?? svpwm時間計算
?? M
字號:
function [sys,x0,str,ts] = swp(t,x,u,flag)


%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);

  %%%%%%%%%%
  % Update %
  %%%%%%%%%%
  case 2,
    sys=mdlUpdate(t,x,u);

  %%%%%%%%%%%
  % Outputs %
  %%%%%%%%%%%
  case 3,
    sys=mdlOutputs(t,x,u);

  %%%%%%%%%%%%%%%%%%%%%%%
  % GetTimeOfNextVarHit %
  %%%%%%%%%%%%%%%%%%%%%%%
  case 4,
    sys=mdlGetTimeOfNextVarHit(t,x,u);

  %%%%%%%%%%%%%
  % Terminate %
  %%%%%%%%%%%%%
  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  = 0;
sizes.NumDiscStates  = 0;
sizes.NumOutputs     = 1;
sizes.NumInputs      = 4;
sizes.DirFeedthrough = 1;
sizes.NumSampleTimes = 1;   % at least one sample time is needed

sys = simsizes(sizes);

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

%
% 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)

sys = [];

% end mdlDerivatives

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

sys = [];

% end mdlUpdate

%
%=============================================================================
% mdlOutputs
% Return the block outputs.
%=============================================================================
%
function sys=mdlOutputs(t,x,u)
ua=u(1),ub=u(2),zhou=u(3),udc=u(4);


x=ub*sqrt(3)*u(3)/udc;
y=((ub*sqrt(3)/2)+1.5*ua)*u(3)/udc;
z=((ub*sqrt(3)/2)-1.5*ua)*u(3)/udc;
if ub>0
    a=1;
else a=0;
end
if ua*sqrt(3)-ub>0
    b=1;
else b=0;
end
if ua*sqrt(3)+ub<0
    c=1;
else c=0;
end

k=a+2*b+4*c;



if k==3
    m1=-z,m2=x;
    if m1+m2>u(3)
    q1=m1,q2=m2,
    m1=(q1/(q1+q2))*u(3),m2=(q2/(q1+q2))*u(3);
    end
    ta=(u(3)-m1-m2)/4,tb=ta+m1/2,tc=tb+m2/2;
     t01=ta,t02=tc,t03=tb;
end

    if k==1
    m1=z,m2=y;
    if m1+m2>u(3)
    q1=m1,q2=m2,
    m1=(q1/(q1+q2))*u(3),m2=(q2/(q1+q2))*u(3);
    end
    ta=(u(3)-m1-m2)/4,tb=ta+m1/2,tc=tb+m2/2;
     t01=tb,t02=tc,t03=ta;
    end

    if k==5
        m1=x,m2=-y;
         if m1+m2>u(3)
    q1=m1,q2=m2,
    m1=(q1/(q1+q2))*u(3),m2=(q2/(q1+q2))*u(3);
    end
    ta=(u(3)-m1-m2)/4,tb=ta+m1/2,tc=tb+m2/2;
      t01=tc,t02=tb,t03=ta;
    end

    if k==4
         m1=-x,m2=z;
         if m1+m2>u(3)
    q1=m1,q2=m2,
    m1=(q1/(q1+q2))*u(3),m2=(q2/(q1+q2))*u(3);
    end
    ta=(u(3)-m1-m2)/4,tb=ta+m1/2,tc=tb+m2/2;
       t01=tc,t02=ta,t03=tb;
    end
         
         
     if k==6
         m1=-y,m2=-z;
        if m1+m2>u(3)
    q1=m1,q2=m2,
    m1=(q1/(q1+q2))*u(3),m2=(q2/(q1+q2))*u(3);
    end
    ta=(u(3)-m1-m2)/4,tb=ta+m1/2,tc=tb+m2/2; 
     t01=tb,t02=ta,t03=tc;
     end
         
if k==2
    m1=y,m2=-x,
    if m1+m2>u(3)
    q1=m1,q2=m2;
    m1=(q1/(q1+q2))*u(3),m2=(q2/(q1+q2))*u(3);
    end
    ta=(u(3)-m1-m2)/4,tb=ta+m1/2,tc=tb+m2/2;
 t01=ta,t02=tb,t03=tc;
end


sys=[t01];


% 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.
%=============================================================================
%
function sys=mdlGetTimeOfNextVarHit(t,x,u)

sampleTime = 0.0001;    %  Example, set the next hit to be one second later.
sys = t + sampleTime;

% end mdlGetTimeOfNextVarHit

%
%=============================================================================
% 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一区二区三区免费野_久草精品视频
久色婷婷小香蕉久久| 国产偷v国产偷v亚洲高清| 一区二区三区电影在线播| 91啪在线观看| 亚洲成人动漫av| 67194成人在线观看| 久久精品国产在热久久| 久久综合精品国产一区二区三区| 国产在线观看一区二区| 国产精品第四页| 欧美在线看片a免费观看| 亚洲一区二区在线免费观看视频| 欧美疯狂性受xxxxx喷水图片| 免费成人你懂的| 国产调教视频一区| 91麻豆自制传媒国产之光| 亚洲小说欧美激情另类| 精品少妇一区二区三区免费观看 | 精品国产亚洲在线| 国产成人亚洲综合a∨婷婷图片| 亚洲欧美在线观看| 制服视频三区第一页精品| 国产河南妇女毛片精品久久久| 一色屋精品亚洲香蕉网站| 欧美老肥妇做.爰bbww| 国产麻豆成人传媒免费观看| 1024亚洲合集| 欧美一区二区三区在| a级高清视频欧美日韩| 午夜欧美视频在线观看| 国产日韩精品视频一区| 欧美日韩在线不卡| 粉嫩欧美一区二区三区高清影视 | 午夜天堂影视香蕉久久| 精品国产一区二区精华 | 欧美一级片在线观看| 精品一区二区三区的国产在线播放| 国产精品国产三级国产aⅴ入口 | 欧美日免费三级在线| 国内精品写真在线观看| 亚洲免费电影在线| 国产午夜亚洲精品午夜鲁丝片| 欧美主播一区二区三区| 国产精品中文字幕日韩精品 | 欧美国产精品专区| 欧美精品1区2区| 色综合久久六月婷婷中文字幕| 国内精品久久久久影院色| 一区二区三区四区高清精品免费观看| 欧美xxxxxxxx| 欧美精三区欧美精三区| www..com久久爱| 国产麻豆精品久久一二三| 日韩av中文字幕一区二区三区| 亚洲激情图片一区| 欧美国产一区二区在线观看| 日韩欧美激情四射| 91麻豆精品国产91久久久资源速度 | 欧美精品一区二区久久婷婷 | 美女网站色91| 丝袜诱惑亚洲看片| 一区二区三区日韩精品| 亚洲欧美在线视频| 国产精品乱人伦中文| 久久女同精品一区二区| 欧美成人精品二区三区99精品| 777午夜精品免费视频| 欧美亚洲一区二区三区四区| 99九九99九九九视频精品| 成人黄页毛片网站| 丁香一区二区三区| 丁香亚洲综合激情啪啪综合| 国产精品香蕉一区二区三区| 精品制服美女久久| 精品亚洲免费视频| 狠狠v欧美v日韩v亚洲ⅴ| 蜜臀久久久久久久| 久久国产夜色精品鲁鲁99| 欧美aⅴ一区二区三区视频| 青青草伊人久久| 精品一区二区三区在线观看国产| 蜜桃在线一区二区三区| 国内外成人在线| 国产精品99久久久久久有的能看| 国产一区不卡视频| 风流少妇一区二区| 97aⅴ精品视频一二三区| 91视频91自| 欧美日韩国产高清一区二区| 欧美日韩午夜精品| 日韩欧美不卡在线观看视频| 精品噜噜噜噜久久久久久久久试看 | 在线综合视频播放| 日韩视频在线你懂得| 国产精品久久久久影院老司 | 看国产成人h片视频| 另类小说图片综合网| 国产一区二区按摩在线观看| 不卡视频一二三| 欧美日韩国产综合视频在线观看 | 婷婷久久综合九色综合绿巨人| 青青草国产精品亚洲专区无| 国产精品123| 91猫先生在线| 欧美一区二区黄色| 国产蜜臀97一区二区三区| 亚洲精品精品亚洲| 日韩成人dvd| 成人在线一区二区三区| 欧美日韩亚洲综合一区二区三区| 日韩视频免费直播| 国产精品国产三级国产aⅴ原创 | 亚洲女人小视频在线观看| 日日夜夜免费精品| 成人自拍视频在线观看| 欧美三级中文字幕在线观看| 国产调教视频一区| 五月激情丁香一区二区三区| 国产99精品在线观看| 欧美丝袜自拍制服另类| www国产亚洲精品久久麻豆| 亚洲精品视频观看| 国产一区二区在线影院| 在线亚洲+欧美+日本专区| 精品三级在线看| 亚洲电影欧美电影有声小说| 精品一二线国产| 欧美日韩高清一区二区不卡| 国产日韩综合av| 日本美女视频一区二区| 97久久超碰精品国产| 精品国产一区二区三区不卡 | 久久成人综合网| 欧美综合久久久| 国产精品人妖ts系列视频| 成人激情免费电影网址| 91精品啪在线观看国产60岁| 国产精品对白交换视频| 国产酒店精品激情| 欧美一区二区在线看| 夜夜精品视频一区二区| 波多野结衣在线aⅴ中文字幕不卡 波多野结衣在线一区 | 亚洲激情网站免费观看| 大白屁股一区二区视频| 日韩视频免费直播| 天天免费综合色| 欧美在线观看视频在线| 日韩一区有码在线| 国产成人免费高清| 国产亚洲精品aa| 国产精品中文字幕一区二区三区| 日韩亚洲欧美高清| 蜜桃精品在线观看| 日韩一区二区在线免费观看| 亚洲国产精品久久一线不卡| 91麻豆国产精品久久| 中文字幕亚洲区| www.欧美日韩国产在线| 久久色.com| 国产精品一区二区三区乱码| 久久这里都是精品| 国产高清成人在线| 国产日韩在线不卡| 成人毛片老司机大片| 国产精品污网站| 成人精品视频一区二区三区尤物| 久久久高清一区二区三区| 国产综合色在线| 国产免费观看久久| www.av亚洲| 樱花影视一区二区| 在线观看亚洲a| 午夜视频一区在线观看| 69精品人人人人| 精品一区二区三区视频 | 欧美日韩一区二区三区高清 | 一区二区中文字幕在线| 波多野结衣在线aⅴ中文字幕不卡| 国产精品女同一区二区三区| www.亚洲色图| 一区二区三区日韩| 欧美一区二区在线免费播放| 精品一区二区久久久| 国产精品女人毛片| 91福利在线看| 日产国产欧美视频一区精品| 精品久久久久久综合日本欧美| 国产精品一区二区在线播放 | 国产精品久久久久影院亚瑟| 一本久久a久久免费精品不卡| 亚洲.国产.中文慕字在线| 日韩无一区二区| 成人美女视频在线观看18| 一区二区三区四区视频精品免费| 欧美日韩精品欧美日韩精品一综合| 美女诱惑一区二区| 中文字幕av资源一区| 欧美亚洲国产bt| 韩国欧美一区二区| 亚洲视频每日更新|