📄 s1.mdl
字号:
Model {
Name "s1"
Version 2.00
SimParamPage Solver
SampleTimeColors off
WideVectorLines on
PaperOrientation landscape
StartTime "0.0"
StopTime "tstop"
Solver ode45
RelTol "5e-6"
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 "s1"
Location [61, 55, 763, 458]
Open on
ScreenColor white
Block {
BlockType Clock
Name "Clock"
Position [191, 135, 209, 150]
Orientation up
DeleteFcn "simclock BlockIsBeingDestroyed"
PostSaveFcn "simclock Save"
Location [30, 40, 140, 75]
}
Block {
BlockType SubSystem
Name "Ef"
Position [325, 284, 350, 296]
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 "Ex_time|Ex_value"
System {
Name "Ef"
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 Fcn
Name "Fcn"
Position [45, 209, 155, 231]
Expr "u[2]*cos(u[1] )"
}
Block {
BlockType Fcn
Name "Fcn1"
Position [45, 254, 160, 276]
Expr "u[2]*cos(u[1]-T2piby3)"
}
Block {
BlockType Fcn
Name "Fcn2"
Position [45, 300, 160, 320]
Expr "u[2]*cos(u[1]+T2piby3)"
}
Block {
BlockType Ground
Name "Ground"
Position [595, 209, 610, 221]
}
Block {
BlockType SubSystem
Name "m1"
Position [112, 20, 200, 55]
DropShadow on
OpenFcn "m1"
ShowPortLabels off
MaskType "Masked block of m1.m"
MaskHelp "Uses m1.m to initialize and plot"
MaskDisplay "disp('Initialize\\nand plot')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate off
MaskIconUnits autoscale
System {
Name "m1"
Location [150, 32767, 275, 32767]
Open off
ScreenColor white
Annotation {
Position [82, 47]
VerticalAlignment top
Text "Masked block of m1.m to\ninitialize and "
"print results"
}
}
}
Block {
BlockType Mux
Name "Mux"
Position [215, 65, 635, 85]
Orientation up
Inputs "9"
}
Block {
BlockType Mux
Name "Mux1"
Position [60, 98, 75, 162]
Orientation left
Inputs "2"
}
Block {
BlockType Selector
Name "Selector"
Position [345, 24, 385, 46]
Orientation left
Elements "[2 4 5 6 7 9]"
InputPortWidth "9"
}
Block {
BlockType Terminator
Name "T"
Position [655, 96, 665, 104]
}
Block {
BlockType Terminator
Name "T1"
Position [670, 115, 680, 125]
}
Block {
BlockType Terminator
Name "T2"
Position [305, 286, 315, 294]
}
Block {
BlockType SubSystem
Name "Tmech"
Position [300, 313, 330, 327]
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 "tmech_time|tmech_value"
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 SubSystem
Name "VIPQ"
Position [273, 130, 397, 165]
Orientation up
ShowPortLabels off
System {
Name "VIPQ"
Location [4, 138, 715, 526]
Open off
ScreenColor white
Block {
BlockType Inport
Name "vq"
Position [115, 100, 135, 120]
Port "1"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Inport
Name "iq_gen"
Position [115, 145, 135, 165]
Port "2"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Inport
Name "vd"
Position [115, 190, 135, 210]
Port "3"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Inport
Name "id_gen"
Position [115, 235, 135, 255]
Port "4"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Mux
Name "Mux"
Position [185, 86, 215, 269]
Inputs "4"
}
Block {
BlockType Fcn
Name "P"
Position [265, 198, 445, 222]
Expr "u[1]*u[2] + u[3]*u[4]"
}
Block {
BlockType Fcn
Name "P1"
Position [265, 88, 445, 112]
Expr "sqrt(u[1]*u[1] + u[3]*u[3])"
}
Block {
BlockType Fcn
Name "P2"
Position [265, 143, 445, 167]
Expr "sqrt(u[2]*u[2] + u[4]*u[4])"
}
Block {
BlockType Fcn
Name "Q"
Position [270, 248, 445, 272]
Expr "u[1]*u[4]-u[2]*u[3]"
}
Block {
BlockType Outport
Name "|Vt|"
Position [480, 90, 500, 110]
Port "1"
OutputWhenDisabled held
InitialOutput "0"
}
Block {
BlockType Outport
Name "|It|"
Position [480, 145, 500, 165]
Port "2"
OutputWhenDisabled held
InitialOutput "0"
}
Block {
BlockType Outport
Name "Pgen"
Position [480, 200, 500, 220]
Port "3"
OutputWhenDisabled held
InitialOutput "0"
}
Block {
BlockType Outport
Name "Qgen"
Position [480, 250, 500, 270]
Port "4"
OutputWhenDisabled held
InitialOutput "0"
}
Line {
SrcBlock "P2"
SrcPort 1
DstBlock "|It|"
DstPort 1
}
Line {
SrcBlock "P1"
SrcPort 1
DstBlock "|Vt|"
DstPort 1
}
Line {
SrcBlock "Mux"
SrcPort 1
Points [0, 0]
Branch {
Points [20, 0; 0, -25]
DstBlock "P2"
DstPort 1
}
Branch {
Points [20, 0; 0, -80]
DstBlock "P1"
DstPort 1
}
Branch {
Points [20, 0; 0, 80]
DstBlock "Q"
DstPort 1
}
Branch {
Points [20, 0; 0, 30]
DstBlock "P"
DstPort 1
}
}
Line {
SrcBlock "Q"
SrcPort 1
DstBlock "Qgen"
DstPort 1
}
Line {
SrcBlock "P"
SrcPort 1
DstBlock "Pgen"
DstPort 1
}
Line {
SrcBlock "id_gen"
SrcPort 1
DstBlock "Mux"
DstPort 4
}
Line {
SrcBlock "vd"
SrcPort 1
DstBlock "Mux"
DstPort 3
}
Line {
SrcBlock "iq_gen"
SrcPort 1
DstBlock "Mux"
DstPort 2
}
Line {
SrcBlock "vq"
SrcPort 1
DstBlock "Mux"
DstPort 1
}
}
}
Block {
BlockType SubSystem
Name "Vm"
Position [95, 136, 125, 154]
Orientation left
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 "Vm_time|Vm_value"
System {
Name "Vm"
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"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -