📄 slcpp1.mdl
字号:
# $Revision: 1.9 $
Model {
Name "slcpp1"
Version 2.20
SimParamPage Solver
SampleTimeColors off
InvariantConstants off
WideVectorLines on
ShowLineWidths off
StartTime "0.0"
StopTime "250"
Solver ode45
RelTol "1e-5"
AbsTol "1e-6"
Refine "1"
MaxStep "0.1"
InitialStep "auto"
FixedStep "auto"
MaxOrder 5
OutputOption RefineOutputTimes
OutputTimes "[]"
LoadExternalInput off
ExternalInput "[t, u]"
SaveTime off
TimeSaveName "tout"
SaveState off
StateSaveName "xout"
SaveOutput off
OutputSaveName "yout"
LoadInitialState off
InitialState "xInitial"
SaveFinalState off
FinalStateName "xFinal"
LimitMaxRows off
MaxRows "1000"
Decimation "1"
AlgebraicLoopMsg warning
MinStepSizeMsg warning
UnconnectedInputMsg warning
UnconnectedOutputMsg warning
UnconnectedLineMsg warning
ConsistencyChecking off
ZeroCross on
SimulationMode normal
RTWSystemTargetFile "grt.tlc"
RTWInlineParameters off
RTWPlaceOutputsASAP off
RTWRetainRTWFile off
RTWTemplateMakefile "grt_unix.tmf"
RTWMakeCommand "make_rtw"
RTWGenerateCodeOnly off
ExtModeMexFile "ext_comm"
ExtModeBatchMode off
PreLoadFcn "initcpp1"
CloseFcn "AnimFigTitle = [winName, ': Cart & Parallel Poles A"
"nimation']; AnimFigH = findobj(0,'Name',AnimFigTitle); close(AnimFigH)"
BlockDefaults {
Orientation right
ForegroundColor black
BackgroundColor white
DropShadow off
NamePlacement normal
FontName "Helvetica"
FontSize 10
FontWeight normal
FontAngle normal
ShowName on
}
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 "slcpp1"
Location [137, 97, 736, 504]
Open on
ToolBar on
StatusBar on
ScreenColor white
PaperOrientation landscape
PaperPositionMode auto
PaperType usletter
PaperUnits inches
Block {
BlockType "S-Function"
Name "Animation"
Ports [1, 0, 0, 0, 0]
Position [460, 37, 515, 73]
FunctionName "animcpp1"
PortCounts "[]"
SFunctionModules "''"
}
Block {
BlockType SubSystem
Name "Cart & Parallel Poles\nDynamics"
Ports [2, 6, 0, 0, 0]
Position [270, 160, 330, 220]
ShowPortLabels off
MaskType "Differential Equation Editor (DEE)"
MaskDescription "Inverted Pendulum (cart & two poles)"
MaskPromptString "Initial Conditions (a1, av1, a2, av2, x, v):|Ph"
"ysical Specifications (M, g):"
MaskStyleString "edit,edit"
MaskTunableValueString "on,on"
MaskInitialization "init_cond = @1; specs = @2;M=specs(1);g=specs(2"
");"
MaskDisplay "plot(-4,-1,4,6,[0 3 2.8 -0.2 0]+0.5,[1 5 5.15 1"
".15 1],[0 0.2 -0.5 -0.7 0]-0.5, [1 1.2 2.7 2.5 1],[-1 -1 1 1 -1],[1 0 0 1 1],"
"[-3.5 3.5],[0 0])"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate none
MaskIconUnits autoscale
MaskValueString "[-0.07 0 0.1 0 0 0]|[1.0, 9.8]"
System {
Name "Cart & Parallel Poles\nDynamics"
Location [341, 77, 1164, 858]
Open off
ToolBar off
StatusBar off
ScreenColor white
PaperOrientation landscape
PaperPositionMode auto
PaperType usletter
PaperUnits inches
Block {
BlockType Inport
Name "SysInport1"
Position [275, 290, 295, 310]
Port "1"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Inport
Name "in_2"
Position [105, 390, 125, 410]
Port "2"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Gain
Name "Gain"
Position [160, 415, 195, 445]
Gain "0.1"
}
Block {
BlockType Gain
Name "Gain1"
Position [205, 385, 240, 415]
Gain "0.5"
}
Block {
BlockType Gain
Name "Gain2"
Position [160, 505, 195, 535]
Gain "0.1"
}
Block {
BlockType Gain
Name "Gain3"
Position [205, 475, 240, 505]
Gain "0.5"
}
Block {
BlockType Integrator
Name "Integ1"
Ports [1, 1, 0, 0, 0]
Position [605, 195, 635, 215]
ExternalReset none
InitialConditionSource internal
InitialCondition "init_cond(1)"
LimitOutput off
UpperSaturationLimit "inf"
LowerSaturationLimit "-inf"
ShowSaturationPort off
ShowStatePort off
AbsoluteTolerance "auto"
}
Block {
BlockType Integrator
Name "Integ2"
Ports [1, 1, 0, 0, 0]
Position [605, 245, 635, 265]
ExternalReset none
InitialConditionSource internal
InitialCondition "init_cond(2)"
LimitOutput off
UpperSaturationLimit "inf"
LowerSaturationLimit "-inf"
ShowSaturationPort off
ShowStatePort off
AbsoluteTolerance "auto"
}
Block {
BlockType Integrator
Name "Integ3"
Ports [1, 1, 0, 0, 0]
Position [605, 295, 635, 315]
ExternalReset none
InitialConditionSource internal
InitialCondition "init_cond(3)"
LimitOutput off
UpperSaturationLimit "inf"
LowerSaturationLimit "-inf"
ShowSaturationPort off
ShowStatePort off
AbsoluteTolerance "auto"
}
Block {
BlockType Integrator
Name "Integ4"
Ports [1, 1, 0, 0, 0]
Position [605, 370, 635, 390]
ExternalReset none
InitialConditionSource internal
InitialCondition "init_cond(4)"
LimitOutput off
UpperSaturationLimit "inf"
LowerSaturationLimit "-inf"
ShowSaturationPort off
ShowStatePort off
AbsoluteTolerance "auto"
}
Block {
BlockType Integrator
Name "Integ5"
Ports [1, 1, 0, 0, 0]
Position [605, 420, 635, 440]
ExternalReset none
InitialConditionSource internal
InitialCondition "init_cond(5)"
LimitOutput off
UpperSaturationLimit "inf"
LowerSaturationLimit "-inf"
ShowSaturationPort off
ShowStatePort off
AbsoluteTolerance "auto"
}
Block {
BlockType Integrator
Name "Integ6"
Ports [1, 1, 0, 0, 0]
Position [605, 470, 635, 490]
ExternalReset none
InitialConditionSource internal
InitialCondition "init_cond(6)"
LimitOutput off
UpperSaturationLimit "inf"
LowerSaturationLimit "-inf"
ShowSaturationPort off
ShowStatePort off
AbsoluteTolerance "auto"
}
Block {
BlockType Constant
Name "Length\nof pole 2"
Position [95, 480, 115, 500]
Value "1"
}
Block {
BlockType Mux
Name "SysMux"
Ports [11, 1, 0, 0, 0]
Position [405, 294, 455, 356]
Inputs "11"
}
Block {
BlockType Fcn
Name "x1"
Position [505, 195, 535, 215]
Expr "u(3) "
" "
" "
" "
}
Block {
BlockType Fcn
Name "x2"
Position [505, 245, 535, 265]
Expr "-3/4*(3*u(11)*cos(u(4))*g*sin(u(4))*cos(u(2"
"))-4*u(11)*u(10)*sin(u(4))*u(5)^2*cos(u(2))+4*sin(u(2))*g*M+4*sin(u(2))*g*u(9"
")+4*sin(u(2))*g*u(11)-3*sin(u(2))*g*u(11)*cos(u(4))^2-4*u(1)*cos(u(2))-4*u(9)"
"*u(8)*sin(u(2))*u(3)^2*cos(u(2)))/u(8)/(3*u(11)*cos(u(4))^2-4*u(9)-4*u(11)-4*"
"M+3*u(9)*cos(u(2))^2) "
}
Block {
BlockType Fcn
Name "x3"
Position [505, 295, 535, 315]
Expr "u(5) "
" "
" "
" "
}
Block {
BlockType Fcn
Name "x4"
Position [505, 370, 535, 390]
Expr "-3/4*(4*g*sin(u(4))*u(9)+4*g*sin(u(4))*u(11"
")-4*u(11)*u(10)*sin(u(4))*u(5)^2*cos(u(4))+4*g*sin(u(4))*M-3*g*sin(u(4))*u(9)"
"*cos(u(2))^2+3*cos(u(4))*cos(u(2))*sin(u(2))*g*u(9)-4*cos(u(4))*u(1)-4*cos(u("
"4))*u(9)*u(8)*sin(u(2))*u(3)^2)/u(10)/(3*u(11)*cos(u(4))^2-4*u(9)-4*u(11)-4*M"
"+3*u(9)*cos(u(2))^2) "
}
Block {
BlockType Fcn
Name "x5"
Position [505, 420, 535, 440]
Expr "u(7) "
" "
" "
" "
}
Block {
BlockType Fcn
Name "x6"
Position [505, 470, 535, 490]
Expr "(3*cos(u(2))*sin(u(2))*g*u(9)+3*u(11)*cos(u"
"(4))*g*sin(u(4))-4*u(1)-4*u(9)*u(8)*sin(u(2))*u(3)^2-4*u(11)*u(10)*sin(u(4))*"
"u(5)^2)/(3*u(11)*cos(u(4))^2-4*u(9)-4*u(11)-4*M+3*u(9)*cos(u(2))^2) "
" "
" "
}
Block {
BlockType Outport
Name "Port1"
Position [710, 195, 730, 215]
Port "1"
OutputWhenDisabled held
InitialOutput "0"
}
Block {
BlockType Outport
Name "Port2"
Position [710, 245, 730, 265]
Port "2"
OutputWhenDisabled held
InitialOutput "0"
}
Block {
BlockType Outport
Name "Port3"
Position [710, 295, 730, 315]
Port "3"
OutputWhenDisabled held
InitialOutput "0"
}
Block {
BlockType Outport
Name "Port4"
Position [710, 370, 730, 390]
Port "4"
OutputWhenDisabled held
InitialOutput "0"
}
Block {
BlockType Outport
Name "Port5"
Position [710, 420, 730, 440]
Port "5"
OutputWhenDisabled held
InitialOutput "0"
}
Block {
BlockType Outport
Name "Port6"
Position [710, 470, 730, 490]
Port "6"
OutputWhenDisabled held
InitialOutput "0"
}
Line {
SrcBlock "Integ6"
SrcPort 1
Points [10, 0]
Branch {
DstBlock "Port6"
DstPort 1
}
Branch {
Points [0, -20; -265, 0; 0, -130]
DstBlock "SysMux"
DstPort 7
}
}
Line {
SrcBlock "Integ5"
SrcPort 1
Points [10, 0]
Branch {
DstBlock "Port5"
DstPort 1
}
Branch {
Points [0, -20; -270, 0; 0, -85]
DstBlock "SysMux"
DstPort 6
}
}
Line {
SrcBlock "Integ4"
SrcPort 1
Points [10, 0]
Branch {
DstBlock "Port4"
DstPort 1
}
Branch {
Points [0, -20; -275, 0; 0, -40]
DstBlock "SysMux"
DstPort 5
}
}
Line {
SrcBlock "Integ3"
SrcPort 1
Points [10, 0]
Branch {
DstBlock "Port3"
DstPort 1
}
Branch {
Points [0, -20; -280, 0; 0, 30]
DstBlock "SysMux"
DstPort 4
}
}
Line {
SrcBlock "Integ2"
SrcPort 1
Points [10, 0]
Branch {
DstBlock "Port2"
DstPort 1
}
Branch {
Points [0, -20; -275, 0; 0, 75]
DstBlock "SysMux"
DstPort 3
}
}
Line {
SrcBlock "Integ1"
SrcPort 1
Points [10, 0]
Branch {
DstBlock "Port1"
DstPort 1
}
Branch {
Points [0, -20; -270, 0; 0, 120]
DstBlock "SysMux"
DstPort 2
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -