📄 danbai.m
字号:
ForegroundColor "blue"
BackgroundColor "cyan"
Expr "(-l2*u(1)+n*w2*u(5)*u(3)-n*e*u(5)*u(6)*u(2)-n*u"
"(6)*u(4))/(1-n*e*u(5)*u(5))"
}
Block {
BlockType Integrator
Name "alphaDot"
Ports [1, 1, 0, 0, 0]
Position [340, 158, 365, 192]
ForegroundColor "blue"
BackgroundColor "cyan"
ExternalReset "none"
InitialConditionSource "internal"
InitialCondition "0"
LimitOutput off
UpperSaturationLimit "inf"
LowerSaturationLimit "-inf"
ShowSaturationPort off
ShowStatePort off
AbsoluteTolerance "auto"
}
Block {
BlockType Integrator
Name "gamma"
Ports [1, 1, 0, 0, 0]
Position [430, 213, 455, 247]
ForegroundColor "blue"
BackgroundColor "cyan"
ExternalReset "none"
InitialConditionSource "internal"
InitialCondition "80*(pi/180)"
LimitOutput off
UpperSaturationLimit "inf"
LowerSaturationLimit "-inf"
ShowSaturationPort off
ShowStatePort off
AbsoluteTolerance "auto"
}
Block {
BlockType Fcn
Name "gammaDDot"
Position [260, 215, 305, 245]
ForegroundColor "blue"
BackgroundColor "cyan"
Expr "(-w2*u(3)+e*l2*u(5)*u(1)+n*e*u(5)*u(6)*u(4)+e*u"
"(6)*u(2))/(1-n*e*u(5)*u(5))"
}
Block {
BlockType Integrator
Name "gammaDot"
Ports [1, 1, 0, 0, 0]
Position [340, 213, 365, 247]
ForegroundColor "blue"
BackgroundColor "cyan"
ExternalReset "none"
InitialConditionSource "internal"
InitialCondition "0"
LimitOutput off
UpperSaturationLimit "inf"
LowerSaturationLimit "-inf"
ShowSaturationPort off
ShowStatePort off
AbsoluteTolerance "auto"
}
Block {
BlockType Mux
Name "modified\nstate\nvector"
Ports [6, 1, 0, 0, 0]
Position [190, 167, 220, 233]
ForegroundColor "blue"
BackgroundColor "cyan"
Inputs "6"
DisplayOption "none"
}
Block {
BlockType Scope
Name "scope"
Ports [1, 0, 0, 0, 0]
Position [385, 110, 410, 140]
Orientation "left"
ForegroundColor "blue"
BackgroundColor "cyan"
Floating off
Location [47, 131, 335, 363]
Open off
NumInputPorts "1"
TickLabels "on"
ZoomMode "on"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
Grid "on"
TimeRange "60.000000"
YMin "-5"
YMax "5"
SaveToWorkspace off
SaveName "ScopeData"
DataFormat "Matrix"
LimitMaxRows on
MaxRows "5000"
Decimation "1"
SampleInput off
SampleTime "0"
}
Block {
BlockType Fcn
Name "sin(alpha)"
Position [105, 75, 150, 105]
ForegroundColor "blue"
BackgroundColor "cyan"
Expr "sin(u)"
}
Block {
BlockType Fcn
Name "sin(gamma)"
Position [105, 165, 150, 195]
ForegroundColor "blue"
BackgroundColor "cyan"
Expr "sin(u)"
}
Block {
BlockType Mux
Name "state\nvector"
Ports [4, 1, 0, 0, 0]
Position [340, 319, 370, 376]
Orientation "left"
ForegroundColor "blue"
BackgroundColor "cyan"
Inputs "4"
DisplayOption "none"
}
Block {
BlockType Demux
Name "state\nvector\n[a aD g gD]"
Ports [1, 4, 0, 0, 0]
Position [25, 137, 65, 183]
ForegroundColor "blue"
BackgroundColor "cyan"
Outputs "4"
}
Block {
BlockType Mux
Name "state\nvector1"
Ports [2, 1, 0, 0, 0]
Position [440, 68, 470, 117]
Orientation "left"
ForegroundColor "blue"
BackgroundColor "cyan"
Inputs "2"
DisplayOption "none"
}
Line {
SrcBlock "alphaDDot"
SrcPort 1
DstBlock "alphaDot"
DstPort 1
}
Line {
SrcBlock "gammaDDot"
SrcPort 1
DstBlock "gammaDot"
DstPort 1
}
Line {
SrcBlock "alphaDot"
SrcPort 1
Points [20, 0]
Branch {
DstBlock "alpha"
DstPort 1
}
Branch {
Points [0, 165]
DstBlock "state\nvector"
DstPort 2
}
}
Line {
SrcBlock "gammaDot"
SrcPort 1
Points [40, 0]
Branch {
DstBlock "gamma"
DstPort 1
}
Branch {
Points [0, 140]
DstBlock "state\nvector"
DstPort 4
}
}
Line {
SrcBlock "alpha"
SrcPort 1
Points [45, 0; 0, 0]
Branch {
Points [0, 150]
DstBlock "state\nvector"
DstPort 1
}
Branch {
Points [0, -95]
DstBlock "state\nvector1"
DstPort 1
}
}
Line {
SrcBlock "gamma"
SrcPort 1
Points [25, 0; 0, 0]
Branch {
Points [0, 125]
DstBlock "state\nvector"
DstPort 3
}
Branch {
DstBlock "state\nvector1"
DstPort 2
}
}
Line {
SrcBlock "state\nvector1"
SrcPort 1
Points [-10, 0]
Branch {
DstBlock "Animation\nFunction"
DstPort 1
}
Branch {
DstBlock "scope"
DstPort 1
}
}
Line {
SrcBlock "state\nvector"
SrcPort 1
Points [-50, 0]
Branch {
Points [-245, 0]
Branch {
Points [-30, 0]
DstBlock "state\nvector\n[a aD g gD]"
DstPort 1
}
Branch {
Points [0, -35]
Branch {
Points [0, -45]
DstBlock "C"
DstPort 1
}
Branch {
DstBlock "S"
DstPort 1
}
}
}
Branch {
Points [0, -50]
DstBlock "State\nScope"
DstPort 1
}
}
Line {
SrcBlock "sin(alpha)"
SrcPort 1
Points [20, 0]
DstBlock "modified\nstate\nvector"
DstPort 1
}
Line {
SrcBlock "(alphaDot)^2"
SrcPort 1
Points [15, 0; 0, 50]
DstBlock "modified\nstate\nvector"
DstPort 2
}
Line {
SrcBlock "sin(gamma)"
SrcPort 1
Points [10, 0; 0, 15]
DstBlock "modified\nstate\nvector"
DstPort 3
}
Line {
SrcBlock "(gammaDot)^2"
SrcPort 1
Points [10, 0; 0, -20]
DstBlock "modified\nstate\nvector"
DstPort 4
}
Line {
SrcBlock "C"
SrcPort 1
Points [15, 0; 0, -55]
DstBlock "modified\nstate\nvector"
DstPort 5
}
Line {
SrcBlock "S"
SrcPort 1
Points [20, 0]
DstBlock "modified\nstate\nvector"
DstPort 6
}
Line {
SrcBlock "modified\nstate\nvector"
SrcPort 1
Points [10, 0; 0, 0]
Branch {
Points [0, -25]
DstBlock "alphaDDot"
DstPort 1
}
Branch {
Points [0, 30]
DstBlock "gammaDDot"
DstPort 1
}
}
Line {
SrcBlock "state\nvector\n[a aD g gD]"
SrcPort 4
Points [15, 0; 0, 50]
DstBlock "(gammaDot)^2"
DstPort 1
}
Line {
SrcBlock "state\nvector\n[a aD g gD]"
SrcPort 3
Points [20, 0]
DstBlock "sin(gamma)"
DstPort 1
}
Line {
SrcBlock "state\nvector\n[a aD g gD]"
SrcPort 2
Points [20, 0]
DstBlock "(alphaDot)^2"
DstPort 1
}
Line {
SrcBlock "state\nvector\n[a aD g gD]"
SrcPort 1
Points [15, 0; 0, -55]
DstBlock "sin(alpha)"
DstPort 1
}
Annotation {
Position [137, 382]
ForegroundColor "blue"
BackgroundColor "gray"
Text "Double Pendulum System II\n(Double click on the"
" \"?\" for more info)"
}
Annotation {
Position [166, 417]
ForegroundColor "blue"
BackgroundColor "gray"
Text "To start and stop the simulation, use the \"Sta"
"rt/Stop\"\nselection in the \"Simulation\" pull-down menu"
}
Annotation {
Position [255, 32]
BackgroundColor "gray"
Text "双轴单摆仿真实验"
FontName "宋体"
FontSize 18
FontWeight "bold"
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -