📄 pendulum.mdl
字号:
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 Scope
Floating off
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 "0"
}
Block {
BlockType SignalGenerator
WaveForm "sine"
TimeSource "Use simulation time"
Amplitude "1"
Frequency "1"
Units "Hertz"
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"
}
}
AnnotationDefaults {
HorizontalAlignment "center"
VerticalAlignment "middle"
ForegroundColor "black"
BackgroundColor "white"
DropShadow off
FontName "Helvetica"
FontSize 10
FontWeight "normal"
FontAngle "normal"
}
LineDefaults {
FontName "Helvetica"
FontSize 9
FontWeight "normal"
FontAngle "normal"
}
System {
Name "pendulum"
Location [2, 82, 1014, 721]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
ReportName "simulink-default.rpt"
Block {
BlockType Scope
Name "Scope"
Ports [1]
Position [725, 164, 755, 196]
Location [5, 56, 1029, 741]
Open off
NumInputPorts "1"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
YMin "-1.73472e-018"
YMax "0.08"
DataFormat "StructureWithTime"
MaxDataPoints "5000000"
}
Block {
BlockType Scope
Name "Scope1"
Ports [1]
Position [725, 99, 755, 131]
Location [5, 56, 1029, 741]
Open off
NumInputPorts "1"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
YMin "-1.73472e-018"
YMax "0.08"
SaveName "ScopeData1"
DataFormat "StructureWithTime"
MaxDataPoints "5000000"
}
Block {
BlockType Scope
Name "Scope2"
Ports [1]
Position [460, 84, 490, 116]
Location [5, 56, 1029, 741]
Open off
NumInputPorts "1"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
YMin "-1.73472e-018"
YMax "0.08"
SaveName "ScopeData2"
DataFormat "StructureWithTime"
MaxDataPoints "5000000"
}
Block {
BlockType Scope
Name "Scope3"
Ports [1]
Position [415, 289, 445, 321]
Location [5, 56, 1029, 741]
Open off
NumInputPorts "1"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
YMin "-0.4"
YMax "0.4"
SaveName "ScopeData3"
DataFormat "StructureWithTime"
MaxDataPoints "5000000"
}
Block {
BlockType SignalGenerator
Name "Signal\nGenerator"
Ports [0, 1]
Position [245, 235, 275, 265]
WaveForm "square"
Amplitude "1.5"
Frequency "10"
}
Block {
BlockType SubSystem
Name "Subsystem"
Ports [1, 4]
Position [480, 141, 555, 204]
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
System {
Name "Subsystem"
Location [2, 82, 1014, 721]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType Inport
Name "u"
Position [100, 73, 130, 87]
Port "1"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType Fcn
Name "Fcn1"
Position [440, 166, 485, 194]
Orientation "left"
NamePlacement "alternate"
Expr "m*L*u*u*sin(u)"
}
Block {
BlockType Fcn
Name "Fcn2"
Position [410, 326, 455, 354]
Orientation "left"
NamePlacement "alternate"
Expr "m*g*L*sin(u)"
}
Block {
BlockType Fcn
Name "Fcn3"
Position [460, 221, 505, 249]
Orientation "left"
NamePlacement "alternate"
Expr "m*L*cos(u)"
}
Block {
BlockType Fcn
Name "Fcn4"
Position [200, 286, 245, 314]
Orientation "left"
NamePlacement "alternate"
Expr "m*L*cos(u)"
}
Block {
BlockType Fcn
Name "Fcn5"
Position [280, 351, 325, 379]
Orientation "left"
NamePlacement "alternate"
Expr "m*L*sin(u)"
}
Block {
BlockType Gain
Name "Gain2"
Position [450, 415, 480, 445]
Gain "1/(m*L*L)"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "Gain4"
Position [435, 80, 465, 110]
Gain "1/(m+M)"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Integrator
Name "Integrator"
Ports [1, 1]
Position [505, 80, 535, 110]
IgnoreLimit off
}
Block {
BlockType Integrator
Name "Integrator1"
Ports [1, 1]
Position [640, 80, 670, 110]
IgnoreLimit off
}
Block {
BlockType Integrator
Name "Integrator2"
Ports [1, 1]
Position [525, 415, 555, 445]
IgnoreLimit off
}
Block {
BlockType Integrator
Name "Integrator3"
Ports [1, 1]
Position [630, 415, 660, 445]
LimitOutput on
UpperSaturationLimit "1.57"
LowerSaturationLimit "-1.57"
IgnoreLimit off
}
Block {
BlockType Product
Name "Product"
Ports [2, 1]
Position [345, 225, 360, 260]
Orientation "left"
NamePlacement "alternate"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Product
Name "Product1"
Ports [2, 1]
Position [240, 477, 255, 513]
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Product
Name "Product2"
Ports [3, 1]
Position [290, 412, 305, 448]
Inputs "3"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Sum
Name "Subtract"
Ports [3, 1]
Position [315, 70, 335, 120]
Inputs "+-+"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
OutScaling "2^-10"
SaturateOnIntegerOverflow off
}
Block {
BlockType Sum
Name "Subtract1"
Ports [3, 1]
Position [380, 401, 395, 459]
Inputs "++-"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
OutScaling "2^-10"
SaturateOnIntegerOverflow off
}
Block {
BlockType Outport
Name "y"
Position [695, 88, 725, 102]
IconDisplay "Port number"
BusOutputAsStruct off
}
Block {
BlockType Outport
Name "ydot"
Position [700, 143, 730, 157]
Port "2"
IconDisplay "Port number"
BusOutputAsStruct off
}
Block {
BlockType Outport
Name "tetha"
Position [710, 423, 740, 437]
Port "3"
IconDisplay "Port number"
BusOutputAsStruct off
}
Block {
BlockType Outport
Name "tethadot"
Position [710, 473, 740, 487]
Port "4"
IconDisplay "Port number"
BusOutputAsStruct off
}
Line {
SrcBlock "Integrator2"
SrcPort 1
Points [0, 0; 25, 0]
Branch {
Points [15, 0]
Branch {
DstBlock "Integrator3"
DstPort 1
}
Branch {
Points [0, 50]
Branch {
Points [-325, 0]
DstBlock "Product2"
DstPort 3
}
Branch {
DstBlock "tethadot"
DstPort 1
}
}
}
Branch {
Points [0, -165; -210, 0]
DstBlock "Product"
DstPort 2
}
}
Line {
SrcBlock "Integrator"
SrcPort 1
Points [0, 0; 45, 0]
Branch {
DstBlock "Integrator1"
DstPort 1
}
Branch {
Points [0, 55]
Branch {
DstBlock "ydot"
DstPort 1
}
Branch {
Points [-50, 0; 0, 160; -280, 0; 0, 120]
DstBlock "Product2"
DstPort 2
}
}
}
Line {
SrcBlock "Fcn2"
SrcPort 1
Points [-45, 0; 0, 70]
DstBlock "Subtract1"
DstPort 1
}
Line {
SrcBlock "u"
SrcPort 1
DstBlock "Subtract"
DstPort 1
}
Line {
SrcBlock "Integrator1"
SrcPort 1
DstBlock "y"
DstPort 1
}
Line {
Labels [0, 0]
SrcBlock "Integrator3"
SrcPort 1
Points [20, 0]
Branch {
DstBlock "tetha"
DstPort 1
}
Branch {
Points [0, -90]
Branch {
Points [0, -40]
Branch {
Points [0, -65]
Branch {
Points [0, -55]
DstBlock "Fcn1"
DstPort 1
}
Branch {
DstBlock "Fcn3"
DstPort 1
}
}
Branch {
DstBlock "Fcn4"
DstPort 1
}
}
Branch {
Points [-155, 0]
Branch {
DstBlock "Fcn2"
DstPort 1
}
Branch {
Points [0, 25]
DstBlock "Fcn5"
DstPort 1
}
}
}
}
Line {
SrcBlock "Gain4"
SrcPort 1
Points [10, 0]
Branch {
DstBlock "Integrator"
DstPort 1
}
Branch {
Points [0, 40; -330, 0; 0, 370]
DstBlock "Product1"
DstPort 2
}
}
Line {
SrcBlock "Subtract"
SrcPort 1
DstBlock "Gain4"
DstPort 1
}
Line {
SrcBlock "Product"
SrcPort 1
Points [-70, 0; 0, -150]
DstBlock "Subtract"
DstPort 2
}
Line {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -