📄 nelinsys.mdl
字号:
"o %\nfor k = 1 : nout\n prem = strrep(prem, sprintf('v%d',k), '');\nend\n\n"
"% Ak retazec nezostal prazdny, vyhlas chybu %\nif ~isempty(prem)\n error(['"
"Unknown symbol in the linearizing law - cannot continue!']);\nend\n\n% Nahrad"
"enie identifikatorov \"xI\" identifikatormi \"u(I+nout)\" %\nco_str = '{''x1'"
"; cim_str = sprintf('{''u(%d)',nout+1);\n\nfor k = 2 : n\n co_str = sprint"
"f('%s'',''x%d', co_str, k);\n cim_str = sprintf('%s'',''u(%d)', cim_str, n"
"out+k);\nend\n\n% Nahradenie identifikatorov \"vI\" identifikatormi \"u(1)\" "
"%\nfor k = 1 : nout\n co_str = sprintf('%s'',''v%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, '''}');\nvzorec = eval(sprintf('subs(vzorec,%"
"s,%s)', co_str, cim_str));\n"
MaskDisplay "disp('U = U(X,V)');"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate none
MaskIconUnits autoscale
MaskValueString "3|2|[1167173990052591/17592186044416000"
"*x1*x3+1/40*x2+2/421245/x3*v1-1/2500*x2/x3*v2; 153846/9799*x3+10000/9799*v2]|"
"0"
System {
Name "Linearizing control law\nfor MIMO sys"
"tems"
Location [322, 144, 608, 280]
Open off
ToolBar off
StatusBar off
ScreenColor white
PaperOrientation landscape
PaperPositionMode auto
PaperType usletter
PaperUnits inches
Block {
BlockType Inport
Name "v"
Position [25, 28, 55, 42]
Port "1"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Inport
Name "x"
Position [25, 73, 55, 87]
Port "2"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Mux
Name "Mux"
Ports [2, 1, 0, 0, 0]
Position [100, 37, 105, 73]
BackgroundColor black
ShowName off
Inputs "2"
}
Block {
BlockType "S-Function"
Name "s-funkcia pocita\nakcny zasah\nna z"
"aklade x,v\n"
Ports [1, 1, 0, 0, 0]
Position [130, 38, 210, 72]
FunctionName "lineariz_mimo"
Parameters "n,nout,vzorec"
PortCounts "[]"
SFunctionModules "''"
}
Block {
BlockType Outport
Name "u"
Position [235, 48, 265, 62]
Port "1"
OutputWhenDisabled held
InitialOutput "0"
}
Line {
SrcBlock "s-funkcia pocita\nakcny zasah\nna z"
"aklade x,v\n"
SrcPort 1
DstBlock "u"
DstPort 1
}
Line {
SrcBlock "Mux"
SrcPort 1
DstBlock "s-funkcia pocita\nakcny zasah\nna z"
"aklade x,v\n"
DstPort 1
}
Line {
SrcBlock "v"
SrcPort 1
Points [25, 0]
DstBlock "Mux"
DstPort 1
}
Line {
SrcBlock "x"
SrcPort 1
Points [25, 0]
DstBlock "Mux"
DstPort 2
}
}
}
Block {
BlockType SubSystem
Name "Linearizing control law\nfor SISO syste"
"ms"
Ports [2, 1, 0, 0, 0]
Position [45, 14, 120, 56]
ShowPortLabels on
MaskType "Linearizing control law for SISO 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 SISO "
"systems. To compute the linearization control law u = u(x,v) for a given syst"
"em, the \"Exakt.m\" application can be used.\n\nLinearizing control law can b"
"e specified either as a symbolic expression or as an identifier of a symbolic"
" variable.\n\nFor a detailed description of block parameters, click \"Help\" "
"button below."
MaskHelp "web(fullfile(cd,'help','lineariz_vztah."
"html'));"
MaskPromptString "System order (number of states, N)|Line"
"arizing law - symbolic expression: u = u(x,v) =|Linearizing law - variable id"
"entifier:"
MaskStyleString "edit,edit,edit"
MaskTunableValueString "on,on,on"
MaskVariables "n=@1;vzorec=&2;vzorecP=@3;"
MaskInitialization "% Overenie spravnosti zadania parametro"
"v bloku %\nif isempty(n)\n error(['System order not specified - cannot cont"
"inue!']);\nend\n\nif ~isempty(vzorec) & (vzorecP == 0)\n vzorec = sym(vzore"
"c);\nelseif 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 vystupuj"
"u vo vyraze %\nprem = strrep(strrep(findsym(sym(vzorec)),', ',''),',',' ');\n"
"\n% Premenne x1, x2, ..., xN su korektne, preskoc ich %\nfor k = 1 : n\n pr"
"em = strrep(prem, sprintf('x%d',k), '');\nend\n\n% Aj \"v\" je korektne, pres"
"koc aj to %\nprem = strrep(prem,'v','');\n\n% Ak niektory retazec nezostal pr"
"azdny, vyhlas chybu %\nif ~isempty(prem)\n error(['Unknown symbol in the li"
"nearizing law - cannot continue!']);\nend\n\n% Nahradenie identifikatorov \"x"
"I\" identifikatormi \"u(I+1)\" a \"v\" pomocou \"u(1)\" %\nco_str = '{''v'','"
"'x1'; cim_str = '{''u(1)'',''u(2)';\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+1);"
"\nend\n\nco_str = strcat(co_str, '''}'); cim_str = strcat(cim_str, '''}');\nv"
"zorec = eval(sprintf('subs(vzorec,%s,%s)', co_str, cim_str));\n"
MaskDisplay "disp('u = u(x,v)');"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate none
MaskIconUnits autoscale
MaskValueString "2|x1/sqrt(x2)+2*sqrt(x1)*v|0"
System {
Name "Linearizing control law\nfor SISO sys"
"tems"
Location [322, 144, 608, 280]
Open off
ToolBar off
StatusBar off
ScreenColor white
PaperOrientation landscape
PaperPositionMode auto
PaperType usletter
PaperUnits inches
Block {
BlockType Inport
Name "v"
Position [25, 28, 55, 42]
Port "1"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Inport
Name "x"
Position [25, 73, 55, 87]
Port "2"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Mux
Name "Mux"
Ports [2, 1, 0, 0, 0]
Position [100, 37, 105, 73]
BackgroundColor black
ShowName off
Inputs "2"
}
Block {
BlockType "S-Function"
Name "s-funkcia pocita\nakcny zasah\nna z"
"aklade x,v\n"
Ports [1, 1, 0, 0, 0]
Position [130, 38, 210, 72]
FunctionName "lineariz_vztah"
Parameters "n,vzorec"
PortCounts "[]"
SFunctionModules "''"
}
Block {
BlockType Outport
Name "u"
Position [235, 48, 265, 62]
Port "1"
OutputWhenDisabled held
InitialOutput "0"
}
Line {
SrcBlock "s-funkcia pocita\nakcny zasah\nna z"
"aklade x,v\n"
SrcPort 1
DstBlock "u"
DstPort 1
}
Line {
SrcBlock "Mux"
SrcPort 1
DstBlock "s-funkcia pocita\nakcny zasah\nna z"
"aklade x,v\n"
DstPort 1
}
Line {
SrcBlock "v"
SrcPort 1
Points [25, 0]
DstBlock "Mux"
DstPort 1
}
Line {
SrcBlock "x"
SrcPort 1
Points [25, 0]
DstBlock "Mux"
DstPort 2
}
}
}
Annotation {
Position [276, 32]
Text "x(t)"
}
Annotation {
Position [276, 122]
Text "x(t)"
}
Annotation {
Position [176, 32]
Text "q(t)"
}
Annotation {
Position [176, 122]
Text "q(t)"
}
Annotation {
Position [141, 32]
Text "u(t)"
}
Annotation {
Position [141, 122]
Text "u(t)"
}
Annotation {
Position [26, 22]
Text "v(t)"
}
Annotation {
Position [26, 47]
Text "x(t)"
}
Annotation {
Position [26, 112]
Text "v(t)"
}
Annotation {
Position [26, 137]
Text "x(t)"
}
Annotation {
Position [311, 22]
Text "w(t)"
}
Annotation {
Position [311, 47]
Text "q(t)"
}
Annotation {
Position [436, 37]
Text "v(t)"
}
Annotation {
Position [311, 112]
Text "w(t)"
}
Annotation {
Position [311, 137]
Text "q(t)"
}
Annotation {
Position [436, 127]
Text "v(t)"
}
}
}
Block {
BlockType SubSystem
Name "Gain Scheduling Blocks"
Ports [0, 0, 0, 0, 0]
Position [455, 135, 584, 209]
DropShadow on
ShowPortLabels off
MaskType "Blocks for Gain Scheduling"
MaskDisplay "disp('Gain Scheduling');"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate none
MaskIconUnits autoscale
System {
Name "Gain Scheduling Blocks"
Location [454, 274, 744, 444]
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 [179, 20, 265, 59]
DropShadow on
OpenFcn "progzos"
ShowPortLabels on
MaskType "Gain Scheduling - controller design for"
" SISO systems"
MaskDisplay "disp('GS SISO');"
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 "Demonstracne simulacie"
Ports [0, 0, 0, 0, 0]
Position [84, 110, 220, 151]
DropShadow on
ShowName off
OpenFcn "demos_gs"
ShowPortLabels on
MaskType "Gain Scheduling - demo simulations"
MaskDisplay "disp('Demo simulations');"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate none
MaskIconUnits autoscale
System {
Name "Demonstracne simulacie"
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 "State-space gain-scheduling\ncontroller"
" for SISO systems"
Ports [2, 1, 0, 0, 0]
Position [45, 19, 125, 66]
ShowPortLabels on
MaskType "State-space gain-scheduling controller "
"for SISO systems"
MaskDescription "Block carries out control action of a s"
"tate-space controller for nonlinear SISO system. The control action equation "
"u = u(w,x) can be specified either as a symbolic expression or as an identifi"
"er of a symbolic variable.\n\nBlock is typically used in place of
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -