📄 s1c.mdl
字号:
Model {
Name "s1c"
Version 2.00
SimParamPage Solver
SampleTimeColors off
WideVectorLines off
PaperOrientation landscape
StartTime "0.0"
StopTime "tstop"
Solver ode113
RelTol "1e-5"
AbsTol "1e-6"
Refine "1"
MaxStep "1e-2"
InitialStep "auto"
FixedStep "auto"
MaxOrder 3
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
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
}
System {
Name "s1c"
Location [8, 90, 799, 463]
Open on
ScreenColor white
Block {
BlockType Clock
Name "Clock"
Position [100, 95, 120, 115]
DeleteFcn "simclock BlockIsBeingDestroyed"
PostSaveFcn "simclock Save"
Location [30, 40, 140, 75]
}
Block {
BlockType Fcn
Name "Fcn1"
Position [670, 260, 710, 280]
Expr "sqrt(u[1]*u[1]+u[2]*u[2])"
}
Block {
BlockType Gain
Name "Gain"
Position [220, 242, 250, 278]
Gain "wb"
}
Block {
BlockType SubSystem
Name "m1c"
Position [48, 29, 127, 63]
DropShadow on
OpenFcn "m1c"
ShowPortLabels off
MaskType "Masked block of m1c.m"
MaskHelp "Uses m1c.m to initialize and plot"
MaskDisplay "disp('Initialize\\nand plot')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate off
MaskIconUnits autoscale
System {
Name "m1c"
Location [95, 32767, 182, 32767]
Open off
ScreenColor white
Annotation {
Position [57, 49]
VerticalAlignment top
Text "Masked block of m1c.m \nto initilialize"
" simulation s1c.m\nand to plot the "
"results."
}
}
}
Block {
BlockType Mux
Name "Mux"
Position [143, 75, 667, 90]
Orientation up
Inputs "7"
}
Block {
BlockType Mux
Name "Mux2"
Position [630, 250, 650, 290]
Inputs "2"
}
Block {
BlockType SubSystem
Name "Per unit\n speed ref "
Position [30, 115, 70, 135]
ShowPortLabels on
MaskType "Repeating table"
MaskDescription "Repeating table."
MaskHelp "Repeats cycle given in table. Time values "
"should be monotonically increasing."
MaskPromptString "Time values:|Output values:"
MaskStyleString "edit,edit"
MaskVariables "rep_seq_t=@1;rep_seq_y=@2;"
MaskInitialization "period = max(rep_seq_t);\n"
MaskDisplay "plot([rep_seq_t,rep_seq_t+period,rep_seq_t+2*per"
"iod,rep_seq_t(1)+3*period],[rep_seq_y,rep_seq_y,"
"rep_seq_y,rep_seq_y(1)])"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate off
MaskIconUnits autoscale
MaskValueString "time_wref|speed_wref"
System {
Name "Per unit\n speed ref "
Location [382, 166, 692, 322]
Open off
ScreenColor white
Block {
BlockType Clock
Name "Clock"
Position [45, 60, 65, 80]
DeleteFcn "simclock BlockIsBeingDestroyed"
PostSaveFcn "simclock Save"
Location [30, 40, 110, 80]
}
Block {
BlockType Fcn
Name "Fcn1"
Position [110, 60, 150, 80]
Expr "rem(u[1],period)"
}
Block {
BlockType Lookup
Name "Look-Up Table"
Position [210, 58, 250, 82]
InputValues "rep_seq_t"
OutputValues "rep_seq_y"
}
Block {
BlockType Outport
Name "out_1"
Position [285, 60, 305, 80]
Port "1"
OutputWhenDisabled held
InitialOutput "0"
}
Line {
SrcBlock "Fcn1"
SrcPort 1
DstBlock "Look-Up Table"
DstPort 1
}
Line {
SrcBlock "Clock"
SrcPort 1
DstBlock "Fcn1"
DstPort 1
}
Line {
SrcBlock "Look-Up Table"
SrcPort 1
DstBlock "out_1"
DstPort 1
}
}
}
Block {
BlockType Scope
Name "Scope"
Position [525, 39, 540, 61]
Floating off
Location [-4, 390, 749, 544]
Open on
Grid on
TickLabels on
ZoomMode on
TimeRange "2"
YMin "-300"
YMax "300"
SaveToWorkspace off
SaveName "ScopeData"
LimitMaxRows off
MaxRows "5000"
Decimation "1"
SampleInput off
SampleTime "0"
}
Block {
BlockType Selector
Name "Selector"
Position [445, 41, 495, 59]
Elements "[2 3 4 5 6 7]"
InputPortWidth "7"
}
Block {
BlockType Sum
Name "Sum"
Position [715, 149, 730, 211]
Inputs "+++"
}
Block {
BlockType Sum
Name "Sum1"
Position [105, 148, 120, 177]
Inputs "+-"
}
Block {
BlockType Sum
Name "Sum2"
Position [165, 240, 180, 275]
Inputs "++"
}
Block {
BlockType SubSystem
Name "Tmech"
Position [405, 275, 445, 295]
ShowPortLabels on
MaskType "Repeating table"
MaskDescription "Repeating table."
MaskHelp "Repeats cycle given in table. Time values "
"should be monotonically increasing."
MaskPromptString "Time values:|Output values:"
MaskStyleString "edit,edit"
MaskVariables "rep_seq_t=@1;rep_seq_y=@2;"
MaskInitialization "period = max(rep_seq_t);\n"
MaskDisplay "plot([rep_seq_t,rep_seq_t+period,rep_seq_t+2*per"
"iod,rep_seq_t(1)+3*period],[rep_seq_y,rep_seq_y,"
"rep_seq_y,rep_seq_y(1)])"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate off
MaskIconUnits autoscale
MaskValueString "time_tmech|tmech_tmech"
System {
Name "Tmech"
Location [382, 166, 692, 322]
Open off
ScreenColor white
Block {
BlockType Clock
Name "Clock"
Position [45, 60, 65, 80]
DeleteFcn "simclock BlockIsBeingDestroyed"
PostSaveFcn "simclock Save"
Location [30, 40, 110, 80]
}
Block {
BlockType Fcn
Name "Fcn1"
Position [110, 60, 150, 80]
Expr "rem(u[1],period)"
}
Block {
BlockType Lookup
Name "Look-Up Table"
Position [210, 58, 250, 82]
InputValues "rep_seq_t"
OutputValues "rep_seq_y"
}
Block {
BlockType Outport
Name "out_1"
Position [285, 60, 305, 80]
Port "1"
OutputWhenDisabled held
InitialOutput "0"
}
Line {
SrcBlock "Fcn1"
SrcPort 1
DstBlock "Look-Up Table"
DstPort 1
}
Line {
SrcBlock "Clock"
SrcPort 1
DstBlock "Fcn1"
DstPort 1
}
Line {
SrcBlock "Look-Up Table"
SrcPort 1
DstBlock "out_1"
DstPort 1
}
}
}
Block {
BlockType ToWorkspace
Name "To Workspace"
Position [305, 42, 355, 58]
Orientation left
VariableName "y"
Buffer "40000"
Decimation "1"
SampleTime "0"
}
Block {
BlockType SubSystem
Name "Var_we_source"
Position [305, 153, 350, 227]
ShowPortLabels off
System {
Name "Var_we_source"
Location [25, 149, 709, 493]
Open off
ScreenColor white
Block {
BlockType Inport
Name "we"
Position [40, 75, 60, 95]
Port "1"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Gain
Name "-1"
Position [175, 248, 215, 282]
Gain "-1"
}
Block {
BlockType Fcn
Name "Fcn"
Position [415, 78, 565, 112]
Expr "u[1]*u[2]"
}
Block {
BlockType Fcn
Name "Fcn1"
Position [415, 138, 570, 172]
Expr "u[1]*(-u[2]-sqrt(3)*u[3])/2"
}
Block {
BlockType Fcn
Name "Fcn2"
Position [415, 200, 570, 230]
Expr "u[1]*(-u[2]+sqrt(3)*u[3])/2"
}
Block {
BlockType SubSystem
Name "Inner\nProduct"
Position [125, 246, 150, 279]
ShowPortLabels off
MaskType "Dot Product"
MaskDescription "Inner (dot) product.\ny=sum(u1.*u2)"
MaskHelp "Computes the inner (dot) product of the "
"inputs: sum(u1.*u2). The inputs are "
"vectors of the same length. Output is "
"a scalar."
MaskDisplay "disp('.\\n')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate off
MaskIconUnits autoscale
System {
Name "Inner\nProduct"
Location [33, 479, 253, 634]
Open off
ScreenColor white
Block {
BlockType Inport
Name "in_1"
Position [15, 25, 35, 45]
Port "1"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Inport
Name "in_2"
Position [15, 90, 35, 110]
Port "2"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Product
Name "Product"
Position [65, 55, 90, 75]
Inputs "2"
}
Block {
BlockType Sum
Name "Sum"
Position [125, 55, 145, 75]
Inputs "+"
}
Block {
BlockType Outport
Name "out_1"
Position [185, 55, 205, 75]
Port "1"
OutputWhenDisabled held
InitialOutput "0"
}
Line {
SrcBlock "Sum"
SrcPort 1
DstBlock "out_1"
DstPort 1
}
Line {
SrcBlock "Product"
SrcPort 1
DstBlock "Sum"
DstPort 1
}
Line {
SrcBlock "in_1"
SrcPort 1
DstBlock "Product"
DstPort 1
}
Line {
SrcBlock "in_2"
SrcPort 1
DstBlock "Product"
DstPort 2
}
}
}
Block {
BlockType SubSystem
Name "Inner\nProduct1"
Position [160, 135, 185, 170]
ShowPortLabels off
MaskType "Dot Product"
MaskDescription "Inner (dot) product.\ny=sum(u1.*u2)"
MaskHelp "Computes the inner (dot) product of the "
"inputs: sum(u1.*u2). The inputs are "
"vectors of the same length. Output is "
"a scalar."
MaskDisplay "disp('.\\n')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate off
MaskIconUnits autoscale
System {
Name "Inner\nProduct1"
Location [33, 479, 253, 634]
Open off
ScreenColor white
Block {
BlockType Inport
Name "in_1"
Position [15, 25, 35, 45]
Port "1"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Inport
Name "in_2"
Position [15, 90, 35, 110]
Port "2"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Product
Name "Product"
Position [65, 55, 90, 75]
Inputs "2"
}
Block {
BlockType Sum
Name "Sum"
Position [125, 55, 145, 75]
Inputs "+"
}
Block {
BlockType Outport
Name "out_1"
Position [185, 55, 205, 75]
Port "1"
OutputWhenDisabled held
InitialOutput "0"
}
Line {
SrcBlock "Sum"
SrcPort 1
DstBlock "out_1"
DstPort 1
}
Line {
SrcBlock "Product"
SrcPort 1
DstBlock "Sum"
DstPort 1
}
Line {
SrcBlock "in_1"
SrcPort 1
DstBlock "Product"
DstPort 1
}
Line {
SrcBlock "in_2"
SrcPort 1
DstBlock "Product"
DstPort 2
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -