📄 simu_modlib.mdl
字号:
Model {
Name "simu_modlib"
Version 2.09
SimParamPage Solver
SampleTimeColors off
InvariantConstants off
WideVectorLines off
ShowLineWidths off
PaperOrientation landscape
PaperType usletter
PaperUnits inches
StartTime "0.0"
StopTime "999999"
Solver ode45
RelTol "1e-3"
AbsTol "1e-3"
Refine "1"
MaxStep "10"
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
RTWRetainRTWFile off
RTWTemplateMakefile "grt_vc.tmf"
RTWMakeCommand "make_rtw"
RTWGenerateCodeOnly off
ExtModeMexFile "ext_comm"
ExtModeBatchMode off
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 "simu_modlib"
Location [7, 113, 170, 370]
Open on
ScreenColor white
Block {
BlockType Derivative
Name "Derivative"
Position [20, 60, 50, 80]
FontName "Times New Roman"
FontSize 8
}
Block {
BlockType SubSystem
Name "Double click to \ncall Simulink"
Ports [0, 0, 0, 0, 0]
Position [85, 175, 145, 206]
FontName "Times New Roman"
FontSize 8
OpenFcn "simulink"
ShowPortLabels off
MaskDisplay "disp('Simulink')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate none
MaskIconUnits autoscale
System {
Name "Double click to \ncall Simulink"
Location [164, 212, 491, 613]
Open off
ScreenColor white
Block {
BlockType SubSystem
Name "2-D Look-Up\nTable"
Ports [2, 1, 0, 0, 0]
Position [260, 138, 290, 162]
ShowPortLabels off
MaskType "2-D Table Lookup"
MaskDescription "Two Dimensional Table Lookup\nThe first "
"input corresponds to X Index and the "
"second input corresponds to the Y Index"
MaskHelp "This block returns a linearly interpolated "
"intersection from the table using the "
"X index (which corresponds to the rows "
"of the table) and the Y index (which "
"corresponds to the columns of the table). "
"Extrapolation is used."
MaskPromptString "X Index|Y Index|Table"
MaskStyleString "edit,edit,edit"
MaskInitialization "xindex=@1; yindex=@2; table=@3; sftab2chk(xi"
"ndex,yindex,table);"
MaskDisplay "plot(-10,-10,110,110,[90,50,10],[90,40,30],["
"90,50,10],[50,26,20],[90,50,10],[22,13,10])"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate none
MaskIconUnits autoscale
MaskValueString "sort(rand(10,1))*2-1|sort(rand(10,1))*2-1|ma"
"gic(10)-50"
System {
Name "2-D Look-Up\nTable"
Location [316, 263, 598, 417]
Open off
ScreenColor white
Block {
BlockType Inport
Name "x0"
Position [20, 25, 40, 45]
Port "1"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Inport
Name "y0"
Position [20, 80, 40, 100]
Port "2"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Mux
Name "Mux"
Ports [2, 1, 0, 0, 0]
Position [90, 46, 120, 79]
Inputs "2"
}
Block {
BlockType S-Function
Name "S-function"
Ports [1, 1, 0, 0, 0]
Position [140, 52, 190, 78]
FunctionName "sftable2"
Parameters "xindex, yindex, table"
}
Block {
BlockType Outport
Name "table out"
Position [215, 55, 235, 75]
Port "1"
OutputWhenDisabled held
InitialOutput "0"
}
Line {
SrcBlock "Mux"
SrcPort 1
DstBlock "S-function"
DstPort 1
}
Line {
SrcBlock "x0"
SrcPort 1
Points [20, 0; 0, 20]
DstBlock "Mux"
DstPort 1
}
Line {
SrcBlock "S-function"
SrcPort 1
DstBlock "table out"
DstPort 1
}
Line {
SrcBlock "y0"
SrcPort 1
Points [20, 0; 0, -20]
DstBlock "Mux"
DstPort 2
}
}
}
Block {
BlockType Abs
Name "Abs"
Position [110, 138, 140, 162]
}
Block {
BlockType Backlash
Name "Backlash"
Position [185, 33, 215, 57]
BacklashWidth "1"
InitialOutput "0"
}
Block {
BlockType CombinatorialLogic
Name "Combinatorial\nLogic"
Position [185, 198, 215, 222]
TruthTable "[0 0;0 1;0 1;1 0;0 1;1 0;1 0;1 1]"
}
Block {
BlockType Lookup
Name "Coulombic\nFriction"
Position [185, 82, 215, 108]
InputValues "[-1,0,0,1]"
OutputValues "[-gain-ini -ini ini gain+ini]"
MaskType "Coulombic Friction"
MaskDescription "Coulombic Friction\ny = sign(x) * (Gain "
"* abs(x) + Offset)"
MaskHelp "This block has a discontinuity\\nat zero "
"and a linear gain afterward.\\ny= sign(x)*(G"
"ain*abs(x)+Offset)"
MaskPromptString "Offset discontinuity at zero:|Gain:"
MaskStyleString "edit,edit"
MaskInitialization "ini=@1;gain=@2;x=max(ini,gain+ini);"
MaskDisplay "plot([-1 0 0 1],[-gain-ini, -ini, ini, "
"gain+ini],[-1 1],[0 0],[0 0],[-x,x])"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate none
MaskIconUnits autoscale
MaskValueString "1|1"
}
Block {
BlockType DeadZone
Name "Dead Zone"
Position [110, 82, 140, 108]
LowerValue "-0.5"
UpperValue "0.5"
}
Block {
BlockType Fcn
Name "Fcn"
Position [25, 265, 65, 285]
Expr "sin(u[1])"
}
Block {
BlockType SubSystem
Name "Limited\nIntegrator"
Ports [1, 1, 0, 0, 0]
Position [255, 325, 295, 355]
ShowPortLabels off
MaskType "Limited Integrator."
MaskDescription "Limited Integrator"
MaskHelp "Implements a limited integrator with "
"\\nan expression of the form:\\n\\nif(x<=lb "
"and u<0) or (x>=ub and u>0)\\n xdot=0\\nel"
"se\\n xdot=u"
MaskPromptString "Lower bound:|Upper bound:|Initial condition:"
MaskStyleString "edit,edit,edit"
MaskInitialization "lower_limit=@1;upper_limit=@2;X0=@3;"
MaskDisplay "plot(-1,-0.2,3.5,1.2,[0.05,1,2,2.9],[0,0,1,1"
"]);disp(' 1/s ')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate none
MaskIconUnits autoscale
MaskValueString "-.5|.5|0"
System {
Name "Limited\nIntegrator"
Location [452, 229, 1117, 789]
Open off
ScreenColor white
Block {
BlockType Inport
Name "Inport"
Position [25, 85, 45, 105]
Port "1"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Constant
Name "Constant"
Position [325, 179, 395, 201]
ShowName off
Value "upper_limit"
}
Block {
BlockType Constant
Name "Constant1"
Position [325, 345, 390, 365]
ShowName off
Value "lower_limit"
}
Block {
BlockType Constant
Name "Constant2"
Position [20, 135, 40, 155]
Value "0"
}
Block {
BlockType Constant
Name "Constant3"
Position [355, 260, 375, 280]
ShowName off
Value "0"
}
Block {
BlockType Constant
Name "Constant4"
Position [355, 425, 375, 445]
ShowName off
Value "0"
}
Block {
BlockType Integrator
Name "Integrator"
Ports [1, 1, 0, 0, 0]
Position [165, 99, 200, 141]
ExternalReset none
InitialConditionSource internal
InitialCondition "X0"
LimitOutput off
UpperSaturationLimit "inf"
LowerSaturationLimit "-inf"
ShowSaturationPort off
ShowStatePort off
AbsoluteTolerance "auto"
}
Block {
BlockType Logic
Name "Logical\nOperator"
Ports [2, 1, 0, 0, 0]
Position [570, 280, 605, 315]
ShowName off
Operator AND
Inputs "2"
}
Block {
BlockType Logic
Name "Logical\nOperator1"
Ports [2, 1, 0, 0, 0]
Position [490, 200, 525, 235]
ShowName off
Operator OR
Inputs "2"
}
Block {
BlockType Logic
Name "Logical\nOperator2"
Ports [2, 1, 0, 0, 0]
Position [490, 360, 525, 395]
ShowName off
Operator OR
Inputs "2"
}
Block {
BlockType RelationalOperator
Name "Relational\noperator"
Position [415, 151, 445, 204]
ShowName off
Operator <=
}
Block {
BlockType RelationalOperator
Name "Relational\noperator1"
Position [415, 312, 445, 368]
ShowName off
Operator >=
}
Block {
BlockType RelationalOperator
Name "Relational\noperator2"
Position [415, 231, 445, 284]
ShowName off
Operator <=
}
Block {
BlockType RelationalOperator
Name "Relational\noperator3"
Position [415, 396, 445, 449]
ShowName off
Operator >=
}
Block {
BlockType Saturate
Name "Saturation"
Position [325, 110, 350, 130]
UpperLimit "upper_limit"
LowerLimit "lower_limit"
}
Block {
BlockType Switch
Name "Switch"
Position [110, 80, 135, 160]
Threshold "0.5"
}
Block {
BlockType Outport
Name "Outport"
Position [515, 110, 535, 130]
Port "1"
OutputWhenDisabled held
InitialOutput "0"
}
Line {
SrcBlock "Integrator"
SrcPort 1
Points [0, 0]
Branch {
Points [40, 0; 0, 45; 70, 0]
Branch {
DstBlock "Relational\noperator"
DstPort 1
}
Branch {
Points [0, 160]
DstBlock "Relational\noperator1"
DstPort 1
}
}
Branch {
DstBlock "Saturation"
DstPort 1
}
}
Line {
SrcBlock "Constant4"
SrcPort 1
DstBlock "Relational\noperator3"
DstPort 2
}
Line {
SrcBlock "Constant3"
SrcPort 1
DstBlock "Relational\noperator2"
DstPort 2
}
Line {
SrcBlock "Logical\nOperator2"
SrcPort 1
Points [10, 0; 0, -75]
DstBlock "Logical\nOperator"
DstPort 2
}
Line {
SrcBlock "Relational\noperator3"
SrcPort 1
Points [10, 0; 0, -40]
DstBlock "Logical\nOperator2"
DstPort 2
}
Line {
SrcBlock "Relational\noperator1"
SrcPort 1
Points [10, 0; 0, 30]
DstBlock "Logical\nOperator2"
DstPort 1
}
Line {
SrcBlock "Logical\nOperator1"
SrcPort 1
Points [10, 0; 0, 70]
DstBlock "Logical\nOperator"
DstPort 1
}
Line {
SrcBlock "Relational\noperator2"
SrcPort 1
Points [15, 0; 0, -35]
DstBlock "Logical\nOperator1"
DstPort 2
}
Line {
SrcBlock "Relational\noperator"
SrcPort 1
Points [15, 0; 0, 30]
DstBlock "Logical\nOperator1"
DstPort 1
}
Line {
SrcBlock "Constant2"
SrcPort 1
DstBlock "Switch"
DstPort 3
}
Line {
SrcBlock "Logical\nOperator"
SrcPort 1
Points [15, 0; 0, 190; -540, 0; 0, -370]
DstBlock "Switch"
DstPort 2
}
Line {
SrcBlock "Constant1"
SrcPort 1
DstBlock "Relational\noperator1"
DstPort 2
}
Line {
SrcBlock "Constant"
SrcPort 1
DstBlock "Relational\noperator"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -