📄 kalmanfilter.mdl
字号:
DstBlock "C'"
DstPort 1
}
Branch {
Points [0, 105]
Branch {
DstBlock "Sum5"
DstPort 1
}
Branch {
DstBlock "C2"
DstPort 1
}
}
}
Line {
SrcBlock "C'"
SrcPort 1
Points [10, 0]
Branch {
DstBlock "C1"
DstPort 1
}
Branch {
Points [0, -40]
DstBlock "Divide"
DstPort 1
}
}
Line {
SrcBlock "Product"
SrcPort 1
DstBlock "Sum2"
DstPort 2
}
Line {
SrcBlock "Divide"
SrcPort 1
Points [40, 0]
Branch {
Points [0, -70; -215, 0]
DstBlock "Product"
DstPort 1
}
Branch {
Points [0, 180]
DstBlock "Product1"
DstPort 1
}
}
Line {
SrcBlock "Product1"
SrcPort 1
DstBlock "Sum5"
DstPort 2
}
Line {
SrcBlock "C1"
SrcPort 1
DstBlock "Sum4"
DstPort 1
}
Line {
SrcBlock "R"
SrcPort 1
Points [90, 0]
DstBlock "Sum4"
DstPort 2
}
Line {
SrcBlock "Sum4"
SrcPort 1
DstBlock "Divide"
DstPort 2
}
Line {
SrcBlock "Unit Delay1"
SrcPort 1
Points [0, -60]
DstBlock "A1"
DstPort 1
}
Line {
SrcBlock "Sum5"
SrcPort 1
Points [-205, 0]
DstBlock "Unit Delay1"
DstPort 1
}
Line {
SrcBlock "C3"
SrcPort 1
DstBlock "y1"
DstPort 1
}
Line {
SrcBlock "Sum1"
SrcPort 1
Points [0, 45; 170, 0]
DstBlock "Product"
DstPort 2
}
Line {
SrcBlock "C2"
SrcPort 1
Points [10, 0; 0, 90]
DstBlock "Product1"
DstPort 2
}
Annotation {
Name "P"
Position [289, 332]
}
Annotation {
Name "PC'"
Position [367, 358]
}
Annotation {
Name "CPC'"
Position [449, 333]
}
Annotation {
Name "K"
Position [585, 493]
}
Annotation {
Name "CP"
Position [473, 441]
}
Annotation {
Name "y-y'"
Position [330, 265]
}
}
}
Block {
BlockType SubSystem
Name "Random Process"
Ports [1, 2]
Position [195, 41, 270, 99]
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|A|B|C|D|Q|R"
MaskStyleString "edit,edit,edit,edit,edit,edit,edit"
MaskTunableValueString "on,on,on,on,on,on,on"
MaskCallbackString "||||||"
MaskEnableString "on,on,on,on,on,on,on"
MaskVisibilityString "on,on,on,on,on,on,on"
MaskToolTipString "on,on,on,on,on,on,on"
MaskVarAliasString ",,,,,,"
MaskVariables "x0=@1;A=@2;B=@3;C=@4;D=@5;Q=@6;R=@7;"
MaskDisplay "disp(sprintf('Linear\\n Random\\n System'))\npo"
"rt_label('output',1,'x')\nport_label('output',2,'y')\nport_label('input',1,'u"
"')\n\n"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
MaskValueString "x0|A|B|C|D|sqrt(Q)|sqrt(R)"
MaskTabNameString ",,,,,,"
System {
Name "Random Process"
Location [1170, 606, 1716, 1036]
Open off
ModelBrowserVisibility on
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType Inport
Name "u"
Position [25, 113, 55, 127]
Port "1"
IconDisplay "Port number"
PortDimensions "size(B,2)"
LatchInput off
}
Block {
BlockType Gain
Name "A"
Position [280, 34, 320, 76]
Orientation "left"
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 [310, 229, 350, 271]
Orientation "left"
Gain "C"
Multiplication "Matrix(K*u)"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "D"
Position [165, 279, 205, 321]
Gain "D"
Multiplication "Matrix(K*u)"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "Q"
Position [185, 164, 225, 206]
Gain "Q"
Multiplication "Matrix(K*u)"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "R"
Position [165, 344, 205, 386]
Gain "R"
Multiplication "Matrix(K*u)"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType RandomNumber
Name "Random\nNumber"
Position [110, 170, 140, 200]
Mean "zeros(size(Q,1),1)"
Variance "ones(size(Q,1),1)"
Seed "7"
SampleTime "1"
}
Block {
BlockType RandomNumber
Name "Random\nNumber1"
Position [90, 350, 120, 380]
Mean "zeros(size(R,1),1)"
Variance "ones(size(R,1),1)"
SampleTime "1"
}
Block {
BlockType Sum
Name "Sum"
Ports [3, 1]
Position [250, 110, 270, 130]
ShowName off
IconShape "round"
Inputs "+++"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Sum
Name "Sum1"
Ports [3, 1]
Position [250, 290, 270, 310]
ShowName off
IconShape "round"
Inputs "+++"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType UnitDelay
Name "Unit Delay"
Position [365, 38, 400, 72]
Orientation "left"
X0 "x0"
}
Block {
BlockType Outport
Name "x"
Position [470, 113, 500, 127]
IconDisplay "Port number"
BusOutputAsStruct off
}
Block {
BlockType Outport
Name "y"
Position [470, 293, 500, 307]
Port "2"
IconDisplay "Port number"
BusOutputAsStruct off
}
Line {
SrcBlock "u"
SrcPort 1
Points [30, 0]
Branch {
DstBlock "B"
DstPort 1
}
Branch {
Points [0, 180]
DstBlock "D"
DstPort 1
}
}
Line {
SrcBlock "Random\nNumber"
SrcPort 1
DstBlock "Q"
DstPort 1
}
Line {
SrcBlock "B"
SrcPort 1
DstBlock "Sum"
DstPort 2
}
Line {
SrcBlock "C"
SrcPort 1
Points [-45, 0]
DstBlock "Sum1"
DstPort 1
}
Line {
SrcBlock "D"
SrcPort 1
DstBlock "Sum1"
DstPort 2
}
Line {
SrcBlock "Random\nNumber1"
SrcPort 1
DstBlock "R"
DstPort 1
}
Line {
SrcBlock "R"
SrcPort 1
Points [50, 0]
DstBlock "Sum1"
DstPort 3
}
Line {
SrcBlock "Sum1"
SrcPort 1
DstBlock "y"
DstPort 1
}
Line {
SrcBlock "Sum"
SrcPort 1
Points [155, 0]
Branch {
Points [0, -65]
DstBlock "Unit Delay"
DstPort 1
}
Branch {
Points [0, 0]
Branch {
DstBlock "x"
DstPort 1
}
Branch {
Points [0, 130]
DstBlock "C"
DstPort 1
}
}
}
Line {
SrcBlock "Unit Delay"
SrcPort 1
DstBlock "A"
DstPort 1
}
Line {
SrcBlock "A"
SrcPort 1
Points [-15, 0]
DstBlock "Sum"
DstPort 1
}
Line {
SrcBlock "Q"
SrcPort 1
Points [30, 0]
DstBlock "Sum"
DstPort 3
}
Annotation {
Name "x(k+1)"
Position [329, 129]
}
Annotation {
Name "y(k+1)"
Position [335, 309]
}
Annotation {
Name "x(k)"
Position [340, 46]
}
Annotation {
Name "w"
Position [237, 173]
}
Annotation {
Name "v"
Position [224, 352]
}
}
}
Block {
BlockType Outport
Name "x"
Position [395, 48, 425, 62]
IconDisplay "Port number"
BusOutputAsStruct off
}
Block {
BlockType Outport
Name "y"
Position [395, 123, 425, 137]
Port "2"
IconDisplay "Port number"
BusOutputAsStruct off
}
Block {
BlockType Outport
Name "x*"
Position [395, 168, 425, 182]
Port "3"
IconDisplay "Port number"
BusOutputAsStruct off
}
Block {
BlockType Outport
Name "y*"
Position [350, 198, 380, 212]
Port "4"
IconDisplay "Port number"
BusOutputAsStruct off
}
Line {
SrcBlock "Random Process"
SrcPort 2
Points [25, 0; 0, 45]
Branch {
Points [-140, 0; 0, 45]
DstBlock "Kalman Filter"
DstPort 1
}
Branch {
DstBlock "y"
DstPort 1
}
}
Line {
SrcBlock "In1"
SrcPort 1
Points [35, 0]
Branch {
DstBlock "Random Process"
DstPort 1
}
Branch {
Points [0, 135]
DstBlock "Kalman Filter"
DstPort 2
}
}
Line {
SrcBlock "Random Process"
SrcPort 1
DstBlock "x"
DstPort 1
}
Line {
SrcBlock "Kalman Filter"
SrcPort 1
DstBlock "x*"
DstPort 1
}
Line {
SrcBlock "Kalman Filter"
SrcPort 2
DstBlock "y*"
DstPort 1
}
Annotation {
Name "A general model to simulate the Kalman filter e"
"stimation of the state of a random process."
Position [244, 269]
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -