📄 test.mdl
字号:
Block {
BlockType Gain
Name "Gain2"
Position [670, 265, 700, 295]
Gain "1.8"
Multiplication "Element-wise(K.*u)"
SaturateOnIntegerOverflow on
}
Block {
BlockType Gain
Name "Gain3"
Position [400, 315, 430, 345]
Gain "0.1"
Multiplication "Element-wise(K.*u)"
SaturateOnIntegerOverflow on
}
Block {
BlockType Gain
Name "Gain4"
Position [380, 80, 410, 110]
Gain "0.2"
Multiplication "Element-wise(K.*u)"
SaturateOnIntegerOverflow on
}
Block {
BlockType Integrator
Name "Integrator"
Ports [1, 1]
Position [715, 263, 745, 297]
ExternalReset "none"
InitialConditionSource "internal"
InitialCondition "2.502"
LimitOutput on
UpperSaturationLimit "2.502"
LowerSaturationLimit "0.498"
ShowSaturationPort off
ShowStatePort off
AbsoluteTolerance "auto"
}
Block {
BlockType Reference
Name "Look-Up\nTable (2-D)"
Ports [2, 1]
Position [450, 400, 545, 515]
SourceBlock "simulink3/Functions\n& Tables/Look-Up\nTabl"
"e (2-D)"
SourceType "Lookup Table (2-D)"
x "[-6:6]"
y "[-6:6]"
t "fuzchtab"
}
Block {
BlockType Mux
Name "Mux"
Ports [2, 1]
Position [460, 210, 485, 305]
Inputs "2"
DisplayOption "none"
}
Block {
BlockType Mux
Name "Mux1"
Ports [2, 1]
Position [340, 108, 360, 177]
ShowName off
Inputs "2"
DisplayOption "none"
}
Block {
BlockType Product
Name "Product1"
Ports [2, 1]
Position [640, 242, 655, 313]
Inputs "2"
Multiplication "Element-wise(.*)"
SaturateOnIntegerOverflow on
}
Block {
BlockType Product
Name "Product2"
Ports [2, 1]
Position [355, 185, 370, 245]
NamePlacement "alternate"
ShowName off
Inputs "2"
Multiplication "Element-wise(.*)"
SaturateOnIntegerOverflow on
}
Block {
BlockType Product
Name "Product3"
Ports [2, 1]
Position [365, 275, 380, 335]
ShowName off
Inputs "2"
Multiplication "Element-wise(.*)"
SaturateOnIntegerOverflow on
}
Block {
BlockType Saturate
Name "Saturation"
Position [405, 200, 435, 230]
UpperLimit "1"
LowerLimit "-1"
LinearizeAsGain on
}
Block {
BlockType Saturate
Name "Saturation1"
Position [445, 330, 475, 360]
UpperLimit "1"
LowerLimit "-1"
LinearizeAsGain on
}
Block {
BlockType Saturate
Name "Saturation2"
Position [385, 415, 415, 445]
UpperLimit "6"
LowerLimit "-6"
LinearizeAsGain on
}
Block {
BlockType Saturate
Name "Saturation3"
Position [385, 470, 415, 500]
UpperLimit "6"
LowerLimit "-6"
LinearizeAsGain on
}
Block {
BlockType Scope
Name "Scope"
Ports [1]
Position [395, 130, 425, 160]
Floating off
Location [638, 175, 962, 414]
Open off
NumInputPorts "1"
TickLabels "on"
ZoomMode "on"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
List {
ListType SelectedSignals
axes1 ""
}
Grid "on"
TimeRange "auto"
YMin "-35"
YMax "5"
SaveToWorkspace off
SaveName "ScopeData"
DataFormat "Array"
LimitDataPoints on
MaxDataPoints "500000"
Decimation "1"
SampleInput off
SampleTime "0"
}
Block {
BlockType Scope
Name "Scope1"
Ports [1]
Position [550, 140, 580, 170]
Floating off
Location [624, 445, 948, 684]
Open off
NumInputPorts "1"
TickLabels "on"
ZoomMode "on"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
Grid "on"
TimeRange "auto"
YMin "-1 "
YMax "1 "
SaveToWorkspace off
SaveName "ScopeData"
DataFormat "Array"
LimitDataPoints on
MaxDataPoints "500000"
Decimation "1"
SampleInput off
SampleTime "0"
}
Block {
BlockType Scope
Name "Scope2"
Ports [1]
Position [670, 445, 700, 475]
Floating off
Location [100, 409, 424, 648]
Open off
NumInputPorts "1"
TickLabels "on"
ZoomMode "on"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
Grid "on"
TimeRange "auto"
YMin "0.1 "
YMax "1 "
SaveToWorkspace off
SaveName "ScopeData"
DataFormat "Array"
LimitDataPoints on
MaxDataPoints "500000"
Decimation "1"
SampleInput off
SampleTime "0"
}
Block {
BlockType Sum
Name "Sum"
Ports [2, 1]
Position [125, 138, 140, 227]
ShowName off
IconShape "rectangular"
Inputs "-+"
SaturateOnIntegerOverflow on
}
Block {
BlockType SubSystem
Name "Switch"
Ports [1, 1]
Position [775, 253, 790, 307]
BackgroundColor "black"
ShowPortLabels on
TreatAsAtomicUnit off
RTWSystemCode "Auto"
RTWFcnNameOpts "Auto"
RTWFileNameOpts "Auto"
System {
Name "Switch"
Location [97, 105, 710, 496]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType Inport
Name "optimal ratio"
Position [55, 76, 85, 94]
Port "1"
LatchInput off
Interpolate on
}
Block {
BlockType Clock
Name "Clock"
Position [55, 135, 75, 155]
DisplayTime off
Decimation "10"
}
Block {
BlockType Clock
Name "Clock1"
Position [305, 225, 325, 245]
DisplayTime off
Decimation "10"
}
Block {
BlockType Clock
Name "Clock2"
Position [270, 330, 290, 350]
DisplayTime off
Decimation "10"
}
Block {
BlockType Constant
Name "Constant"
Position [105, 303, 145, 327]
ShowName off
Value "2.502"
VectorParams1D on
}
Block {
BlockType Constant
Name "Constant1"
Position [50, 173, 90, 197]
ShowName off
Value "2"
VectorParams1D on
}
Block {
BlockType Constant
Name "Constant2"
Position [290, 263, 330, 287]
ShowName off
Value "201.5"
VectorParams1D on
}
Block {
BlockType Fcn
Name "Fcn"
Position [325, 325, 385, 355]
Expr "0.88*(u[1]-201.5)^2+0.6*(u[1]-201.5)+0."
"5"
}
Block {
BlockType RelationalOperator
Name "Relational\nOperator"
Position [135, 123, 155, 207]
Operator ">="
}
Block {
BlockType RelationalOperator
Name "Relational\nOperator1"
Position [375, 213, 395, 297]
ShowName off
Operator "<="
}
Block {
BlockType Saturate
Name "Saturation"
Position [395, 295, 425, 325]
Orientation "up"
UpperLimit "2.502"
LowerLimit "0.5"
LinearizeAsGain on
}
Block {
BlockType Switch
Name "Switch"
Position [245, 110, 275, 220]
Threshold "0.5"
}
Block {
BlockType Switch
Name "Switch1"
Position [450, 200, 480, 310]
Threshold "0.5"
}
Block {
BlockType Outport
Name "Out2"
Position [545, 248, 575, 262]
Port "1"
OutputWhenDisabled "held"
InitialOutput "[]"
}
Line {
SrcBlock "Clock"
SrcPort 1
DstBlock "Relational\nOperator"
DstPort 1
}
Line {
SrcBlock "Relational\nOperator"
SrcPort 1
DstBlock "Switch"
DstPort 2
}
Line {
SrcBlock "Switch"
SrcPort 1
Points [135, 0; 0, 55]
DstBlock "Switch1"
DstPort 1
}
Line {
SrcBlock "Constant1"
SrcPort 1
DstBlock "Relational\nOperator"
DstPort 2
}
Line {
SrcBlock "Clock1"
SrcPort 1
DstBlock "Relational\nOperator1"
DstPort 1
}
Line {
SrcBlock "optimal ratio"
SrcPort 1
Points [105, 0; 0, 45]
DstBlock "Switch"
DstPort 1
}
Line {
SrcBlock "Constant"
SrcPort 1
Points [40, 0; 0, -115]
DstBlock "Switch"
DstPort 3
}
Line {
SrcBlock "Relational\nOperator1"
SrcPort 1
DstBlock "Switch1"
DstPort 2
}
Line {
SrcBlock "Switch1"
SrcPort 1
DstBlock "Out2"
DstPort 1
}
Line {
SrcBlock "Constant2"
SrcPort 1
DstBlock "Relational\nOperator1"
DstPort 2
}
Line {
SrcBlock "Clock2"
SrcPort 1
DstBlock "Fcn"
DstPort 1
}
Line {
SrcBlock "Fcn"
SrcPort 1
DstBlock "Saturation"
DstPort 1
}
Line {
SrcBlock "Saturation"
SrcPort 1
DstBlock "Switch1"
DstPort 3
}
}
}
Block {
BlockType Outport
Name "Out1"
Position [835, 273, 865, 287]
Port "1"
OutputWhenDisabled "held"
InitialOutput "[]"
}
Block {
BlockType Outport
Name "Out2"
Position [855, 188, 885, 202]
Port "2"
OutputWhenDisabled "held"
InitialOutput "[]"
}
Line {
SrcBlock "In1"
SrcPort 1
Points [20, 0]
Branch {
DstBlock "Fuzzification1"
DstPort 2
}
Branch {
DstBlock "Fuzzification"
DstPort 1
}
}
Line {
SrcBlock "Sum"
SrcPort 1
Points [5, 0]
Branch {
DstBlock "Fuzzification1"
DstPort 1
}
Branch {
DstBlock "Derivative1"
DstPort 1
}
}
Line {
SrcBlock "Mode Engine \nspeed rpm"
SrcPort 1
DstBlock "Sum"
DstPort 1
}
Line {
SrcBlock "Fuzzification"
SrcPort 1
Points [0, 0]
Branch {
Points [0, 195]
DstBlock "Gain1"
DstPort 1
}
Branch {
Points [20, 0]
Branch {
DstBlock "Product3"
DstPort 1
}
Branch {
Points [0, -165]
DstBlock "Mux1"
DstPort 1
}
}
}
Line {
SrcBlock "Fuzzification1"
SrcPort 1
Points [15, 0]
Branch {
DstBlock "Gain"
DstPort 1
}
Branch {
Points [15, 0]
Branch {
DstBlock "Product2"
DstPort 1
}
Branch {
Points [0, -40]
DstBlock "Mux1"
DstPort 2
}
}
}
Line {
SrcBlock "Saturation"
SrcPort 1
DstBlock "Mux"
DstPort 1
}
Line {
SrcBlock "Saturation1"
SrcPort 1
DstBlock "Mux"
DstPort 2
}
Line {
SrcBlock "Look-Up\nTable (2-D)"
SrcPort 1
Points [30, 0]
Branch {
Points [0, -85; -240, 0; 0, -55]
Branch {
DstBlock "Product3"
DstPort 2
}
Branch {
DstBlock "Product2"
DstPort 2
}
}
Branch {
Points [40, 0]
Branch {
DstBlock "Fcn5"
DstPort 1
}
Branch {
DstBlock "Scope2"
DstPort 1
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -