📄 s2.mdl
字号:
Model {
Name "s2"
Version 2.00
SimParamPage Solver
SampleTimeColors off
WideVectorLines off
PaperOrientation landscape
StartTime "0.0"
StopTime "tstop"
Solver ode15s
RelTol "1e-5"
AbsTol "1e-5"
Refine "1"
MaxStep "0.0010"
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 "s2"
Location [78, 47, 687, 392]
Open on
ScreenColor white
Block {
BlockType SubSystem
Name "CB on/off\nsignal"
Position [110, 198, 140, 222]
ShowPortLabels off
MaskType "Repeating table"
MaskDescription "Repeating table.\nEnter values of time and "
"output for first cycle."
MaskHelp "Repeats cycle given in table. Time values "
"should be monotonically increasing."
MaskPromptString "Time values:|Output values:"
MaskStyleString "edit,edit"
MaskInitialization "period = max(@1); t = @1; y = @2;"
MaskDisplay "plot([t,t+period,t+2*period],[y,y,y])"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate off
MaskIconUnits autoscale
MaskValueString "[0 10*Te 10*Te 1.1*tstop ]|[1 1 0 0 ]"
System {
Name "CB on/off\nsignal"
Location [5, 40, 315, 196]
Open off
ScreenColor white
Block {
BlockType Clock
Name "Clock"
Position [45, 60, 65, 80]
DeleteFcn "simclock BlockIsBeingDestroyed"
PostSaveFcn "simclock Save"
Location [30, 40, 140, 75]
}
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 "t"
OutputValues "y"
}
Block {
BlockType Outport
Name "out_1"
Position [285, 60, 305, 80]
Port "1"
OutputWhenDisabled held
InitialOutput "0"
}
Line {
SrcBlock "Look-Up Table"
SrcPort 1
DstBlock "out_1"
DstPort 1
}
Line {
SrcBlock "Clock"
SrcPort 1
DstBlock "Fcn1"
DstPort 1
}
Line {
SrcBlock "Fcn1"
SrcPort 1
DstBlock "Look-Up Table"
DstPort 1
}
}
}
Block {
BlockType Clock
Name "Clock"
Position [125, 110, 145, 130]
DeleteFcn "simclock BlockIsBeingDestroyed"
PostSaveFcn "simclock Save"
Location [30, 40, 140, 75]
}
Block {
BlockType SubSystem
Name "m2"
Position [85, 43, 138, 69]
DropShadow on
OpenFcn "m2"
ShowPortLabels off
MaskType "Masked block of m2.m"
MaskHelp "Uses m2.m to initialize and plot"
MaskDisplay "disp('Initialize\\nand plot')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate off
MaskIconUnits autoscale
System {
Name "m2"
Location [-10, 32767, 201, 32767]
Open off
ScreenColor white
Annotation {
Position [127, 52]
VerticalAlignment top
Text "Masked block of m2.m to initalize s2.m "
"\nand plot results"
}
}
}
Block {
BlockType Mux
Name "Mux2"
Position [125, 85, 515, 100]
Orientation up
Inputs "7"
}
Block {
BlockType SubSystem
Name "RL load"
Position [415, 145, 445, 195]
ShowPortLabels off
System {
Name "RL load"
Location [144, 152, 583, 372]
Open off
ScreenColor white
Block {
BlockType Inport
Name "vR"
Position [35, 65, 55, 85]
Port "1"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Sum
Name "Sum"
Position [105, 62, 120, 113]
Inputs "+-"
}
Block {
BlockType Gain
Name "gain"
Position [170, 126, 230, 164]
Orientation left
Gain "RL"
}
Block {
BlockType Gain
Name "gain1"
Position [150, 68, 205, 112]
Gain "1/LL"
}
Block {
BlockType Integrator
Name "int"
Position [230, 70, 270, 110]
ExternalReset none
InitialConditionSource internal
InitialCondition "0"
LimitOutput off
UpperSaturationLimit "inf"
LowerSaturationLimit "-inf"
ShowSaturationPort off
ShowStatePort off
AbsoluteTolerance "auto"
}
Block {
BlockType Outport
Name "iR"
Position [320, 80, 340, 100]
Port "1"
OutputWhenDisabled held
InitialOutput "0"
}
Line {
SrcBlock "gain"
SrcPort 1
Points [-85, 0; 0, -45]
DstBlock "Sum"
DstPort 2
}
Line {
SrcBlock "int"
SrcPort 1
Points [0, 0]
Branch {
Points [10, 0; 0, 55]
DstBlock "gain"
DstPort 1
}
Branch {
DstBlock "iR"
DstPort 1
}
}
Line {
SrcBlock "vR"
SrcPort 1
DstBlock "Sum"
DstPort 1
}
Line {
SrcBlock "Sum"
SrcPort 1
DstBlock "gain1"
DstPort 1
}
Line {
SrcBlock "gain1"
SrcPort 1
DstBlock "int"
DstPort 1
}
}
}
Block {
BlockType Scope
Name "Scope"
Position [195, 43, 215, 67]
Orientation left
Floating off
Location [82, 329, 686, 568]
Open on
Grid on
TickLabels on
ZoomMode on
TimeRange "0.25"
YMin "-750000"
YMax "750000"
SaveToWorkspace off
SaveName "ScopeData"
LimitMaxRows off
MaxRows "12000"
Decimation "1"
SampleInput off
SampleTime "0"
}
Block {
BlockType Selector
Name "Selector"
Position [235, 44, 285, 66]
Orientation left
NamePlacement alternate
Elements "[2 3 4 5 6 7]"
InputPortWidth "7"
}
Block {
BlockType ToWorkspace
Name "To Workspace"
Position [370, 47, 420, 63]
VariableName "y"
Buffer "25000"
Decimation "2"
SampleTime "0"
}
Block {
BlockType SubSystem
Name "breaker"
Position [195, 154, 225, 206]
ShowPortLabels off
System {
Name "breaker"
Location [16, 53, 724, 559]
Open off
ScreenColor white
Block {
BlockType Inport
Name "e"
Position [20, 16, 40, 34]
Port "1"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Inport
Name "CB on/off\nsignal"
Position [25, 335, 45, 355]
Port "2"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Inport
Name "vS"
Position [20, 55, 40, 75]
Port "3"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType SubSystem
Name "D Latch"
Position [350, 256, 380, 294]
ShowPortLabels on
System {
Name "D Latch"
Location [516, 424, 730, 599]
Open off
ScreenColor white
Block {
BlockType Inport
Name "D"
Position [25, 83, 55, 97]
Port "1"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Inport
Name "C"
Position [80, 15, 110, 30]
Orientation down
Port "2"
PortWidth "-1"
SampleTime "-1"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate off
MaskIconUnits autoscale
}
Block {
BlockType SubSystem
Name "D Latch"
Position [75, 51, 115, 124]
ShowPortLabels on
System {
Name "D Latch"
Location [756, 470, 1027, 609]
Open off
ScreenColor white
Block {
BlockType Inport
Name "D"
Position [25, 55, 45, 75]
Port "1"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType EnablePort
Name "C"
Position [15, 15, 35, 35]
StatesWhenEnabling held
ShowOutputPort off
}
Block {
BlockType Logic
Name "Logic"
Position [135, 93, 165, 117]
Operator NOT
Inputs "1"
}
Block {
BlockType Outport
Name "Q"
Position [205, 55, 225, 75]
Port "1"
OutputWhenDisabled held
InitialOutput "0"
}
Block {
BlockType Outport
Name "!Q"
Position [205, 95, 225, 115]
Port "2"
OutputWhenDisabled held
InitialOutput "1"
}
Line {
SrcBlock "Logic"
SrcPort 1
DstBlock "!Q"
DstPort 1
}
Line {
SrcBlock "D"
SrcPort 1
Points [50, 0]
Branch {
DstBlock "Q"
DstPort 1
}
Branch {
Points [0, 40]
DstBlock "Logic"
DstPort 1
}
}
}
}
Block {
BlockType Outport
Name "Q"
Position [140, 63, 170, 77]
Port "1"
OutputWhenDisabled held
InitialOutput "0"
}
Block {
BlockType Outport
Name "!Q"
Position [140, 98, 170, 112]
Port "2"
OutputWhenDisabled held
InitialOutput "1"
}
Line {
SrcBlock "C"
SrcPort 1
DstBlock "D Latch"
DstPort enable
}
Line {
SrcBlock "D Latch"
SrcPort 1
DstBlock "Q"
DstPort 1
}
Line {
SrcBlock "D"
SrcPort 1
DstBlock "D Latch"
DstPort 1
}
Line {
SrcBlock "D Latch"
SrcPort 2
DstBlock "!Q"
DstPort 1
}
}
}
Block {
BlockType SubSystem
Name "D Latch1"
Position [255, 446, 285, 484]
Orientation left
ShowPortLabels on
System {
Name "D Latch1"
Location [516, 424, 730, 599]
Open off
ScreenColor white
Block {
BlockType Inport
Name "D"
Position [25, 83, 55, 97]
Port "1"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Inport
Name "C"
Position [80, 15, 110, 30]
Orientation down
Port "2"
PortWidth "-1"
SampleTime "-1"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate off
MaskIconUnits autoscale
}
Block {
BlockType SubSystem
Name "D Latch"
Position [75, 51, 115, 124]
ShowPortLabels on
System {
Name "D Latch"
Location [756, 470, 1027, 609]
Open off
ScreenColor white
Block {
BlockType Inport
Name "D"
Position [25, 55, 45, 75]
Port "1"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType EnablePort
Name "C"
Position [15, 15, 35, 35]
StatesWhenEnabling held
ShowOutputPort off
}
Block {
BlockType Logic
Name "Logic"
Position [135, 93, 165, 117]
Operator NOT
Inputs "1"
}
Block {
BlockType Outport
Name "Q"
Position [205, 55, 225, 75]
Port "1"
OutputWhenDisabled held
InitialOutput "0"
}
Block {
BlockType Outport
Name "!Q"
Position [205, 95, 225, 115]
Port "2"
OutputWhenDisabled held
InitialOutput "1"
}
Line {
SrcBlock "Logic"
SrcPort 1
DstBlock "!Q"
DstPort 1
}
Line {
SrcBlock "D"
SrcPort 1
Points [50, 0]
Branch {
DstBlock "Q"
DstPort 1
}
Branch {
Points [0, 40]
DstBlock "Logic"
DstPort 1
}
}
}
}
Block {
BlockType Outport
Name "Q"
Position [140, 63, 170, 77]
Port "1"
OutputWhenDisabled held
InitialOutput "0"
}
Block {
BlockType Outport
Name "!Q"
Position [140, 98, 170, 112]
Port "2"
OutputWhenDisabled held
InitialOutput "1"
}
Line {
SrcBlock "C"
SrcPort 1
DstBlock "D Latch"
DstPort enable
}
Line {
SrcBlock "D Latch"
SrcPort 1
DstBlock "Q"
DstPort 1
}
Line {
SrcBlock "D"
SrcPort 1
DstBlock "D Latch"
DstPort 1
}
Line {
SrcBlock "D Latch"
SrcPort 2
DstBlock "!Q"
DstPort 1
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -