📄 mpc9state.mdl
字号:
PortDimensions "-1"
SampleTime "-1"
DataType "auto"
OutDataType "sfix(16)"
OutScaling "2^0"
SignalType "auto"
SamplingMode "auto"
OutputWhenDisabled "held"
InitialOutput "[]"
}
Block {
BlockType Scope
ModelBased off
TickLabels "OneTimeTick"
ZoomMode "on"
Grid "on"
TimeRange "auto"
YMin "-5"
YMax "5"
SaveToWorkspace off
SaveName "ScopeData"
LimitDataPoints on
MaxDataPoints "5000"
Decimation "1"
SampleInput off
SampleTime "-1"
}
Block {
BlockType "S-Function"
FunctionName "system"
SFunctionModules "''"
PortCounts "[]"
}
Block {
BlockType Step
Time "1"
Before "0"
After "1"
SampleTime "-1"
VectorParams1D on
ZeroCross on
}
Block {
BlockType SubSystem
ShowPortLabels on
Permissions "ReadWrite"
PermitHierarchicalResolution "All"
SystemSampleTime "-1"
RTWFcnNameOpts "Auto"
RTWFileNameOpts "Auto"
SimViewingDevice off
DataTypeOverride "UseLocalSettings"
MinMaxOverflowLogging "UseLocalSettings"
}
Block {
BlockType Sum
IconShape "rectangular"
Inputs "++"
InputSameDT on
OutDataTypeMode "Same as first input"
OutDataType "sfix(16)"
OutScaling "2^0"
LockScale off
RndMeth "Floor"
SaturateOnIntegerOverflow on
SampleTime "-1"
}
Block {
BlockType ToWorkspace
VariableName "simulink_output"
MaxDataPoints "1000"
Decimation "1"
SampleTime "0"
FixptAsFi off
}
Block {
BlockType TransferFcn
Numerator "[1]"
Denominator "[1 2 1]"
AbsoluteTolerance "auto"
Realization "auto"
}
}
AnnotationDefaults {
HorizontalAlignment "center"
VerticalAlignment "middle"
ForegroundColor "black"
BackgroundColor "white"
DropShadow off
FontName "arial"
FontSize 10
FontWeight "normal"
FontAngle "normal"
}
LineDefaults {
FontName "arial"
FontSize 9
FontWeight "normal"
FontAngle "normal"
}
System {
Name "mpc9state"
Location [-2, 86, 1010, 725]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
ReportName "simulink-default.rpt"
Block {
BlockType Reference
Name "MPC Controller"
Ports [3, 1]
Position [305, 264, 415, 346]
LinkData {
BlockName "Mux"
DialogParameters {
Inputs "2"
}
}
SourceBlock "mpclib/MPC Controller"
SourceType "MPC"
ShowPortLabels on
mpcobj "MPC2"
n_mv "0"
x0 "[]"
ref_from_ws off
ref_signal_name "[]"
ref_preview on
md_from_ws off
md_signal_name "[]"
md_preview on
from_project off
md_inport on
project_file "MPCtask.mat"
task_name "MPCDesign2"
}
Block {
BlockType Mux
Name "Mux"
Ports [2, 1]
Position [595, 201, 600, 239]
ShowName off
Inputs "2"
DisplayOption "bar"
}
Block {
BlockType SubSystem
Name "NineState"
Ports [1, 1]
Position [290, 85, 330, 145]
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
MaskHideContents off
System {
Name "NineState"
Location [506, 339, 957, 649]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType Inport
Name "e"
Position [25, 33, 55, 47]
IconDisplay "Port number"
}
Block {
BlockType Derivative
Name "Derivative"
Position [95, 70, 125, 100]
}
Block {
BlockType Mux
Name "Mux"
Ports [2, 1]
Position [160, 28, 165, 77]
ShowName off
Inputs "2"
DisplayOption "bar"
}
Block {
BlockType "S-Function"
Name "S-Function"
Ports [1, 1]
Position [195, 35, 255, 65]
FunctionName "NineState"
Parameters "0.1,0.1"
}
Block {
BlockType Outport
Name "Out1"
Position [280, 43, 310, 57]
IconDisplay "Port number"
BusOutputAsStruct off
}
Line {
SrcBlock "e"
SrcPort 1
Points [0, 0; 10, 0]
Branch {
Points [0, 45]
DstBlock "Derivative"
DstPort 1
}
Branch {
DstBlock "Mux"
DstPort 1
}
}
Line {
SrcBlock "Mux"
SrcPort 1
Points [0, -5]
DstBlock "S-Function"
DstPort 1
}
Line {
SrcBlock "Derivative"
SrcPort 1
Points [0, -20]
DstBlock "Mux"
DstPort 2
}
Line {
SrcBlock "S-Function"
SrcPort 1
Points [0, 0]
DstBlock "Out1"
DstPort 1
}
Annotation {
Name "\n"
Position [177, 164]
UseDisplayTextAsClickCallback off
}
}
}
Block {
BlockType Scope
Name "Scope"
Ports [1]
Position [640, 204, 670, 236]
Floating off
Location [5, 77, 1029, 762]
Open on
NumInputPorts "1"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
TimeRange "20"
YMin "0"
YMax "2.5"
DataFormat "StructureWithTime"
SampleTime "0"
}
Block {
BlockType Scope
Name "Scope1"
Ports [1]
Position [515, 134, 545, 166]
Floating off
Location [-3, 48, 1021, 733]
Open off
NumInputPorts "1"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
SaveName "ScopeData1"
DataFormat "StructureWithTime"
SampleTime "0"
}
Block {
BlockType Step
Name "Step"
Position [130, 100, 160, 130]
Time "0"
SampleTime "0"
}
Block {
BlockType Step
Name "Step1"
Position [370, 445, 400, 475]
Time "5"
After "5"
SampleTime "0"
}
Block {
BlockType Sum
Name "Sum1"
Ports [2, 1]
Position [240, 105, 260, 125]
ShowName off
IconShape "round"
Inputs "|+-"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Sum
Name "Sum2"
Ports [2, 1]
Position [440, 355, 460, 375]
ShowName off
IconShape "round"
Inputs "|++"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType ToWorkspace
Name "To Workspace1"
Position [630, 285, 690, 315]
VariableName "simout1"
MaxDataPoints "inf"
SampleTime "-1"
SaveFormat "Structure With Time"
}
Block {
BlockType ToWorkspace
Name "To Workspace2"
Position [670, 125, 730, 155]
VariableName "simout"
MaxDataPoints "inf"
SampleTime "-1"
SaveFormat "Structure With Time"
}
Block {
BlockType TransferFcn
Name "Transfer Fcn1"
Position [380, 97, 440, 133]
Numerator "[3]"
Denominator "[2 3 4 ]"
}
Block {
BlockType TransferFcn
Name "Transfer Fcn2"
Position [480, 287, 540, 323]
Numerator "[3]"
Denominator "[2 3 4 ]"
}
Line {
SrcBlock "Transfer Fcn1"
SrcPort 1
Points [10, 0; 0, 85]
Branch {
Points [0, 10]
DstBlock "Mux"
DstPort 1
}
Branch {
Points [-205, 0]
DstBlock "Sum1"
DstPort 2
}
}
Line {
SrcBlock "Sum1"
SrcPort 1
Points [0, 0]
DstBlock "NineState"
DstPort 1
}
Line {
SrcBlock "NineState"
SrcPort 1
Points [20, 0]
Branch {
DstBlock "Transfer Fcn1"
DstPort 1
}
Branch {
Points [0, 35]
DstBlock "Scope1"
DstPort 1
}
}
Line {
SrcBlock "Step"
SrcPort 1
Points [20, 0]
Branch {
DstBlock "Sum1"
DstPort 1
}
Branch {
Points [0, 190]
DstBlock "MPC Controller"
DstPort 2
}
}
Line {
SrcBlock "Transfer Fcn2"
SrcPort 1
Points [10, 0; 0, -65]
Branch {
Points [-265, 0]
DstBlock "MPC Controller"
DstPort 1
}
Branch {
Points [0, -10; 20, 0]
Branch {
DstBlock "Mux"
DstPort 2
}
Branch {
Points [0, 70]
DstBlock "To Workspace1"
DstPort 1
}
}
}
Line {
SrcBlock "Mux"
SrcPort 1
Points [10, 0]
Branch {
DstBlock "Scope"
DstPort 1
}
Branch {
Points [0, -80]
DstBlock "To Workspace2"
DstPort 1
}
}
Line {
SrcBlock "Sum2"
SrcPort 1
DstBlock "Transfer Fcn2"
DstPort 1
}
Line {
SrcBlock "MPC Controller"
SrcPort 1
Points [5, 0]
DstBlock "Sum2"
DstPort 1
}
Line {
SrcBlock "Step1"
SrcPort 1
Points [45, 0]
DstBlock "Sum2"
DstPort 2
}
Annotation {
Name "u(t)"
Position [433, 286]
UseDisplayTextAsClickCallback off
FontSize 14
}
Annotation {
Name "u(t)"
Position [344, 101]
UseDisplayTextAsClickCallback off
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -