📄 pi_siy_s.m
字号:
function [ret,x0,str]=pi_siy_s(t,x,u,flag);%PI_SIY_S is the M-file description of the SIMULINK system named PI_SIY_S.% The block-diagram can be displayed by typing: PI_SIY_S.%% SYS=PI_SIY_S(T,X,U,FLAG) returns depending on FLAG certain% system values given time point, T, current state vector, X,% and input vector, U.% FLAG is used to indicate the type of output to be returned in SYS.%% Setting FLAG=1 causes PI_SIY_S to return state derivatives, FLAG=2% discrete states, FLAG=3 system outputs and FLAG=4 next sample% time. For more information and other options see SFUNC.%% Calling PI_SIY_S with a FLAG of zero:% [SIZES]=PI_SIY_S([],[],[],0), returns a vector, SIZES, which% contains the sizes of the state vector and other parameters.% SIZES(1) number of states% SIZES(2) number of discrete states% SIZES(3) number of outputs% SIZES(4) number of inputs.% For the definition of other parameters in SIZES, see SFUNC.% See also, TRIM, LINMOD, LINSIM, EULER, RK23, RK45, ADAMS, GEAR.% Note: This M-file is only used for saving graphical information;% after the model is loaded into memory an internal model% representation is used.% the system will take on the name of this mfile:sys = mfilename;new_system(sys)simver(1.2)if(0 == (nargin + nargout)) set_param(sys,'Location',[4,42,628,468]) open_system(sys)end;set_param(sys,'algorithm', 'RK-23')set_param(sys,'Start time', '0.0')set_param(sys,'Stop time', '8')set_param(sys,'Min step size', '0.0001')set_param(sys,'Max step size', '0.1')set_param(sys,'Relative error','1e-3')set_param(sys,'Return vars', '')add_block('built-in/Note',[sys,'/','Closed Loop System with a nonlinear discrete fuzzy controller. Fuzzy-Toolbox O.Wolkenhauer 21-April 1994'])set_param([sys,'/','Closed Loop System with a nonlinear discrete fuzzy controller. Fuzzy-Toolbox O.Wolkenhauer 21-April 1994'],... 'position',[286,375,287,376])add_block('built-in/Note',[sys,'/',['*) Subsystem function name: FUZZY11 und Function parameters: ''pi_siyi'',0.1']])set_param([sys,'/',['*) Subsystem function name: FUZZY11 und Function parameters: ''pi_siyi'',0.1']],... 'position',[257,315,258,316])add_block('built-in/Note',[sys,'/','*)'])set_param([sys,'/','*)'],... 'position',[195,100,196,101])add_block('built-in/Note',[sys,'/','Plant'])set_param([sys,'/','Plant'],... 'position',[335,20,336,21])% Subsystem 'Graph Scope'.new_system([sys,'/','Graph Scope'])set_param([sys,'/','Graph Scope'],'Location',[0,0,274,193])add_block('built-in/S-function',[sys,'/',['Graph Scope/S-function',13,'M-file which plots',13,'lines',13,'']])set_param([sys,'/',['Graph Scope/S-function',13,'M-file which plots',13,'lines',13,'']],... 'function name','sfuny',... 'parameters','ax, color',... 'position',[130,55,180,75])add_block('built-in/Inport',[sys,'/','Graph Scope/x'])set_param([sys,'/','Graph Scope/x'],... 'position',[65,55,85,75])add_line([sys,'/','Graph Scope'],[90,65;120,65])set_param([sys,'/','Graph Scope'],... 'Mask Display','plot(0,0,100,100,[90,10,10,10,90,90,10],[65,65,90,40,40,90,90],[90,78,69,54,40,31,25,10],[77,60,48,46,56,75,81,84])',... 'Mask Type','Graph scope.')set_param([sys,'/','Graph Scope'],... 'Mask Dialogue','Graph scope using MATLAB graph window.\nEnter plotting ranges and line type.|Time range:|y-min:|y-max:|Line type (rgbw-:*)::',... 'Mask Translate','color = @4; ax = [0, @1, @2, @3];')set_param([sys,'/','Graph Scope'],... 'Mask Help','This block plots to the MATLAB graph window and can be used as an improved version of the Scope block. Look at the m-file sfuny.m to see how it works.',... 'Mask Entries','8\/0\/2\/''g''\/')% Finished composite block 'Graph Scope'.set_param([sys,'/','Graph Scope'],... 'Drop Shadow',4,... 'position',[485,41,515,79])add_block('built-in/Note',[sys,'/','Fuzzy-PI-Controller'])set_param([sys,'/','Fuzzy-PI-Controller'],... 'position',[236,20,237,21])add_block('built-in/To Workspace',[sys,'/','To Workspace1'])set_param([sys,'/','To Workspace1'],... 'mat-name','y',... 'position',[490,152,540,168])add_block('built-in/S-function',[sys,'/','S-function'])set_param([sys,'/','S-function'],... 'function name','fuzzy11',... 'parameters','''pi_siyi'',0.1',... 'position',[205,40,265,80])add_block('built-in/Sum',[sys,'/','Sum'])set_param([sys,'/','Sum'],... 'inputs','-+',... 'position',[105,44,130,71])add_block('built-in/Transfer Fcn',[sys,'/','Transfer Fcn'])set_param([sys,'/','Transfer Fcn'],... 'Denominator','[1 1]',... 'position',[320,38,380,82])add_block('built-in/To Workspace',[sys,'/','To Workspace'])set_param([sys,'/','To Workspace'],... 'mat-name','t',... 'position',[135,242,185,258])add_block('built-in/Clock',[sys,'/','Clock'])set_param([sys,'/','Clock'],... 'position',[35,240,55,260])add_block('built-in/Step Fcn',[sys,'/','Step Fcn'])set_param([sys,'/','Step Fcn'],... 'Time','0',... 'position',[30,40,50,60])add_line(sys,[385,60;475,60])add_line(sys,[420,60;420,175;90,175;90,70;95,65])add_line(sys,[420,160;480,160])add_line(sys,[60,250;125,250])add_line(sys,[270,60;310,60])add_line(sys,[135,60;195,60])add_line(sys,[55,50;95,50])% Return any arguments.if (nargin | nargout) % Must use feval here to access system in memory if (nargin > 3) if (flag == 0) eval(['[ret,x0,str]=',sys,'(t,x,u,flag);']) else eval(['ret =', sys,'(t,x,u,flag);']) end else [ret,x0,str] = feval(sys); endend
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -