📄 nelinsys.mdl
字号:
SourceBlock "simulink/Linear/Matrix\nGain"
SourceType "Matrix Gain"
K "Ki"
}
Block {
BlockType Mux
Name "Mux"
Ports [2, 1, 0, 0, 0]
Position [345, 16, 350, 134]
BackgroundColor black
ShowName off
Inputs "2"
}
Block {
BlockType Reference
Name "P*w"
Ports [1, 1, 0, 0, 0]
Position [215, 30, 245, 60]
SourceBlock "simulink/Linear/Matrix\nGain"
SourceType "Matrix Gain"
K "P"
}
Block {
BlockType Selector
Name "Selector1"
Position [385, 60, 415, 90]
ShowName off
Elements "~integ*(1:nout)+integ*(nout+1:2*nou"
"t)"
InputPortWidth "2*nout"
}
Block {
BlockType Sum
Name "Sum"
Ports [2, 1, 0, 0, 0]
Position [450, 29, 470, 216]
ShowName off
Inputs "+-"
}
Block {
BlockType Sum
Name "Sum1"
Ports [2, 1, 0, 0, 0]
Position [165, 74, 180, 136]
ShowName off
Inputs "+-"
}
Block {
BlockType Outport
Name "v"
Position [500, 118, 530, 132]
Port "1"
OutputWhenDisabled held
InitialOutput "0"
}
Line {
SrcBlock "Sum"
SrcPort 1
DstBlock "v"
DstPort 1
}
Line {
SrcBlock "K"
SrcPort 1
DstBlock "Sum"
DstPort 2
}
Line {
SrcBlock "Ki"
SrcPort 1
DstBlock "I - zlozka"
DstPort 1
}
Line {
SrcBlock "C"
SrcPort 1
DstBlock "Sum1"
DstPort 2
}
Line {
SrcBlock "Sum1"
SrcPort 1
DstBlock "Ki"
DstPort 1
}
Line {
SrcBlock "Selector1"
SrcPort 1
DstBlock "Sum"
DstPort 1
}
Line {
SrcBlock "Mux"
SrcPort 1
DstBlock "Selector1"
DstPort 1
}
Line {
SrcBlock "I - zlozka"
SrcPort 1
DstBlock "Mux"
DstPort 2
}
Line {
SrcBlock "q"
SrcPort 1
Points [20, 0]
Branch {
DstBlock "K"
DstPort 1
}
Branch {
Points [0, -50]
DstBlock "C"
DstPort 1
}
}
Line {
SrcBlock "P*w"
SrcPort 1
DstBlock "Mux"
DstPort 1
}
Line {
SrcBlock "w"
SrcPort 1
Points [20, 0]
Branch {
Points [0, 45]
DstBlock "Sum1"
DstPort 1
}
Branch {
DstBlock "P*w"
DstPort 1
}
}
}
}
Block {
BlockType SubSystem
Name "Linear controller\nfor SISO systems"
Ports [2, 1, 0, 0, 0]
Position [330, 14, 415, 61]
ShowPortLabels on
MaskType "State-space controller for an \"r-integ"
"rator\" SISO system"
MaskDescription "This block works as a linear state-spac"
"e controller for an \"r-integrator\" SISO system in a so-called 1st Frobenius"
" form (see help for details). Controller is calculated via pole placement tec"
"hnique during block initialization. Block is typically used in exact-lineariz"
"ation-based control loops.\n\nImportant: This controller is intended ONLY to "
"control linear \"r-integrator\" SISO systems in 1st Frobenius form and does n"
"ot work correctly with any other systems!\n\nFor a detailed description of bl"
"ock parameters, click \"Help\" button below."
MaskHelp "web(fullfile(cd,'help','ppreg_siso.html"
"'));"
MaskPromptString "Linear system order:|Desired poles of a"
" closed-loop system:|Controller includes integral action"
MaskStyleString "edit,edit,checkbox"
MaskTunableValueString "on,on,on"
MaskVariables "r=@1;kor=@2;integ=@3;"
MaskInitialization "if (length(kor) ~= r+integ)\n er"
"ror('Linear controller: Wrong number of desired poles');\nend\n\nchar_polynom"
" = poly(kor);\nK = fliplr(char_polynom(2:r+1));\n\nif (integ)\n Ki =ch"
"ar_polynom(r+2);\nelse\n Ki = 0;\nend"
MaskDisplay "disp('Pole Placement\\nSISO');"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate none
MaskIconUnits autoscale
MaskValueString "2|[-2 -2]|off"
System {
Name "Linear controller\nfor SISO 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 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 Gain
Name "Ki"
Position [220, 90, 250, 120]
Gain "Ki"
}
Block {
BlockType Mux
Name "Mux"
Ports [2, 1, 0, 0, 0]
Position [345, 16, 350, 134]
BackgroundColor black
ShowName off
Inputs "2"
}
Block {
BlockType Gain
Name "P*w"
Position [220, 30, 250, 60]
Gain "char_polynom(end)"
}
Block {
BlockType Selector
Name "Selector1"
Position [385, 60, 415, 90]
ShowName off
Elements "integ+1"
InputPortWidth "2"
}
Block {
BlockType Sum
Name "Sum"
Ports [2, 1, 0, 0, 0]
Position [450, 29, 470, 216]
ShowName off
Inputs "+-"
}
Block {
BlockType Sum
Name "Sum1"
Ports [2, 1, 0, 0, 0]
Position [165, 74, 180, 136]
ShowName off
Inputs "+-"
}
Block {
BlockType Selector
Name "y"
Position [100, 105, 130, 135]
Elements "1"
InputPortWidth "r"
}
Block {
BlockType Outport
Name "v"
Position [500, 118, 530, 132]
Port "1"
OutputWhenDisabled held
InitialOutput "0"
}
Line {
SrcBlock "w"
SrcPort 1
Points [20, 0]
Branch {
DstBlock "P*w"
DstPort 1
}
Branch {
Points [0, 45]
DstBlock "Sum1"
DstPort 1
}
}
Line {
SrcBlock "P*w"
SrcPort 1
DstBlock "Mux"
DstPort 1
}
Line {
SrcBlock "q"
SrcPort 1
Points [20, 0]
Branch {
Points [0, -50]
DstBlock "y"
DstPort 1
}
Branch {
DstBlock "K"
DstPort 1
}
}
Line {
SrcBlock "I - zlozka"
SrcPort 1
DstBlock "Mux"
DstPort 2
}
Line {
SrcBlock "Mux"
SrcPort 1
DstBlock "Selector1"
DstPort 1
}
Line {
SrcBlock "Selector1"
SrcPort 1
DstBlock "Sum"
DstPort 1
}
Line {
SrcBlock "Sum1"
SrcPort 1
DstBlock "Ki"
DstPort 1
}
Line {
SrcBlock "y"
SrcPort 1
DstBlock "Sum1"
DstPort 2
}
Line {
SrcBlock "Ki"
SrcPort 1
DstBlock "I - zlozka"
DstPort 1
}
Line {
SrcBlock "K"
SrcPort 1
DstBlock "Sum"
DstPort 2
}
Line {
SrcBlock "Sum"
SrcPort 1
DstBlock "v"
DstPort 1
}
}
}
Block {
BlockType SubSystem
Name "Linearizing control law\nfor MIMO syste"
"ms"
Ports [2, 1, 0, 0, 0]
Position [45, 104, 120, 146]
ShowPortLabels on
MaskType "Linearizing control law for MIMO system"
"s"
MaskDescription "This block performs a feedback compensa"
"tion of system nonlinearities according to the exact linearization rules. Tog"
"ether with the \"Coordinates transformation\" block, it implements a transfor"
"mation\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 into a linear an"
"d controllable form. This version of the block is designed for use with MIMO "
"systems. To compute the linearization control law U = U(X,V) for a given syst"
"em, the \"ExaktMimo.m\" application can be used.\n\nLinearizing control law c"
"an be specified either as a symbolic expression or as an identifier of a symb"
"olic variable.\n\nFor a detailed description of block parameters, click \"Hel"
"p\" button below."
MaskHelp "web(fullfile(cd,'help','lineariz_mimo.h"
"tml'));"
MaskPromptString "System order (number of states, N)|Numb"
"er of system outputs:|Linearizing law - symbolic expression: u = U(x,v) =|Lin"
"earizing law - variable identifier:"
MaskStyleString "edit,edit,edit,edit"
MaskTunableValueString "on,on,on,on"
MaskVariables "n=@1;nout=@2;vzorec=&3;vzorecP=@4;"
MaskInitialization "% Overenie spravnosti zadania parametro"
"v bloku %\nif ~isempty(vzorec) & (vzorecP == 0)\n vzorec = sym(vzorec);\nel"
"seif isempty(vzorec) & (any(vzorecP ~= 0))\n vzorec = sym(vzorecP);\nelse\n"
" error(['Linearizing law not specified or specified more than once - cannot"
" continue!']);\nend\n\n% Zisti si symbolicke premenne, ktore vystupuju vo vyr"
"aze %\nprem = strrep(strrep(findsym(sym(vzorec)),', ',''),',',' ');\n\n% Prem"
"enne x1, x2, ..., xN su korektne, preskoc ich %\nfor k = 1 : n\n prem = str"
"rep(prem, sprintf('x%d',k), '');\nend\n\n% Aj \"v\" je korektne, preskoc aj t"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -