📄 tank_2.mdl
字号:
MaskIconRotate "none"
MaskIconUnits "autoscale"
MaskValueString "0|1|InitialPosition"
System {
Name "Limited Integrator"
Location [0, 0, 791, 233]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType Inport
Name "In_1"
Position [20, 130, 40, 150]
}
Block {
BlockType Fcn
Name "Fcn"
Position [150, 116, 520, 154]
Expr "u[2]*((((u[1]>lb)+(u[2]>=0))>0) * (((u["
"1]<ub)+(u[2]<=0))>0))"
}
Block {
BlockType Integrator
Name "Integrator"
Ports [1, 1]
Position [540, 126, 585, 144]
InitialCondition "xi"
}
Block {
BlockType Mux
Name "Mux"
Ports [2, 1]
Position [85, 116, 115, 149]
Inputs "2"
}
Block {
BlockType Saturate
Name "Saturation"
Position [630, 121, 675, 149]
UpperLimit "ub"
LowerLimit "lb"
}
Block {
BlockType Outport
Name "Out_1"
Position [720, 125, 740, 145]
InitialOutput "0"
}
Line {
SrcBlock "Integrator"
SrcPort 1
Points [10, 0]
Branch {
DstBlock "Saturation"
DstPort 1
}
Branch {
Points [0, -100; -545, 0; 0, 90]
DstBlock "Mux"
DstPort 1
}
}
Line {
SrcBlock "Fcn"
SrcPort 1
DstBlock "Integrator"
DstPort 1
}
Line {
SrcBlock "Mux"
SrcPort 1
DstBlock "Fcn"
DstPort 1
}
Line {
SrcBlock "In_1"
SrcPort 1
DstBlock "Mux"
DstPort 2
}
Line {
SrcBlock "Saturation"
SrcPort 1
DstBlock "Out_1"
DstPort 1
}
}
}
Block {
BlockType Product
Name "Product"
Ports [2, 1]
Position [335, 81, 370, 139]
}
Block {
BlockType Outport
Name "out flow"
Position [405, 100, 425, 120]
InitialOutput "0"
}
Line {
SrcBlock "source flow"
SrcPort 1
DstBlock "Product"
DstPort 2
}
Line {
SrcBlock "Product"
SrcPort 1
DstBlock "out flow"
DstPort 1
}
Line {
SrcBlock "control"
SrcPort 1
DstBlock "Limited Integrator"
DstPort 1
}
Line {
SrcBlock "Limited Integrator"
SrcPort 1
Points [25, 0; 0, 60]
DstBlock "Product"
DstPort 1
}
}
}
Block {
BlockType Sum
Name "Sum2"
Ports [2, 1]
Position [110, 75, 130, 115]
Inputs "+-"
}
Block {
BlockType Saturate
Name "change"
Position [255, 214, 290, 246]
Orientation "left"
UpperLimit "0.1"
LowerLimit "-0.1"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
}
Block {
BlockType Sum
Name "error1"
Ports [2, 1]
Position [170, 90, 190, 110]
Inputs "+-"
}
Block {
BlockType SubSystem
Name "tank"
Ports [1, 2]
Position [480, 81, 540, 139]
ShowPortLabels off
TreatAsAtomicUnit off
MaskType "Water tank"
MaskDescription "Cylindrical water tank with overflow signal"
MaskPromptString "Height of tank (m):|Bottom area (m^2):|Out pipe"
" crossection (m^2):|Initial level height (m):"
MaskStyleString "edit,edit,edit,edit"
MaskTunableValueString "on,on,on,on"
MaskCallbackString "|||"
MaskEnableString "on,on,on,on"
MaskVisibilityString "on,on,on,on"
MaskToolTipString "on,on,on,on"
MaskVarAliasString ",,,"
MaskVariables "ht=@1;area=@2;outletArea=@3;initialHt=@4;"
MaskDisplay "disp('WATER\\nTANK')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
MaskValueString "2|1|0.05|0.5"
System {
Name "tank"
Location [40, 563, 586, 871]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType Inport
Name "flow\nin"
Position [25, 130, 45, 150]
}
Block {
BlockType Gain
Name "1/area"
Position [220, 122, 270, 178]
Gain "1/area"
}
Block {
BlockType Gain
Name "outletArea"
Position [410, 122, 460, 178]
Gain "outletArea"
}
Block {
BlockType Fcn
Name "sqrt(2gh)"
Position [300, 126, 390, 174]
Expr "sqrt(2*9.8*u)"
}
Block {
BlockType Sum
Name "sum"
Ports [2, 1]
Position [105, 130, 125, 165]
Inputs "+-"
}
Block {
BlockType SubSystem
Name "tank\nvolume"
Ports [1, 1]
Position [150, 129, 200, 171]
ShowPortLabels off
TreatAsAtomicUnit off
MaskType "Limited integrator."
MaskDescription "Limited integrator"
MaskHelp "Implements a limited integrator with \\nan "
"expression of the form:\\n\\nif(x<=lb and u<0) or (x>=ub and u>0)\\n\\txdot=0"
"\\nelse\\n\\txdot=u."
MaskPromptString "Lower bound:|Upper bound:|Initial condition"
MaskStyleString "edit,edit,edit"
MaskTunableValueString "on,on,on"
MaskCallbackString "||"
MaskEnableString "on,on,on"
MaskVisibilityString "on,on,on"
MaskToolTipString "on,on,on"
MaskVarAliasString ",,"
MaskInitialization "lb = @1; ub = @2; xi = @3;"
MaskDisplay "plot(-1,-0.2,3.5,1.2,[0.05,1,2,2.9],[0,0,1,"
"1]);disp(' 1/s ')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
MaskValueString "0|ht * area|initialHt * area"
System {
Name "tank\nvolume"
Location [0, 0, 791, 233]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType Inport
Name "In_1"
Position [20, 130, 40, 150]
}
Block {
BlockType Fcn
Name "Fcn"
Position [150, 116, 520, 154]
Expr "u[2]*((((u[1]>lb)+(u[2]>=0))>0) * (((u["
"1]<ub)+(u[2]<=0))>0))"
}
Block {
BlockType Integrator
Name "Integrator"
Ports [1, 1]
Position [540, 126, 585, 144]
InitialCondition "xi"
}
Block {
BlockType Mux
Name "Mux"
Ports [2, 1]
Position [85, 116, 115, 149]
Inputs "2"
}
Block {
BlockType Saturate
Name "Saturation"
Position [630, 121, 675, 149]
UpperLimit "ub"
LowerLimit "lb"
}
Block {
BlockType Outport
Name "Out_1"
Position [720, 125, 740, 145]
InitialOutput "0"
}
Line {
SrcBlock "Integrator"
SrcPort 1
Points [10, 0]
Branch {
DstBlock "Saturation"
DstPort 1
}
Branch {
Points [0, -100; -545, 0; 0, 90]
DstBlock "Mux"
DstPort 1
}
}
Line {
SrcBlock "Fcn"
SrcPort 1
DstBlock "Integrator"
DstPort 1
}
Line {
SrcBlock "Mux"
SrcPort 1
DstBlock "Fcn"
DstPort 1
}
Line {
SrcBlock "In_1"
SrcPort 1
DstBlock "Mux"
DstPort 2
}
Line {
SrcBlock "Saturation"
SrcPort 1
DstBlock "Out_1"
DstPort 1
}
}
}
Block {
BlockType Outport
Name "water\nlevel"
Position [495, 55, 515, 75]
InitialOutput "0"
}
Block {
BlockType Outport
Name "flow\nout"
Position [495, 140, 515, 160]
Port "2"
InitialOutput "0"
}
Line {
SrcBlock "outletArea"
SrcPort 1
Points [0, 0; 10, 0]
Branch {
DstBlock "flow\nout"
DstPort 1
}
Branch {
Points [0, 65; -390, 0; 0, -60]
DstBlock "sum"
DstPort 2
}
}
Line {
SrcBlock "sqrt(2gh)"
SrcPort 1
DstBlock "outletArea"
DstPort 1
}
Line {
SrcBlock "1/area"
SrcPort 1
Points [10, 0]
Branch {
DstBlock "sqrt(2gh)"
DstPort 1
}
Branch {
Points [0, 0; 0, -85]
DstBlock "water\nlevel"
DstPort 1
}
}
Line {
SrcBlock "tank\nvolume"
SrcPort 1
DstBlock "1/area"
DstPort 1
}
Line {
SrcBlock "flow\nin"
SrcPort 1
DstBlock "sum"
DstPort 1
}
Line {
SrcBlock "sum"
SrcPort 1
DstBlock "tank\nvolume"
DstPort 1
}
}
}
Block {
BlockType Constant
Name "tank max\ninflow1"
Position [390, 159, 435, 191]
Orientation "left"
Value "0.5"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
}
Line {
SrcBlock "Subsystem1"
SrcPort 1
DstBlock "tank"
DstPort 1
}
Line {
SrcBlock "tank"
SrcPort 2
DstBlock "Scope1"
DstPort 1
}
Line {
SrcBlock "tank"
SrcPort 1
Points [25, 0]
Branch {
Points [20, 0; 0, -20]
DstBlock "Mux3"
DstPort 2
}
Branch {
Points [0, 0; 0, 135]
Branch {
Points [0, 45; -420, 0; 0, -170]
DstBlock "error1"
DstPort 2
}
Branch {
DstBlock "Derivative"
DstPort 1
}
}
}
Line {
SrcBlock "Mux3"
SrcPort 1
DstBlock "Scope3"
DstPort 1
}
Line {
SrcBlock "tank max\ninflow1"
SrcPort 1
Points [-30, 0; 0, -55]
DstBlock "Subsystem1"
DstPort 2
}
Line {
SrcBlock "Constant1"
SrcPort 1
Points [20, 0; 0, 25]
DstBlock "Sum2"
DstPort 1
}
Line {
SrcBlock "Signal\nGenerator1"
SrcPort 1
Points [10, 0; 0, -35]
DstBlock "Sum2"
DstPort 2
}
Line {
SrcBlock "Sum2"
SrcPort 1
Points [0, 0; 15, 0]
Branch {
DstBlock "error1"
DstPort 1
}
Branch {
Points [0, -70; 440, 0; 0, 35]
DstBlock "Mux3"
DstPort 1
}
}
Line {
SrcBlock "Fuzzy Logic\nController"
SrcPort 1
DstBlock "Subsystem1"
DstPort 1
}
Line {
SrcBlock "error1"
SrcPort 1
DstBlock "Mux1"
DstPort 1
}
Line {
SrcBlock "Mux1"
SrcPort 1
Points [10, 0; 0, -10]
DstBlock "Fuzzy Logic\nController"
DstPort 1
}
Line {
SrcBlock "Derivative"
SrcPort 1
DstBlock "change"
DstPort 1
}
Line {
SrcBlock "change"
SrcPort 1
Points [-50, 0; 0, -115]
DstBlock "Mux1"
DstPort 2
}
Annotation {
Name "最大流量"
Position [362, 188]
}
Annotation {
Name "控制"
Position [363, 87]
}
Annotation {
Name "流量输出"
Position [595, 112]
}
Annotation {
Name "水位输出"
Position [564, 84]
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -