optime.mdl
来自「最优控制状态函数的例子」· MDL 代码 · 共 946 行 · 第 1/2 页
MDL
946 行
ShowName on
}
BlockParameterDefaults {
Block {
BlockType Constant
Value "1"
VectorParams1D on
SamplingMode "Sample based"
OutDataTypeMode "Inherit from 'Constant value'"
OutDataType "sfix(16)"
ConRadixGroup "Use specified scaling"
OutScaling "2^0"
SampleTime "inf"
FramePeriod "inf"
}
Block {
BlockType DataTypeConversion
OutDataTypeMode "Inherit via back propagation"
OutDataType "sfix(16)"
OutScaling "2^0"
LockScale off
ConvertRealWorld "Real World Value (RWV)"
RndMeth "Zero"
SaturateOnIntegerOverflow on
SampleTime "-1"
}
Block {
BlockType Gain
Gain "1"
Multiplication "Element-wise(K.*u)"
ParameterDataTypeMode "Same as input"
ParameterDataType "sfix(16)"
ParameterScalingMode "Best Precision: Matrix-wise"
ParameterScaling "2^0"
OutDataTypeMode "Same as input"
OutDataType "sfix(16)"
OutScaling "2^0"
LockScale off
RndMeth "Floor"
SaturateOnIntegerOverflow on
SampleTime "-1"
}
Block {
BlockType Inport
Port "1"
UseBusObject off
BusObject "BusObject"
BusOutputAsStruct off
PortDimensions "-1"
SampleTime "-1"
DataType "auto"
OutDataType "sfix(16)"
OutScaling "2^0"
SignalType "auto"
SamplingMode "auto"
LatchByDelayingOutsideSignal off
LatchByCopyingInsideSignal off
Interpolate on
}
Block {
BlockType Integrator
ExternalReset "none"
InitialConditionSource "internal"
InitialCondition "0"
LimitOutput off
UpperSaturationLimit "inf"
LowerSaturationLimit "-inf"
ShowSaturationPort off
ShowStatePort off
AbsoluteTolerance "auto"
IgnoreLimit off
ZeroCross on
ContinuousStateAttributes "''"
}
Block {
BlockType Math
Operator "exp"
OutputSignalType "auto"
SampleTime "-1"
OutDataTypeMode "Same as first input"
OutDataType "sfix(16)"
OutScaling "2^0"
LockScale off
RndMeth "Floor"
SaturateOnIntegerOverflow on
}
Block {
BlockType Mux
Inputs "4"
DisplayOption "none"
UseBusObject off
BusObject "BusObject"
NonVirtualBus off
}
Block {
BlockType Product
Inputs "2"
Multiplication "Element-wise(.*)"
CollapseMode "All dimensions"
CollapseDim "1"
InputSameDT on
OutDataTypeMode "Same as first input"
OutDataType "sfix(16)"
OutScaling "2^0"
LockScale off
RndMeth "Zero"
SaturateOnIntegerOverflow on
SampleTime "-1"
}
Block {
BlockType "S-Function"
FunctionName "system"
SFunctionModules "''"
PortCounts "[]"
}
Block {
BlockType Signum
ZeroCross on
SampleTime "-1"
}
Block {
BlockType SubSystem
ShowPortLabels "FromPortIcon"
Permissions "ReadWrite"
PermitHierarchicalResolution "All"
TreatAsAtomicUnit off
SystemSampleTime "-1"
RTWFcnNameOpts "Auto"
RTWFileNameOpts "Auto"
RTWMemSecFuncInitTerm "Inherit from model"
RTWMemSecFuncExecute "Inherit from model"
RTWMemSecDataConstants "Inherit from model"
RTWMemSecDataInternal "Inherit from model"
RTWMemSecDataParameters "Inherit from model"
SimViewingDevice off
DataTypeOverride "UseLocalSettings"
MinMaxOverflowLogging "UseLocalSettings"
}
Block {
BlockType Sum
IconShape "rectangular"
Inputs "++"
CollapseMode "All dimensions"
CollapseDim "1"
InputSameDT on
OutDataTypeMode "Same as first input"
OutDataType "sfix(16)"
OutScaling "2^0"
LockScale off
RndMeth "Floor"
SaturateOnIntegerOverflow on
SampleTime "-1"
}
}
AnnotationDefaults {
HorizontalAlignment "center"
VerticalAlignment "middle"
ForegroundColor "black"
BackgroundColor "white"
DropShadow off
FontName "Arial"
FontSize 10
FontWeight "normal"
FontAngle "normal"
UseDisplayTextAsClickCallback off
}
LineDefaults {
FontName "Arial"
FontSize 9
FontWeight "normal"
FontAngle "normal"
}
System {
Name "time11"
Location [2, 89, 1278, 748]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
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"
ReportName "simulink-default.rpt"
Block {
BlockType Sum
Name "Add"
Ports [2, 1]
Position [365, 92, 395, 123]
Inputs "+-"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
OutScaling "2^-10"
SaturateOnIntegerOverflow off
}
Block {
BlockType Constant
Name "Constant"
Position [385, 270, 415, 300]
Orientation "left"
NamePlacement "alternate"
}
Block {
BlockType Gain
Name "Gain"
Position [165, 125, 195, 155]
Orientation "left"
NamePlacement "alternate"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Integrator
Name "Integrator1"
Ports [1, 1]
Position [470, 95, 500, 125]
InitialCondition "2"
IgnoreLimit off
}
Block {
BlockType Integrator
Name "Integrator2"
Ports [1, 1]
Position [265, 55, 295, 85]
InitialCondition "-3"
IgnoreLimit off
}
Block {
BlockType Math
Name "Math\nFunction"
Ports [1, 1]
Position [400, 220, 430, 250]
Orientation "left"
NamePlacement "alternate"
SampleTime "0"
}
Block {
BlockType Product
Name "Product"
Ports [2, 1]
Position [465, 217, 495, 248]
Orientation "left"
NamePlacement "alternate"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Product
Name "Product1"
Ports [2, 1]
Position [265, 227, 295, 258]
Orientation "left"
NamePlacement "alternate"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Signum
Name "Sign"
Position [540, 225, 570, 255]
Orientation "left"
NamePlacement "alternate"
SampleTime "0"
}
Block {
BlockType Signum
Name "Sign2"
Position [185, 55, 215, 85]
SampleTime "0"
}
Block {
BlockType Sum
Name "Sum"
Ports [2, 1]
Position [335, 225, 355, 245]
Orientation "left"
NamePlacement "alternate"
ShowName off
IconShape "round"
Inputs "|-+"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Sum
Name "Sum1"
Ports [2, 1]
Position [225, 130, 245, 150]
Orientation "left"
NamePlacement "alternate"
ShowName off
IconShape "round"
Inputs "|++"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Reference
Name "XY Graph1"
Ports [2]
Position [645, 85, 675, 120]
SourceBlock "simulink/Sinks/XY Graph"
SourceType "XY scope."
ShowPortLabels "FromPortIcon"
SystemSampleTime "-1"
FunctionWithSeparateData off
RTWMemSecFuncInitTerm "Inherit from model"
RTWMemSecFuncExecute "Inherit from model"
RTWMemSecDataConstants "Inherit from model"
RTWMemSecDataInternal "Inherit from model"
RTWMemSecDataParameters "Inherit from model"
xmin "-5"
xmax "5"
ymin "-5"
ymax "5"
st "0.01"
}
Line {
Labels [0, 0]
SrcBlock "Integrator2"
SrcPort 1
Points [310, 0; 0, 35]
Branch {
Points [0, 100]
Branch {
Points [0, 35]
DstBlock "Sign"
DstPort 1
}
Branch {
Points [-85, 0; 0, 20]
DstBlock "Product"
DstPort 1
}
}
Branch {
Points [0, 5]
DstBlock "XY Graph1"
DstPort 2
}
}
Line {
SrcBlock "Integrator1"
SrcPort 1
Points [40, 0]
Branch {
Points [0, -15]
DstBlock "XY Graph1"
DstPort 1
}
Branch {
Points [0, 35; -195, 0; 0, -5]
Branch {
DstBlock "Add"
DstPort 2
}
Branch {
DstBlock "Sum1"
DstPort 1
}
}
}
Line {
SrcBlock "Add"
SrcPort 1
DstBlock "Integrator1"
DstPort 1
}
Line {
SrcBlock "Sign"
SrcPort 1
Points [0, 0; -20, 0]
Branch {
DstBlock "Product"
DstPort 2
}
Branch {
Points [0, 70; -185, 0; 0, -60]
DstBlock "Product1"
DstPort 2
}
}
Line {
SrcBlock "Product1"
SrcPort 1
Points [-25, 0]
DstBlock "Sum1"
DstPort 2
}
Line {
SrcBlock "Gain"
SrcPort 1
Points [0, -70]
DstBlock "Sign2"
DstPort 1
}
Line {
SrcBlock "Sign2"
SrcPort 1
Points [15, 0]
Branch {
DstBlock "Integrator2"
DstPort 1
}
Branch {
Points [0, 30]
DstBlock "Add"
DstPort 1
}
}
Line {
SrcBlock "Product"
SrcPort 1
DstBlock "Math\nFunction"
DstPort 1
}
Line {
SrcBlock "Constant"
SrcPort 1
Points [-35, 0]
DstBlock "Sum"
DstPort 2
}
Line {
SrcBlock "Math\nFunction"
SrcPort 1
DstBlock "Sum"
DstPort 1
}
Line {
SrcBlock "Sum"
SrcPort 1
DstBlock "Product1"
DstPort 1
}
Line {
SrcBlock "Sum1"
SrcPort 1
DstBlock "Gain"
DstPort 1
}
Annotation {
Name "x1"
Position [537, 90]
}
Annotation {
Name "x2"
Position [307, 53]
}
Annotation {
Name "u"
Position [226, 54]
}
Annotation {
Name "a"
Position [503, 81]
}
Annotation {
Name "b"
Position [280, 42]
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?