📄 kalmanlti.mdl
字号:
SrcPort 1
Points [30, 0]
DstBlock "Sum2"
DstPort 2
}
Line {
SrcBlock "Sum1"
SrcPort 1
Points [0, 40]
DstBlock "y1"
DstPort 1
}
}
}
Block {
BlockType Outport
Name "x"
Position [425, 48, 455, 62]
IconDisplay "Port number"
OutDataType "sfix(16)"
OutScaling "2^0"
}
Block {
BlockType Outport
Name "y"
Position [425, 88, 455, 102]
Port "2"
IconDisplay "Port number"
OutDataType "sfix(16)"
OutScaling "2^0"
}
Line {
SrcBlock "u"
SrcPort 1
DstBlock "filter model"
DstPort 1
}
Line {
SrcBlock "filter model"
SrcPort 1
DstBlock "x"
DstPort 1
}
Line {
SrcBlock "filter model"
SrcPort 2
Points [30, 0]
Branch {
DstBlock "y"
DstPort 1
}
Branch {
Points [0, 65; -270, 0]
DstBlock "Sum3"
DstPort 2
}
}
Line {
SrcBlock "Sum3"
SrcPort 1
DstBlock "Filter Gain"
DstPort 1
}
Line {
SrcBlock "yr"
SrcPort 1
DstBlock "Sum3"
DstPort 1
}
Line {
SrcBlock "Filter Gain"
SrcPort 1
DstBlock "filter model"
DstPort 2
}
}
}
Block {
BlockType SubSystem
Name "Random Process"
Ports [1, 2]
Position [195, 41, 270, 99]
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
FunctionWithSeparateData off
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'))\nport_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 167
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000]
TiledPageScale 1
ShowPageBoundaries off
ZoomFactor "100"
Block {
BlockType Inport
Name "u"
Position [25, 83, 55, 97]
IconDisplay "Port number"
PortDimensions "size(B,2)"
OutDataType "sfix(16)"
OutScaling "2^0"
}
Block {
BlockType Gain
Name "A"
Position [280, 19, 320, 61]
Orientation "left"
Gain "A"
Multiplication "Matrix(K*u)"
ParameterDataTypeMode "Inherit via internal rule"
ParameterDataType "sfix(16)"
ParameterScaling "2^0"
OutDataTypeMode "Inherit via internal rule"
OutDataType "sfix(16)"
OutScaling "2^0"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "B"
Position [145, 69, 185, 111]
Gain "B"
Multiplication "Matrix(K*u)"
ParameterDataTypeMode "Inherit via internal rule"
ParameterDataType "sfix(16)"
ParameterScaling "2^0"
OutDataTypeMode "Inherit via internal rule"
OutDataType "sfix(16)"
OutScaling "2^0"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "C"
Position [310, 129, 350, 171]
Orientation "left"
Gain "C"
Multiplication "Matrix(K*u)"
ParameterDataTypeMode "Inherit via internal rule"
ParameterDataType "sfix(16)"
ParameterScaling "2^0"
OutDataTypeMode "Inherit via internal rule"
OutDataType "sfix(16)"
OutScaling "2^0"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "D"
Position [165, 179, 205, 221]
Gain "D"
Multiplication "Matrix(K*u)"
ParameterDataTypeMode "Inherit via internal rule"
ParameterDataType "sfix(16)"
ParameterScaling "2^0"
OutDataTypeMode "Inherit via internal rule"
OutDataType "sfix(16)"
OutScaling "2^0"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "Q"
Position [185, 119, 225, 161]
Gain "Q"
Multiplication "Matrix(K*u)"
ParameterDataTypeMode "Inherit via internal rule"
ParameterDataType "sfix(16)"
ParameterScaling "2^0"
OutDataTypeMode "Inherit via internal rule"
OutDataType "sfix(16)"
OutScaling "2^0"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "R"
Position [165, 234, 205, 276]
Gain "R"
Multiplication "Matrix(K*u)"
ParameterDataTypeMode "Inherit via internal rule"
ParameterDataType "sfix(16)"
ParameterScaling "2^0"
OutDataTypeMode "Inherit via internal rule"
OutDataType "sfix(16)"
OutScaling "2^0"
SaturateOnIntegerOverflow off
}
Block {
BlockType RandomNumber
Name "Random\nNumber"
Position [110, 125, 140, 155]
Mean "zeros(size(Q,1),1)"
Variance "ones(size(Q,1),1)"
Seed "7"
SampleTime "1"
}
Block {
BlockType RandomNumber
Name "Random\nNumber1"
Position [90, 240, 120, 270]
Mean "zeros(size(R,1),1)"
Variance "ones(size(R,1),1)"
SampleTime "1"
}
Block {
BlockType Sum
Name "Sum"
Ports [3, 1]
Position [250, 80, 270, 100]
ShowName off
IconShape "round"
Inputs "+++"
CollapseMode "All dimensions"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
OutDataType "sfix(16)"
OutScaling "2^0"
SaturateOnIntegerOverflow off
}
Block {
BlockType Sum
Name "Sum1"
Ports [3, 1]
Position [270, 190, 290, 210]
ShowName off
IconShape "round"
Inputs "+++"
CollapseMode "All dimensions"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
OutDataType "sfix(16)"
OutScaling "2^0"
SaturateOnIntegerOverflow off
}
Block {
BlockType UnitDelay
Name "Unit Delay"
Position [365, 23, 400, 57]
Orientation "left"
X0 "x0"
}
Block {
BlockType Outport
Name "x"
Position [470, 83, 500, 97]
IconDisplay "Port number"
OutDataType "sfix(16)"
OutScaling "2^0"
}
Block {
BlockType Outport
Name "y"
Position [470, 193, 500, 207]
Port "2"
IconDisplay "Port number"
OutDataType "sfix(16)"
OutScaling "2^0"
}
Line {
SrcBlock "u"
SrcPort 1
Points [30, 0]
Branch {
DstBlock "B"
DstPort 1
}
Branch {
Points [0, 110]
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 [-25, 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 [70, 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, -50]
DstBlock "Unit Delay"
DstPort 1
}
Branch {
Points [0, 0]
Branch {
DstBlock "x"
DstPort 1
}
Branch {
Points [0, 60]
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, 99]
}
Annotation {
Name "y(k+1)"
Position [335, 209]
}
Annotation {
Name "x(k)"
Position [340, 31]
}
Annotation {
Name "w"
Position [237, 143]
}
Annotation {
Name "v"
Position [224, 242]
}
}
}
Block {
BlockType Outport
Name "x"
Position [405, 48, 435, 62]
IconDisplay "Port number"
OutDataType "sfix(16)"
OutScaling "2^0"
}
Block {
BlockType Outport
Name "y"
Position [400, 103, 430, 117]
Port "2"
IconDisplay "Port number"
OutDataType "sfix(16)"
OutScaling "2^0"
}
Block {
BlockType Outport
Name "x*"
Position [395, 168, 425, 182]
Port "3"
IconDisplay "Port number"
OutDataType "sfix(16)"
OutScaling "2^0"
}
Block {
BlockType Outport
Name "y*"
Position [395, 208, 425, 222]
Port "4"
IconDisplay "Port number"
OutDataType "sfix(16)"
OutScaling "2^0"
}
Line {
SrcBlock "Random Process"
SrcPort 2
Points [25, 0; 0, 25]
Branch {
DstBlock "y"
DstPort 1
}
Branch {
Points [0, 25; -150, 0; 0, 40]
DstBlock "Kalman Filter"
DstPort 1
}
}
Line {
SrcBlock "In1"
SrcPort 1
Points [30, 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
Points [55, 0; 0, 10]
DstBlock "y*"
DstPort 1
}
Annotation {
Name "A general model to simulate the Kalman filter estimation of the state of a random process."
Position [254, 289]
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -