📄 s4.mdl
字号:
Model {
Name "s4"
Version 2.00
SimParamPage Solver
SampleTimeColors off
WideVectorLines on
PaperOrientation landscape
StartTime "0.0"
StopTime "tstop"
Solver ode45
RelTol "1e-5"
AbsTol "1e-6"
Refine "1"
MaxStep "5e-3"
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
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 "s4"
Location [52, 45, 707, 439]
Open on
ScreenColor white
Block {
BlockType Gain
Name "1/L"
Position [410, 236, 450, 274]
Gain "1/L"
}
Block {
BlockType Clock
Name "Clock"
Position [125, 86, 145, 104]
DeleteFcn "simclock BlockIsBeingDestroyed"
PostSaveFcn "simclock Save"
Location [30, 40, 140, 75]
}
Block {
BlockType SubSystem
Name "m4"
Position [34, 29, 105, 71]
DropShadow on
OpenFcn "m4"
ShowPortLabels off
MaskType "Masked block of m4.m"
MaskHelp "Uses m4.m to initialize and plot"
MaskDisplay "disp('Initialize\\nand plot')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate off
MaskIconUnits autoscale
System {
Name "m4"
Location [165, 32767, 225, 32767]
Open off
ScreenColor white
Annotation {
Position [12, 22]
VerticalAlignment top
Text "Masked block of m4.m to initialize \nand "
"plot results"
}
}
}
Block {
BlockType Fcn
Name "Fcn1"
Position [105, 238, 190, 262]
Expr "sin(u[1]*u[2])"
}
Block {
BlockType Gain
Name "Gain"
Position [515, 287, 555, 323]
Orientation left
Gain "1/C"
}
Block {
BlockType SubSystem
Name "Inner\nProduct"
Position [265, 243, 280, 267]
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 Fcn
Name "Load power"
Position [455, 139, 545, 161]
Orientation left
Expr "u[1]*u[1]*R"
}
Block {
BlockType Mux
Name "Mux"
Position [168, 55, 552, 70]
Orientation up
Inputs "5"
}
Block {
BlockType Mux
Name "Mux1"
Position [55, 231, 85, 264]
Inputs "2"
}
Block {
BlockType SubSystem
Name "Pref"
Position [220, 191, 255, 209]
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 "Pref_time|Pref_value"
System {
Name "Pref"
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 Gain
Name "R"
Position [435, 194, 465, 226]
Orientation left
Gain "R"
}
Block {
BlockType Scope
Name "Scope"
Position [275, 15, 290, 35]
Orientation left
Floating off
Location [35, 331, 730, 570]
Open on
Grid on
TickLabels on
ZoomMode on
TimeRange "auto"
YMin "-600"
YMax "600"
SaveToWorkspace off
SaveName "ScopeData"
LimitMaxRows on
MaxRows "5000"
Decimation "1"
SampleInput off
SampleTime "0"
}
Block {
BlockType SubSystem
Name "Sign"
Position [205, 236, 235, 264]
ShowPortLabels off
MaskType "Sign"
MaskDescription "y = sign(x)"
MaskHelp "Sign Function:\\n\\t\\t\\ty = 1 if x > 0\\n\\t\\t"
"\\ty = 0 if x = 0\\n\\t\\t\\ty = -1 if x < 0"
MaskDisplay "plot(-50,-50,50,50,[-50,50],[0,0],[0,0],[-50,50]"
",[-40,0],[-30,-30],[0,40],[30,30])"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate off
MaskIconUnits autoscale
System {
Name "Sign"
Location [159, 417, 467, 586]
Open off
ScreenColor white
Block {
BlockType Inport
Name "in_1"
Position [35, 30, 55, 50]
Port "1"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Constant
Name "Constant"
Position [65, 105, 85, 125]
Value "0"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -