📄 nelinsys.mdl
字号:
Library {
Name "NelinSys"
Version 2.20
BlockDefaults {
Orientation right
ForegroundColor black
BackgroundColor white
DropShadow off
NamePlacement normal
FontName "Helvetica"
FontSize 10
FontWeight normal
FontAngle normal
ShowName on
}
AnnotationDefaults {
HorizontalAlignment center
VerticalAlignment middle
ForegroundColor black
BackgroundColor white
DropShadow off
FontName "Helvetica"
FontSize 10
FontWeight normal
FontAngle normal
}
LineDefaults {
FontName "Helvetica"
FontSize 9
FontWeight normal
FontAngle normal
}
System {
Name "NelinSys"
Location [162, 97, 626, 396]
Open on
ToolBar off
StatusBar off
ScreenColor white
PaperOrientation landscape
PaperPositionMode auto
PaperType usletter
PaperUnits inches
Block {
BlockType SubSystem
Name "Nonlinear Systems Analysis"
Ports [0, 0, 0, 0, 0]
Position [48, 84, 213, 182]
DropShadow on
ShowPortLabels on
MaskType "Nonlinear Systems Analysis"
MaskDisplay "disp('Analysis');"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate none
MaskIconUnits autoscale
System {
Name "Nonlinear Systems Analysis"
Location [46, 104, 683, 386]
Open off
ToolBar off
StatusBar off
ScreenColor white
PaperOrientation landscape
PaperPositionMode auto
PaperType usletter
PaperUnits inches
Block {
BlockType SubSystem
Name "Demo simulations"
Ports [0, 0, 0, 0, 0]
Position [516, 147, 613, 191]
DropShadow on
OpenFcn "demos_fp"
ShowPortLabels on
MaskDisplay "disp('Phase Plane\\nAnalysis')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate none
MaskIconUnits autoscale
System {
Name "Demo simulations"
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 "Phase Portraits of 1st-Order Loops\nwith Ha"
"rd Nonlinearities"
Ports [0, 2, 0, 0, 0]
Position [270, 31, 435, 109]
ShowPortLabels on
MaskType "Phase-Plane Portrait of a 1st-Order Loop wi"
"th a Hard Nonlinearity"
MaskDescription "\nComputation of a phase-plane portrait of "
"a closed loop system consisting of an isolated hard nonlinearity and a linear"
" part specified by a 1st-order transfer function.\n\nBlock has two vector out"
"puts, y = x1 (system output) and y' = x2 (derivative of the system output), i"
".e. horizontal and vertical coordinates of phase-plane trajectories correspon"
"ding to different initial conditions - the initial conditions themselves are "
"specified by the vector x1(0) below.\n\nIt is recommended to use the \"Vector"
" XY Graph for Phase Portraits\" block to plot the portrait graphically, since"
" the \"XY Graph\" block from Sinks library cannot handle vector inputs.\n\nFo"
"r a detailed description of the block, click \"Help\" button.\n\n"
MaskHelp "web(fullfile(cd,'help','fazrov_typ1.html'))"
";"
MaskPromptString "Linear part - transfer function numerator:|"
"Linear part - transfer function denominator:|Nonlinear part - nonlinearity ty"
"pe:|Nonlinear part - parameters:|Setpoint:|Initial conditions: x1(0) = y(0) ="
MaskStyleString "edit,edit,popup(Ideal relay|Saturation|Rela"
"y with dead-zone|Relay with hysteresis),edit,edit,edit"
MaskTunableValueString "on,on,on,on,on,on"
MaskVariables "num=@1;den=@2;nelintyp=@3;nelinpar=@4;w=@5;"
"x10=@6;"
MaskInitialization "if (length(den) ~= 2) | (length(num) ~= 1) "
"| (den(1) == 0)\n error('Linear part must be a 1st-order system!');\nend\n"
"\nif (nelintyp == 1) & (length(nelinpar) ~= 2)\n error('Invalid number of "
"nonlinearity parameters!');\nend\nif (nelintyp > 1) & ((length(nelinpar) ~= 4"
") | nelinpar(1) > nelinpar(3))\n error('Invalid nonlinearity parameters!')"
";\nend\n\nfor k = 1:length(x10)\n if (w-x10(k)>nelinpar(1)) & (w-x10(k)<ne"
"linpar(3))\n error(['Invalid initial conditions!']);\n end\nend"
MaskDisplay "disp('Phase Portraits of\\n1st-Order Loops"
"\\nwith Hard Nonlinearities');"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate none
MaskIconUnits autoscale
MaskValueString "0.01|[1 0.01]|Relay with hysteresis|[-1 0 1"
" 100]|20|[0 25]"
System {
Name "Phase Portraits of 1st-Order Loops\nwith "
"Hard Nonlinearities"
Location [209, 285, 475, 460]
Open off
ToolBar off
StatusBar off
ScreenColor white
PaperOrientation landscape
PaperPositionMode auto
PaperType usletter
PaperUnits inches
Block {
BlockType Demux
Name "Demux"
Ports [1, 3, 0, 0, 0]
Position [185, 18, 190, 162]
BackgroundColor black
ShowName off
Outputs "[length(x10) length(x10) 1]"
}
Block {
BlockType "S-Function"
Name "S-funkcia realizujuca\nvypocet fazoveho"
" portretu"
Ports [0, 1, 0, 0, 0]
Position [20, 55, 150, 125]
FunctionName "fazrov_typ1"
Parameters "num,den,w,nelintyp,nelinpar,x10"
PortCounts "[]"
SFunctionModules "''"
}
Block {
BlockType Stop
Name "Stop Simulation"
Position [220, 117, 255, 153]
ShowName off
}
Block {
BlockType Outport
Name "x1(t)"
Position [220, 38, 250, 52]
Port "1"
OutputWhenDisabled held
InitialOutput "[]"
}
Block {
BlockType Outport
Name "x2(t)"
Position [220, 83, 250, 97]
Port "2"
OutputWhenDisabled held
InitialOutput "[]"
}
Line {
SrcBlock "Demux"
SrcPort 1
DstBlock "x1(t)"
DstPort 1
}
Line {
SrcBlock "S-funkcia realizujuca\nvypocet fazoveho"
" portretu"
SrcPort 1
DstBlock "Demux"
DstPort 1
}
Line {
SrcBlock "Demux"
SrcPort 2
DstBlock "x2(t)"
DstPort 1
}
Line {
SrcBlock "Demux"
SrcPort 3
DstBlock "Stop Simulation"
DstPort 1
}
}
}
Block {
BlockType SubSystem
Name "Phase Portraits of 1st-Order Systems"
Ports [0, 2, 0, 0, 0]
Position [35, 31, 200, 109]
ShowPortLabels on
MaskType "Phase-Plane Portrait of a 1st-Order Autonom"
"ous System"
MaskDescription "\nComputation of a phase-plane portrait of "
"a 1st-order nonlinear autonomous system. The system is specified by a differe"
"ntial equation y' + f(y) = 0, where y(t) is the output of the system and f(y)"
" is arbitrary continuous function.\n\nBlock has two vector outputs, y = x1 an"
"d y' = x2, i.e. horizontal and vertical coordinates of phase-plane trajectori"
"es corresponding to different initial conditions - the initial conditions the"
"mselves are specified by the vector x1(0) below.\n\nIt is recommended to use "
"the \"Vector XY Graph for Phase Portraits\" block to plot the portrait graphi"
"cally, since the \"XY Graph\" block from Sinks library cannot handle vector i"
"nputs.\n\nFor a detailed description of the block, click \"Help\" button.\n\n"
MaskHelp "web(fullfile(cd,'help','fazrov_auton1.html'"
"));"
MaskPromptString "System differential equation: y' + f(y) = 0"
":|Initial conditions: y(0) = x1(0) ="
MaskStyleString "edit,edit"
MaskTunableValueString "on,on"
MaskVariables "vRovnica=&1;x10=@2;"
MaskInitialization "% Overenie, ci system nie je vyssieho radu "
"%\nif (~strcmp(findsym(sym(vRovnica)),'Dy, y') & ~strcmp(findsym(sym(vRovnica"
")),'Dy'))\n error('Error: Invalid differential equation!');\nend\n\n% "
"Vyjadrenie derivacie vystupu z rovnice %\nskt = solve(vRovnica, 'Dy');"
MaskDisplay "disp('Phase Portraits of 1st-Order\\nAutono"
"mous Systems\\n\\ny'' + f (y) = 0');"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate none
MaskIconUnits autoscale
MaskValueString "Dy-y^2+1=0|[-10 0.9999 (1+1e-6)]"
System {
Name "Phase Portraits of 1st-Order Systems"
Location [209, 281, 491, 432]
Open off
ToolBar off
StatusBar off
ScreenColor white
PaperOrientation landscape
PaperPositionMode auto
PaperType usletter
PaperUnits inches
Block {
BlockType Demux
Name "Demux"
Ports [1, 3, 0, 0, 0]
Position [200, 11, 205, 129]
BackgroundColor black
ShowName off
Outputs "[length(x10) length(x10) 1]"
}
Block {
BlockType "S-Function"
Name "S-funkcia realizujuca\nvypocet fazoveho"
" portretu"
Ports [0, 1, 0, 0, 0]
Position [30, 35, 160, 105]
FunctionName "fazrov_auton1"
Parameters "skt,x10"
PortCounts "[]"
SFunctionModules "''"
}
Block {
BlockType Stop
Name "Stop Simulation"
Position [235, 92, 270, 128]
ShowName off
}
Block {
BlockType Outport
Name "x1(t)"
Position [235, 23, 265, 37]
Port "1"
OutputWhenDisabled held
InitialOutput "[]"
}
Block {
BlockType Outport
Name "x2(t)"
Position [235, 63, 265, 77]
Port "2"
OutputWhenDisabled held
InitialOutput "[]"
}
Line {
SrcBlock "S-funkcia realizujuca\nvypocet fazoveho"
" portretu"
SrcPort 1
DstBlock "Demux"
DstPort 1
}
Line {
SrcBlock "Demux"
SrcPort 1
DstBlock "x1(t)"
DstPort 1
}
Line {
SrcBlock "Demux"
SrcPort 2
DstBlock "x2(t)"
DstPort 1
}
Line {
SrcBlock "Demux"
SrcPort 3
DstBlock "Stop Simulation"
DstPort 1
}
}
}
Block {
BlockType SubSystem
Name "Phase Portraits of 2nd-Order Loops\nwith Ha"
"rd Nonlinearities"
Ports [0, 2, 0, 0, 0]
Position [270, 151, 435, 229]
ShowPortLabels on
MaskType "Phase-Plane Portrait of a 2nd-Order Loop wi"
"th a Hard Nonlinearity"
MaskDescription "For a detailed description of block paramet"
"ers, click \"Help\" button."
MaskHelp "web(fullfile(cd,'help','fazrov_typnl.html')"
");"
MaskPromptString "Linear part - transfer function numerator:|"
"Linear part - transfer function denominator:|Nonlinear part - nonlinearity ty"
"pe:|Nonlinear part - parameters:|Setpoint:|Initial conditions range: x1(0) mi"
"nimum|Initial conditions range: x1(0) maximum|Number of initial conditions fo"
"r x1|Initial conditions range: x2(0) minimum|Initial conditions range: x2(0) "
"maximum|Number of initial conditions for x2"
MaskStyleString "edit,edit,popup(Ideal relay|Saturation|Rela"
"y with dead-zone|Relay with hysteresis),edit,edit,edit,edit,edit,edit,edit,ed"
"it"
MaskTunableValueString "on,on,on,on,on,on,on,on,on,on,on"
MaskVariables "num=@1;den=@2;nelintyp=@3;nelinpar=@4;w=@5;"
"x1min=@6;x1max=@7;x1num=@8;x2min=@9;x2max=@10;x2num=@11;"
MaskInitialization "if (length(den) ~= 3) | (length(num) ~= 1) "
"| (den(1) == 0)\n error('Linear part must be a 2nd-order system!');\nend\n"
"\nif (nelintyp == 1) & (length(nelinpar) ~= 2)\n error('Invalid number of "
"nonlinearity parameters!');\nend\nif (nelintyp > 1) & ((length(nelinpar) ~= 4"
") | nelinpar(1) > nelinpar(3))\n error('Invalid nonlinearity parameters!')"
";\nend"
MaskDisplay "disp('Phase Portraits of\\n2nd-Order Loops"
"\\nwith Hard Nonlinearities');"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate none
MaskIconUnits autoscale
MaskValueString "1|conv([1 3],[1 -1])|Saturation|[-1 -4 1 4]"
"|0|-2|2|10|-2|5|3"
System {
Name "Phase Portraits of 2nd-Order Loops\nwith "
"Hard Nonlinearities"
Location [209, 285, 483, 466]
Open off
ToolBar off
StatusBar off
ScreenColor white
PaperOrientation landscape
PaperPositionMode auto
PaperType usletter
PaperUnits inches
Block {
BlockType Demux
Name "Demux"
Ports [1, 3, 0, 0, 0]
Position [185, 19, 190, 161]
BackgroundColor black
ShowName off
Outputs "[(x1num*x2num) (x1num*x2num) 1]"
}
Block {
BlockType "S-Function"
Name "S-funkcia realizujuca\nvypocet fazoveho"
" portretu"
Ports [1, 1, 0, 0, 0]
Position [20, 55, 150, 125]
FunctionName "fazrov_typnl"
Parameters "num,den,w,nelintyp,nelinpar,x1min,x1max"
",x1num,x2min,x2max,x2num"
PortCounts "[]"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -