📄 nelinsys.mdl
字号:
OpenFcn "exaktmimo"
ShowPortLabels on
MaskType "Exact linearization for MIMO systems"
MaskDisplay "disp('ExactMIMO');"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate none
MaskIconUnits autoscale
System {
Name "Controller synthesis\nfor MIMO system"
"s"
Location [203, 331, 569, 538]
Open off
ToolBar off
StatusBar off
ScreenColor white
PaperOrientation landscape
PaperPositionMode auto
PaperType usletter
PaperUnits inches
}
}
Block {
BlockType SubSystem
Name "Controller synthesis\nfor SISO systems"
Ports [0, 0, 0, 0, 0]
Position [464, 15, 550, 54]
DropShadow on
OpenFcn "exaktsiso"
ShowPortLabels on
MaskType "Exact linearization for SISO systems"
MaskDisplay "disp('ExactSISO');"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate none
MaskIconUnits autoscale
System {
Name "Controller synthesis\nfor SISO system"
"s"
Location [203, 331, 569, 538]
Open off
ToolBar off
StatusBar off
ScreenColor white
PaperOrientation landscape
PaperPositionMode auto
PaperType usletter
PaperUnits inches
}
}
Block {
BlockType SubSystem
Name "Coordinates transformation\nfor MIMO sy"
"stems"
Ports [1, 1, 0, 0, 0]
Position [195, 110, 255, 140]
Orientation left
ShowPortLabels on
MaskType "Coordinates transformation for MIMO sys"
"tems"
MaskDescription "This block performs a nonlinear transfo"
"rmation of system state variables according to the exact linearization rules."
" Together with the corresponding \"Linearizing control law\" block, it implem"
"ents a transformation\n\n dx/dt = f(x) + g(x) u ---> "
" dq/dt = Aq + Bv\n y = h(x) -"
"--> y = Cq\n\ni.e. the transformation of a nonlinear system i"
"nto a linear and controllable form. This version of the block is designed for"
" use with MIMO systems. To compute the coordinates transformation Q = Q(x) fo"
"r a given system, the \"ExaktMimo.m\" application can be used.\n\nTransformat"
"ion formula can be specified either as a symbolic expression or as an identif"
"ier of a symbolic variable.\n\nFor a detailed description of block parameters"
", click \"Help\" button below."
MaskHelp "web(fullfile(cd,'help','transf_mimo.htm"
"l'));"
MaskPromptString "System order (number of states, N):|Rel"
"ative degrees of subsystems (r1+r2+...+rK <= n):|Transformation formula - sym"
"bolic expression: q = Q(x) = |Transformation formula - variable identifier:"
MaskStyleString "edit,edit,edit,edit"
MaskTunableValueString "on,on,on,on"
MaskVariables "n=@1;r=@2;Z=&3;Zp=@4;"
MaskInitialization "% Overenie spravnosti zadania parametro"
"v bloku %\nif ~isempty(Z) & (Zp == 0)\n Z = sym(Z);\nelseif isempty(Z) & (a"
"ny(Zp ~= 0))\n Z = sym(Zp);\nelse\n error(['Transformation formula not sp"
"ecified or specified more than once - cannot continue!']);\nend\n\n% Zisti si"
" symbolicke premenne, ktore vystupuju vo vyraze %\nprem = strrep(strrep(finds"
"ym(sym(Z)),', ',''),',',' ');\n\n% Premenne x1, x2, ..., xN su korektne, pres"
"koc ich %\nfor k = 1 : n\n prem = strrep(prem, sprintf('x%d',k), '');\nend"
"\n\n% Ak retazec nezostal prazdny, vyhlas chybu %\nif ~isempty(prem)\n erro"
"r(['Unknown symbol found in transformation formula - cannot continue!']);\nen"
"d\n\nif (sum(r) > n)\n error('Error: Total relative degree (i.e. the sum of r"
"elative degrees of subsystems) cannot be higher than system order!');\nend\n"
"\n% Otestovanie spravnosti rozmeru matice Z (podla \"r\") %\nif ~all(size(sym"
"(Z)) == [sum(r),1])\n error(['Wrong number of transformation equations (wro"
"ng number of rows of transformation matrix) !']);\nend\n\n% Nahradenie identi"
"fikatorov \"xI\" identifikatormi \"u(I)\" %\nco_str = '{''x1'; cim_str = '{''"
"u(1)';\n\nfor k = 2 : n\n co_str = sprintf('%s'',''x%d', co_str, k);\n "
"cim_str = sprintf('%s'',''u(%d)', cim_str, k);\nend\n\nco_str = strcat(co_str"
", '''}'); cim_str = strcat(cim_str, '''}');\nZ = eval(sprintf('subs(Z,%s,%s)'"
", co_str, cim_str));"
MaskDisplay "disp('Q = Q(X)');"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate none
MaskIconUnits autoscale
MaskValueString "3|[2 1]|[x1; 84.249*x2*x3; x3]|0"
System {
Name "Coordinates transformation\nfor MIMO "
"systems"
Location [149, 235, 423, 350]
Open off
ToolBar off
StatusBar off
ScreenColor white
PaperOrientation landscape
PaperPositionMode auto
PaperType usletter
PaperUnits inches
Block {
BlockType Inport
Name "x"
Position [15, 38, 45, 52]
Port "1"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType "S-Function"
Name "S-funkcia realizujuca\ntransformaci"
"u suradnic"
Ports [1, 1, 0, 0, 0]
Position [80, 20, 190, 70]
FunctionName "transf_mimo"
Parameters "n,r,Z"
PortCounts "[]"
SFunctionModules "''"
}
Block {
BlockType Outport
Name "q"
Position [230, 38, 260, 52]
Port "1"
OutputWhenDisabled held
InitialOutput "[]"
}
Line {
SrcBlock "x"
SrcPort 1
DstBlock "S-funkcia realizujuca\ntransformaci"
"u suradnic"
DstPort 1
}
Line {
SrcBlock "S-funkcia realizujuca\ntransformaci"
"u suradnic"
SrcPort 1
DstBlock "q"
DstPort 1
}
}
}
Block {
BlockType SubSystem
Name "Coordinates transformation\nfor SISO sy"
"stems"
Ports [1, 1, 0, 0, 0]
Position [195, 20, 255, 50]
Orientation left
ShowPortLabels on
MaskType "Coordinates transformation for SISO sys"
"tems"
MaskDescription "This block performs a nonlinear transfo"
"rmation of system state variables according to the exact linearization rules."
" Together with the corresponding \"Linearizing control law\" block, it implem"
"ents a transformation\n\n dx/dt = f(x) + g(x) u ---> "
" dq/dt = Aq + bv\n y = h(x) -"
"--> y = cq\n\ni.e. the transformation of a nonlinear system i"
"nto a linear and controllable form. This version of the block is designed for"
" use with SISO systems. To compute the coordinates transformation q = q(x) fo"
"r a given system, the \"Exakt.m\" application can be used.\n\nTransformation "
"formula can be specified either as a symbolic expression or as an identifier "
"of a symbolic variable.\n\nFor a detailed description of block parameters, cl"
"ick \"Help\" button below."
MaskHelp "web(fullfile(cd,'help','transf_surad.ht"
"ml'));"
MaskPromptString "System order (number of states, N):|Rel"
"ative degree of the system (r <= n):|Transformation formula - symbolic expres"
"sion: q = q(x) = |Transformation formula - variable identifier:"
MaskStyleString "edit,edit,edit,edit"
MaskTunableValueString "on,on,on,on"
MaskVariables "n=@1;r=@2;Z=&3;Zp=@4;"
MaskInitialization "% Overenie spravnosti zadania parametro"
"v bloku %\nif ~isempty(Z) & (Zp == 0)\n Z = sym(Z);\nelseif isempty(Z) & (a"
"ny(Zp ~= 0))\n Z = Zp;\nelse\n error(['Transformation formula not specifi"
"ed or specified more than once - cannot continue!']);\nend\n\n% Zisti si symb"
"olicke premenne, ktore vystupuju vo vyraze %\nprem = strrep(strrep(findsym(sy"
"m(Z)),', ',''),',',' ');\n\n% Premenne x1, x2, ..., xN su korektne, preskoc i"
"ch %\nfor k = 1 : n\n prem = strrep(prem, sprintf('x%d',k), '');\nend\n\n% "
"Ak retazec nezostal prazdny, vyhlas chybu %\nif ~isempty(prem)\n error(['Un"
"known symbol found in transformation formula - cannot continue!']);\nend\n\ni"
"f (r > n)\n error('Error: Relative degree cannot be higher than system order!"
"');\nend\n\n% Otestovanie spravnosti rozmeru matice Z (podla \"r\") %\nif ~al"
"l(size(sym(Z)) == [r,1])\n error(['Wrong number of transformation equations"
"!']);\nend\n\n% Nahradenie identifikatorov \"xI\" identifikatormi \"u(I)\" %"
"\nco_str = '{''x1'; cim_str = '{''u(1)';\n\nfor k = 2 : n\n co_str = sprin"
"tf('%s'',''x%d', co_str, k);\n cim_str = sprintf('%s'',''u(%d)', cim_str, "
"k);\nend\n\nco_str = strcat(co_str, '''}'); cim_str = strcat(cim_str, '''}');"
"\nZ = eval(sprintf('subs(Z,%s,%s)', co_str, cim_str));"
MaskDisplay "disp('q = q(x)');"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate none
MaskIconUnits autoscale
MaskValueString "2|2|[x2; sqrt(x1)-sqrt(x2)]|0"
System {
Name "Coordinates transformation\nfor SISO "
"systems"
Location [149, 235, 423, 350]
Open off
ToolBar off
StatusBar off
ScreenColor white
PaperOrientation landscape
PaperPositionMode auto
PaperType usletter
PaperUnits inches
Block {
BlockType Inport
Name "x"
Position [15, 38, 45, 52]
Port "1"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType "S-Function"
Name "S-funkcia realizujuca\ntransformaci"
"u suradnic"
Ports [1, 1, 0, 0, 0]
Position [80, 20, 190, 70]
FunctionName "transf_surad"
Parameters "n,r,Z"
PortCounts "[]"
SFunctionModules "''"
}
Block {
BlockType Outport
Name "q"
Position [230, 38, 260, 52]
Port "1"
OutputWhenDisabled held
InitialOutput "[]"
}
Line {
SrcBlock "x"
SrcPort 1
DstBlock "S-funkcia realizujuca\ntransformaci"
"u suradnic"
DstPort 1
}
Line {
SrcBlock "S-funkcia realizujuca\ntransformaci"
"u suradnic"
SrcPort 1
DstBlock "q"
DstPort 1
}
}
}
Block {
BlockType SubSystem
Name "Demonstracne simulacie"
Ports [0, 0, 0, 0, 0]
Position [588, 43, 690, 118]
DropShadow on
ShowName off
OpenFcn "demos_exakt"
ShowPortLabels on
MaskDisplay "disp('Demo\\nsimulations')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate none
MaskIconUnits autoscale
System {
Name "Demonstracne simulacie"
Location [378, 306, 630, 435]
Open off
ToolBar off
StatusBar off
ScreenColor white
PaperOrientation landscape
PaperPositionMode auto
PaperType usletter
PaperUnits inches
}
}
Block {
BlockType SubSystem
Name "Linear controller\nfor MIMO systems"
Ports [2, 1, 0, 0, 0]
Position [330, 104, 415, 151]
ShowPortLabels on
MaskType "State-space controller for an integrato"
"r-type MIMO system"
MaskDescription "This block works as a linear state-spac"
"e controller for MIMO systems with autonomous subsystems of \"rI-integrator\""
" type described by state-space equations in a so-called 1st Frobenius form (s"
"ee help for details). Controller is calculated via pole placement technique d"
"uring block initialization. Block is typically used in exact-linearization-ba"
"sed control loops.\n\nImportant: This controller is intended ONLY to control "
"linear MIMO systems of the structure described above and does not work correc"
"tly with any other systems!\n\nFor a detailed description of block parameters"
", click \"Help\" button below."
MaskHelp "web(fullfile(cd,'help','ppreg_mimo.html"
"'));"
MaskPromptString "Orders of subsystems of the linear MIMO"
" system:|Number of inputs/outputs of the system:|Desired poles of a closed-lo"
"op system:|Controller includes integral actions (one per each subsystem)"
MaskStyleString "edit,edit,edit,checkbox"
MaskTunableValueString "on,on,on,on"
MaskVariables "r=@1;nout=@2;kor=@3;integ=@4;"
MaskInitialization "if ~all(r>0)\n error('Linear controll"
"er: Invalid subsytem orders!');\nend\nif (nout<0)\n error('Linear controlle"
"r: Wrong number of inputs/outputs!');\nend\nif (size(r)~=[nout,1]) & (size(r)"
"~=[1,nout])\n error('Linear controller: Number of subsystems not correspond"
"ing with the number of inputs/outputs!');\nend\nif (length(kor) ~= sum(r)+nou"
"t*integ)\n error('Linear controller: Wrong number of desired poles!');\nend"
"\n\nC = zeros(nout,sum(r));\nK = zeros(nout,sum(r));\nKi = zeros(nout,1);\nP "
"= zeros(nout,1);\n\ni1 = 1;\ni2 = 1;\nfor l = 1 : nout\n\n char_polynom = p"
"oly(kor(i1:i1+r(l)+integ-1));\n K(l,i2:i2+r(l)-1) = fliplr(char_polynom(2:r"
"(l)+1));\n C(l,i2) = 1;\n\n if (integ)\n Ki(l) = char_polynom(r(l)+2"
");\n P(l) = 0;\n else\n Ki(l) = 0;\n P(l) = char_polynom(end"
");\n end\n\n i1 = i1+r(l)+integ;\n i2 = i2+r(l);\nend\n\nKi = diag(Ki);"
"\nP = diag(P);"
MaskDisplay "disp('Pole Placement\\nMIMO');"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate none
MaskIconUnits autoscale
MaskValueString "[2 1]|2|[-20 -20 -20]|off"
System {
Name "Linear controller\nfor MIMO systems"
Location [152, 125, 700, 357]
Open off
ToolBar off
StatusBar off
ScreenColor white
PaperOrientation landscape
PaperPositionMode auto
PaperType usletter
PaperUnits inches
Block {
BlockType Inport
Name "w"
Position [15, 38, 45, 52]
Port "1"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Inport
Name "q"
Position [15, 163, 45, 177]
Port "2"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Reference
Name "C"
Ports [1, 1, 0, 0, 0]
Position [100, 105, 130, 135]
SourceBlock "simulink/Linear/Matrix\nGain"
SourceType "Matrix Gain"
K "C"
}
Block {
BlockType Integrator
Name "I - zlozka"
Ports [1, 1, 0, 0, 0]
Position [280, 90, 310, 120]
ExternalReset none
InitialConditionSource internal
InitialCondition "0"
LimitOutput off
UpperSaturationLimit "inf"
LowerSaturationLimit "-inf"
ShowSaturationPort off
ShowStatePort off
AbsoluteTolerance "auto"
}
Block {
BlockType Reference
Name "K"
Ports [1, 1, 0, 0, 0]
Position [365, 155, 395, 185]
SourceBlock "simulink/Linear/Matrix\nGain"
SourceType "Matrix Gain"
K "K"
}
Block {
BlockType Reference
Name "Ki"
Ports [1, 1, 0, 0, 0]
Position [215, 90, 245, 120]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -