📄 kalmanfilter.mdl
字号:
Block {
BlockType Product
Inputs "2"
Multiplication "Element-wise(.*)"
InputSameDT on
OutDataTypeMode "Same as first input"
OutDataType "sfix(16)"
OutScaling "2^0"
LockScale off
RndMeth "Zero"
SaturateOnIntegerOverflow on
SampleTime "-1"
}
Block {
BlockType RandomNumber
Mean "0"
Variance "1"
Seed "0"
SampleTime "-1"
VectorParams1D 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 UnitDelay
X0 "0"
SampleTime "1"
StateMustResolveToSignalObject off
RTWStateStorageClass "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 "kalmanfilter"
Location [243, 281, 904, 855]
Open on
ModelBrowserVisibility on
ModelBrowserWidth 167
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
ReportName "simulink-default.rpt"
Block {
BlockType Inport
Name "In1"
Position [30, 63, 60, 77]
Port "1"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType SubSystem
Name "Kalman Filter"
Ports [2, 2]
Position [195, 161, 270, 219]
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
MaskDescription "Linear Random Process\nx(k+1)=Ax(k)+Bu(k)+w\ny("
"k)=Cx(k)+Du(k)+v\nw~N(0,Q)\nw~N(0,R)"
MaskPromptString "x0|P0|A|B|C|D|Q|R"
MaskStyleString "edit,edit,edit,edit,edit,edit,edit,edit"
MaskTunableValueString "on,on,on,on,on,on,on,on"
MaskCallbackString "|||||||"
MaskEnableString "on,on,on,on,on,on,on,on"
MaskVisibilityString "on,on,on,on,on,on,on,on"
MaskToolTipString "on,on,on,on,on,on,on,on"
MaskVarAliasString ",,,,,,,"
MaskVariables "x0=@1;P0=@2;A=@3;B=@4;C=@5;D=@6;Q=@7;R=@8;"
MaskDisplay "disp(sprintf('Kalman\\n Filter'))\nport_label('"
"output',2,'y')\nport_label('output',1,'x')\nport_label('input',1,'y')\nport_l"
"abel('input',2,'u')\n\n\n\n"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
MaskValueString "x1|P1|A1|B1|C1|D1|Q1|R1"
MaskTabNameString ",,,,,,,"
System {
Name "Kalman Filter"
Location [1208, 294, 1869, 868]
Open off
ModelBrowserVisibility on
ModelBrowserWidth 167
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType Inport
Name "y"
Position [115, 163, 145, 177]
Port "1"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType Inport
Name "u"
Position [25, 113, 55, 127]
Port "2"
IconDisplay "Port number"
PortDimensions "size(B,2)"
LatchInput off
}
Block {
BlockType Gain
Name "A"
Position [290, 24, 330, 66]
Orientation "left"
Gain "A"
Multiplication "Matrix(K*u)"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "A'"
Position [180, 324, 220, 366]
Gain "A'"
Multiplication "Matrix(u*K)"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "A1"
Position [100, 324, 140, 366]
Gain "A"
Multiplication "Matrix(K*u)"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "B"
Position [160, 99, 200, 141]
Gain "B"
Multiplication "Matrix(K*u)"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "C"
Position [290, 194, 330, 236]
Orientation "left"
Gain "C"
Multiplication "Matrix(K*u)"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "C'"
Position [315, 324, 355, 366]
Gain "C'"
Multiplication "Matrix(u*K)"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "C1"
Position [395, 324, 435, 366]
Gain "C"
Multiplication "Matrix(K*u)"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "C2"
Position [420, 429, 460, 471]
Gain "C"
Multiplication "Matrix(K*u)"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "C3"
Position [485, 164, 525, 206]
Gain "C"
Multiplication "Matrix(K*u)"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "D"
Position [155, 194, 195, 236]
Gain "D"
Multiplication "Matrix(K*u)"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Product
Name "Divide"
Ports [2, 1]
Position [540, 284, 570, 366]
Inputs "*/"
Multiplication "Matrix(*)"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
OutScaling "2^-10"
RndMeth "Floor"
SaturateOnIntegerOverflow off
}
Block {
BlockType Product
Name "Product"
Ports [2, 1]
Position [392, 190, 423, 220]
Orientation "up"
NamePlacement "alternate"
ShowName off
Multiplication "Matrix(*)"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Product
Name "Product1"
Ports [2, 1]
Position [355, 487, 385, 558]
Orientation "left"
NamePlacement "alternate"
ShowName off
Multiplication "Matrix(*)"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Constant
Name "Q"
Position [130, 275, 160, 305]
Value "Q"
}
Block {
BlockType Constant
Name "R"
Position [360, 375, 390, 405]
Value "R"
}
Block {
BlockType Sum
Name "Sum"
Ports [2, 1]
Position [255, 110, 275, 130]
ShowName off
IconShape "round"
Inputs "++|"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Sum
Name "Sum1"
Ports [3, 1]
Position [235, 205, 255, 225]
Orientation "down"
ShowName off
IconShape "round"
Inputs "-+-"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Sum
Name "Sum2"
Ports [2, 1]
Position [400, 110, 420, 130]
ShowName off
IconShape "round"
Inputs "|++"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Sum
Name "Sum3"
Ports [2, 1]
Position [255, 335, 275, 355]
ShowName off
IconShape "round"
Inputs "++|"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Sum
Name "Sum4"
Ports [2, 1]
Position [475, 335, 495, 355]
ShowName off
IconShape "round"
Inputs "|++"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Sum
Name "Sum5"
Ports [2, 1]
Position [280, 515, 300, 535]
Orientation "left"
ShowName off
IconShape "round"
Inputs "+-|"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType UnitDelay
Name "Unit Delay"
Position [370, 28, 405, 62]
Orientation "left"
X0 "x0"
}
Block {
BlockType UnitDelay
Name "Unit Delay1"
Position [53, 410, 87, 445]
Orientation "up"
NamePlacement "alternate"
ShowName off
X0 "P0"
}
Block {
BlockType Outport
Name "x"
Position [470, 113, 500, 127]
IconDisplay "Port number"
BusOutputAsStruct off
}
Block {
BlockType Outport
Name "y1"
Position [580, 178, 610, 192]
Port "2"
IconDisplay "Port number"
BusOutputAsStruct off
}
Line {
SrcBlock "u"
SrcPort 1
Points [35, 0]
Branch {
DstBlock "B"
DstPort 1
}
Branch {
Points [0, 95]
DstBlock "D"
DstPort 1
}
}
Line {
SrcBlock "B"
SrcPort 1
DstBlock "Sum"
DstPort 2
}
Line {
SrcBlock "A"
SrcPort 1
Points [-20, 0]
DstBlock "Sum"
DstPort 1
}
Line {
SrcBlock "Unit Delay"
SrcPort 1
DstBlock "A"
DstPort 1
}
Line {
SrcBlock "Sum"
SrcPort 1
Points [90, 0]
Branch {
DstBlock "Sum2"
DstPort 1
}
Branch {
Points [0, 95]
DstBlock "C"
DstPort 1
}
}
Line {
SrcBlock "Sum2"
SrcPort 1
Points [15, 0]
Branch {
DstBlock "x"
DstPort 1
}
Branch {
Points [0, -75]
DstBlock "Unit Delay"
DstPort 1
}
Branch {
Points [0, 65]
DstBlock "C3"
DstPort 1
}
}
Line {
SrcBlock "D"
SrcPort 1
DstBlock "Sum1"
DstPort 1
}
Line {
SrcBlock "C"
SrcPort 1
DstBlock "Sum1"
DstPort 3
}
Line {
SrcBlock "y"
SrcPort 1
Points [95, 0]
DstBlock "Sum1"
DstPort 2
}
Line {
SrcBlock "A1"
SrcPort 1
DstBlock "A'"
DstPort 1
}
Line {
SrcBlock "A'"
SrcPort 1
DstBlock "Sum3"
DstPort 2
}
Line {
SrcBlock "Q"
SrcPort 1
Points [100, 0]
DstBlock "Sum3"
DstPort 1
}
Line {
SrcBlock "Sum3"
SrcPort 1
Points [10, 0]
Branch {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -