📄 s4.mdl
字号:
Model {
Name "s4"
Version 2.00
SimParamPage Solver
SampleTimeColors off
WideVectorLines off
PaperOrientation landscape
StartTime "0.0"
StopTime "tstop"
Solver ode15s
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 "s4"
Location [73, 63, 735, 437]
Open on
ScreenColor white
Block {
BlockType Clock
Name "Clock"
Position [175, 85, 195, 105]
DeleteFcn "simclock BlockIsBeingDestroyed"
PostSaveFcn "simclock Save"
Location [30, 40, 140, 75]
}
Block {
BlockType Ground
Name "Grd"
Position [510, 259, 520, 271]
}
Block {
BlockType Constant
Name "Ipm"
Position [240, 241, 265, 259]
Value "Ipm"
}
Block {
BlockType SubSystem
Name "m4"
Position [70, 53, 159, 95]
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 [200, 32767, 260, 32767]
Open off
ScreenColor white
Annotation {
Position [12, 52]
VerticalAlignment top
Text "Masked block of m4.m to\ninitialize s4.m "
"and plot results"
}
}
}
Block {
BlockType Mux
Name "Mux"
Position [223, 60, 537, 80]
Orientation up
Inputs "9"
}
Block {
BlockType Selector
Name "Selector"
Position [415, 22, 460, 48]
Elements "[3 4 5 6 7 8]"
InputPortWidth "9"
}
Block {
BlockType Terminator
Name "T"
Position [605, 196, 610, 204]
}
Block {
BlockType Terminator
Name "T1"
Position [605, 226, 610, 234]
}
Block {
BlockType Terminator
Name "T2"
Position [380, 261, 385, 269]
}
Block {
BlockType Terminator
Name "T3"
Position [225, 246, 230, 254]
}
Block {
BlockType Terminator
Name "T4"
Position [260, 96, 265, 104]
Orientation left
}
Block {
BlockType Terminator
Name "T5"
Position [230, 106, 235, 114]
Orientation left
}
Block {
BlockType SubSystem
Name "Tmech"
Position [210, 270, 235, 290]
ShowPortLabels off
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 "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 SubSystem
Name "VIPQ"
Position [251, 120, 354, 140]
Orientation up
ShowPortLabels off
System {
Name "VIPQ"
Location [67, 95, 778, 483]
Open off
ScreenColor white
Block {
BlockType Inport
Name "vq"
Position [115, 110, 135, 130]
Port "1"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Inport
Name "iq"
Position [115, 155, 135, 175]
Port "2"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Inport
Name "vd"
Position [115, 200, 135, 220]
Port "3"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Inport
Name "id"
Position [115, 245, 135, 265]
Port "4"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Mux
Name "Mux"
Position [185, 96, 215, 279]
Inputs "4"
}
Block {
BlockType Fcn
Name "Pmotor"
Position [265, 150, 440, 180]
Expr "u[1]*u[2] + u[3]*u[4]"
}
Block {
BlockType Fcn
Name "Qmotor"
Position [270, 201, 440, 229]
Expr "u[1]*u[4]-u[2]*u[3]"
}
Block {
BlockType Fcn
Name "Texcitation"
Position [270, 295, 435, 325]
Expr "u[2]*Ipm*xmd"
}
Block {
BlockType Fcn
Name "Treluctance "
Position [270, 244, 440, 276]
Expr "u[2]*u[4]*(xd-xq)"
}
Block {
BlockType Fcn
Name "terminal current mag"
Position [265, 97, 440, 123]
Expr "sqrt(u[2]*u[2] + u[4]*u[4])"
}
Block {
BlockType Fcn
Name "terminal voltage mag"
Position [270, 47, 440, 73]
Expr "sqrt(u[1]*u[1] + u[3]*u[3])"
}
Block {
BlockType Outport
Name "|Vt|"
Position [480, 50, 500, 70]
Port "1"
OutputWhenDisabled held
InitialOutput "0"
}
Block {
BlockType Outport
Name "|It|"
Position [480, 100, 500, 120]
Port "2"
OutputWhenDisabled held
InitialOutput "0"
}
Block {
BlockType Outport
Name "Pm"
Position [480, 155, 500, 175]
Port "3"
OutputWhenDisabled held
InitialOutput "0"
}
Block {
BlockType Outport
Name "Qm"
Position [480, 205, 500, 225]
Port "4"
OutputWhenDisabled held
InitialOutput "0"
}
Block {
BlockType Outport
Name "Trel"
Position [480, 250, 500, 270]
Port "5"
OutputWhenDisabled held
InitialOutput "0"
}
Block {
BlockType Outport
Name "Texc"
Position [480, 300, 500, 320]
Port "6"
OutputWhenDisabled held
InitialOutput "0"
}
Line {
SrcBlock "vq"
SrcPort 1
DstBlock "Mux"
DstPort 1
}
Line {
SrcBlock "iq"
SrcPort 1
DstBlock "Mux"
DstPort 2
}
Line {
SrcBlock "vd"
SrcPort 1
DstBlock "Mux"
DstPort 3
}
Line {
SrcBlock "id"
SrcPort 1
DstBlock "Mux"
DstPort 4
}
Line {
SrcBlock "Pmotor"
SrcPort 1
DstBlock "Pm"
DstPort 1
}
Line {
SrcBlock "Qmotor"
SrcPort 1
DstBlock "Qm"
DstPort 1
}
Line {
SrcBlock "Mux"
SrcPort 1
Points [0, 0]
Branch {
Points [20, 0; 0, -25]
DstBlock "Pmotor"
DstPort 1
}
Branch {
Points [20, 0; 0, 25]
DstBlock "Qmotor"
DstPort 1
}
Branch {
Points [20, 0; 0, -130]
DstBlock "terminal voltage mag"
DstPort 1
}
Branch {
Points [20, 0; 0, -80]
DstBlock "terminal current mag"
DstPort 1
}
Branch {
Points [20, 0; 0, 70]
DstBlock "Treluctance "
DstPort 1
}
Branch {
Points [20, 0; 0, 120]
DstBlock "Texcitation"
DstPort 1
}
}
Line {
SrcBlock "terminal voltage mag"
SrcPort 1
DstBlock "|Vt|"
DstPort 1
}
Line {
SrcBlock "terminal current mag"
SrcPort 1
DstBlock "|It|"
DstPort 1
}
Line {
SrcBlock "Treluctance "
SrcPort 1
DstBlock "Trel"
DstPort 1
}
Line {
SrcBlock "Texcitation"
SrcPort 1
DstBlock "Texc"
DstPort 1
}
}
}
Block {
BlockType ToWorkspace
Name "Workspace"
Position [290, 25, 310, 45]
Orientation left
VariableName "y"
Buffer "100000"
Decimation "1"
SampleTime "0"
}
Block {
BlockType SubSystem
Name "abc2qd0"
Position [160, 172, 200, 268]
ShowPortLabels off
System {
Name "abc2qd0"
Location [23, 152, 694, 530]
Open off
ScreenColor white
Block {
BlockType Inport
Name "va"
Position [40, 140, 60, 160]
Port "1"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Inport
Name "vb"
Position [40, 175, 60, 195]
Port "2"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Inport
Name "vc"
Position [40, 210, 60, 230]
Port "3"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Inport
Name "cos_thetar"
Position [40, 60, 60, 80]
Port "4"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Inport
Name "sin_thetar"
Position [40, 95, 60, 115]
Port "5"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Mux
Name "Mux"
Position [90, 129, 115, 241]
Inputs "3"
}
Block {
BlockType Mux
Name "Mux1"
Position [375, 56, 400, 189]
Inputs "4"
}
Block {
BlockType Fcn
Name "abc20"
Position [150, 224, 290, 246]
Expr "(u[1] + u[2] + u[3])/3"
}
Block {
BlockType Fcn
Name "abc2d"
Position [150, 174, 290, 196]
Expr "(u[3] -u[2])/sqrt(3)"
}
Block {
BlockType Fcn
Name "abc2q"
Position [150, 129, 290, 151]
Expr "(2*u[1]- u[2] - u[3])/3"
}
Block {
BlockType Fcn
Name "qds2dr"
Position [425, 143, 560, 167]
Expr "u[2]*u[3] + u[1]*u[4] "
}
Block {
BlockType Fcn
Name "qds2qr"
Position [425, 68, 560, 92]
Expr "u[1]*u[3] - u[2]*u[4]"
}
Block {
BlockType Outport
Name "vqr"
Position [595, 70, 615, 90]
Port "1"
OutputWhenDisabled held
InitialOutput "0"
}
Block {
BlockType Outport
Name "vdr"
Position [590, 145, 610, 165]
Port "2"
OutputWhenDisabled held
InitialOutput "0"
}
Block {
BlockType Outport
Name "vd0"
Position [590, 225, 610, 245]
Port "3"
OutputWhenDisabled held
InitialOutput "0"
}
Line {
SrcBlock "Mux"
SrcPort 1
Points [0, 0]
Branch {
Points [5, 0; 0, -45]
DstBlock "abc2q"
DstPort 1
}
Branch {
DstBlock "abc2d"
DstPort 1
}
Branch {
Points [5, 0; 0, 50]
DstBlock "abc20"
DstPort 1
}
}
Line {
SrcBlock "Mux1"
SrcPort 1
Points [0, 0]
Branch {
Points [0, -45]
DstBlock "qds2qr"
DstPort 1
}
Branch {
Points [0, 30]
DstBlock "qds2dr"
DstPort 1
}
}
Line {
SrcBlock "va"
SrcPort 1
DstBlock "Mux"
DstPort 1
}
Line {
SrcBlock "vb"
SrcPort 1
DstBlock "Mux"
DstPort 2
}
Line {
SrcBlock "vc"
SrcPort 1
DstBlock "Mux"
DstPort 3
}
Line {
SrcBlock "qds2qr"
SrcPort 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -