s1b.mdl
来自「simulink electrical machine.」· MDL 代码 · 共 528 行
MDL
528 行
Model {
Name "s1b"
Version 2.00
SimParamPage Solver
SampleTimeColors off
WideVectorLines off
PaperOrientation landscape
StartTime "0.0"
StopTime "tstop"
Solver ode45
RelTol "1e-5"
AbsTol "1e-5"
Refine "1"
MaxStep "1e-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 "s1b"
Location [7, 49, 792, 539]
Open on
ScreenColor white
Block {
BlockType Inport
Name "In_v1"
Position [35, 175, 55, 195]
Port "1"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Inport
Name "In_v2'"
Position [35, 355, 55, 375]
Port "2"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Clock
Name "Clock"
Position [35, 80, 55, 100]
DeleteFcn "simclock BlockIsBeingDestroyed"
PostSaveFcn "simclock Save"
Location [30, 40, 140, 75]
}
Block {
BlockType DeadZone
Name "Dead Zone"
Position [575, 300, 625, 330]
Orientation left
LowerValue "-154"
UpperValue "154"
}
Block {
BlockType Fcn
Name "Fcn"
Position [145, 170, 310, 200]
Expr "wb*(u[2]-(r1/xl1)*(u[3]-u[1]))"
}
Block {
BlockType Fcn
Name "Fcn2"
Position [145, 349, 330, 381]
Expr "wb*(u[2] -(rp2/xpl2)*(u[1]-u[3]))"
}
Block {
BlockType Fcn
Name "Fcn3"
Position [455, 244, 640, 276]
Expr "xM*(u[1]/xl1+u[2]/xpl2-u[3]/xm)"
}
Block {
BlockType Fcn
Name "Fcn4"
Position [485, 161, 575, 189]
Expr "(u[1]-u[2])/xl1"
}
Block {
BlockType Fcn
Name "Fcn5"
Position [480, 364, 575, 396]
Expr "(u[1]-u[2])/xpl2"
}
Block {
BlockType Memory
Name "Memory"
Position [465, 303, 490, 327]
Orientation left
X0 "0"
InheritSampleTime off
}
Block {
BlockType Mux
Name "Mux"
Position [110, 143, 130, 227]
Inputs "3"
}
Block {
BlockType Mux
Name "Mux1"
Position [105, 327, 125, 403]
Inputs "3"
}
Block {
BlockType Mux
Name "Mux2"
Position [430, 351, 450, 404]
Inputs "2"
}
Block {
BlockType Mux
Name "Mux3"
Position [420, 228, 435, 292]
Inputs "3"
}
Block {
BlockType Mux
Name "Mux4"
Position [440, 149, 460, 196]
Inputs "2"
}
Block {
BlockType Mux
Name "Mux5"
Position [85, 55, 695, 75]
Orientation up
Inputs "6"
}
Block {
BlockType Scope
Name "Scope"
Position [500, 17, 520, 43]
Floating off
Location [51, 169, 703, 387]
Open off
Grid on
TickLabels on
ZoomMode on
TimeRange "0.2"
YMin "-300"
YMax "300"
SaveToWorkspace off
SaveName "ScopeData"
LimitMaxRows off
MaxRows "5000"
Decimation "1"
SampleInput off
SampleTime "0"
}
Block {
BlockType Gain
Name "Slope"
Position [510, 300, 550, 330]
Orientation left
Gain "150*3.9502e-5"
}
Block {
BlockType ToWorkspace
Name "To Workspace"
Position [250, 22, 300, 38]
Orientation left
VariableName "y"
Buffer "80000"
Decimation "1"
SampleTime "0"
}
Block {
BlockType Integrator
Name "psi1_"
Position [325, 172, 355, 198]
ExternalReset none
InitialConditionSource internal
InitialCondition "Psi1o"
LimitOutput off
UpperSaturationLimit "inf"
LowerSaturationLimit "-inf"
ShowSaturationPort off
ShowStatePort off
AbsoluteTolerance "auto"
}
Block {
BlockType Integrator
Name "psi2'_"
Position [345, 352, 375, 378]
ExternalReset none
InitialConditionSource internal
InitialCondition "Psip2o"
LimitOutput off
UpperSaturationLimit "inf"
LowerSaturationLimit "-inf"
ShowSaturationPort off
ShowStatePort off
AbsoluteTolerance "auto"
}
Block {
BlockType Outport
Name "Out_psi1"
Position [730, 105, 750, 125]
Port "1"
OutputWhenDisabled held
InitialOutput "0"
}
Block {
BlockType Outport
Name "Out_psim"
Position [740, 250, 760, 270]
Port "2"
OutputWhenDisabled held
InitialOutput "0"
}
Block {
BlockType Outport
Name "Out_i1"
Position [655, 165, 675, 185]
Port "3"
OutputWhenDisabled held
InitialOutput "0"
}
Block {
BlockType Outport
Name "Out_i2'"
Position [635, 370, 655, 390]
Port "4"
OutputWhenDisabled held
InitialOutput "0"
}
Line {
SrcBlock "Mux"
SrcPort 1
DstBlock "Fcn"
DstPort 1
}
Line {
SrcBlock "Fcn"
SrcPort 1
DstBlock "psi1_"
DstPort 1
}
Line {
SrcBlock "Fcn2"
SrcPort 1
DstBlock "psi2'_"
DstPort 1
}
Line {
SrcBlock "Mux3"
SrcPort 1
DstBlock "Fcn3"
DstPort 1
}
Line {
SrcBlock "Mux4"
SrcPort 1
DstBlock "Fcn4"
DstPort 1
}
Line {
SrcBlock "psi1_"
SrcPort 1
Points [0, 0]
Branch {
Points [35, 0; 0, 55]
DstBlock "Mux3"
DstPort 1
}
Branch {
Points [35, 0; 0, -25]
DstBlock "Mux4"
DstPort 1
}
Branch {
Points [35, 0; 0, -70]
DstBlock "Out_psi1"
DstPort 1
}
Branch {
Points [35, 0; 0, 55; -305, 0; 0, -25]
DstBlock "Mux"
DstPort 3
}
}
Line {
SrcBlock "Fcn3"
SrcPort 1
Points [0, 0]
Branch {
Points [40, 0; 0, -45; -270, 0; 0, -30]
DstBlock "Mux4"
DstPort 2
}
Branch {
Points [40, 0; 0, 165; -600, 0; 0, -35]
DstBlock "Mux1"
DstPort 3
}
Branch {
Points [40, 0; 0, -135; -595, 0; 0, 30]
DstBlock "Mux"
DstPort 1
}
Branch {
DstBlock "Out_psim"
DstPort 1
}
Branch {
Points [40, 0; 0, 165; -285, 0; 0, -35]
DstBlock "Mux2"
DstPort 2
}
Branch {
Points [40, 0; 0, -155; -245, 0]
DstBlock "Mux5"
DstPort 4
}
Branch {
Points [5, 0; 0, 55]
DstBlock "Dead Zone"
DstPort 1
}
}
Line {
SrcBlock "Mux1"
SrcPort 1
DstBlock "Fcn2"
DstPort 1
}
Line {
SrcBlock "psi2'_"
SrcPort 1
Points [0, 0]
Branch {
Points [15, 0; 0, -50; -305, 0]
DstBlock "Mux1"
DstPort 1
}
Branch {
Points [15, 0; 0, -105]
DstBlock "Mux3"
DstPort 2
}
Branch {
DstBlock "Mux2"
DstPort 1
}
}
Line {
SrcBlock "Mux2"
SrcPort 1
DstBlock "Fcn5"
DstPort 1
}
Line {
SrcBlock "In_v2'"
SrcPort 1
Points [0, 0]
Branch {
DstBlock "Mux1"
DstPort 2
}
Branch {
Points [20, 0; 0, -250; 260, 0]
DstBlock "Mux5"
DstPort 3
}
}
Line {
SrcBlock "In_v1"
SrcPort 1
Points [0, 0]
Branch {
DstBlock "Mux"
DstPort 2
}
Branch {
Points [10, 0; 0, -80; 170, 0]
DstBlock "Mux5"
DstPort 2
}
}
Line {
SrcBlock "Clock"
SrcPort 1
DstBlock "Mux5"
DstPort 1
}
Line {
SrcBlock "Fcn4"
SrcPort 1
Points [0, 0]
Branch {
DstBlock "Out_i1"
DstPort 1
}
Branch {
Points [40, 0; 0, -80; -80, 0]
DstBlock "Mux5"
DstPort 5
}
}
Line {
SrcBlock "Fcn5"
SrcPort 1
Points [0, 0]
Branch {
DstBlock "Out_i2'"
DstPort 1
}
Branch {
Points [25, 0; 0, -25; 95, 0; 0, -260; -60, 0]
DstBlock "Mux5"
DstPort 6
}
}
Line {
SrcBlock "Mux5"
SrcPort 1
Points [0, 0]
Branch {
Points [0, -20]
DstBlock "Scope"
DstPort 1
}
Branch {
Points [0, -20]
DstBlock "To Workspace"
DstPort 1
}
}
Line {
SrcBlock "Dead Zone"
SrcPort 1
DstBlock "Slope"
DstPort 1
}
Line {
SrcBlock "Slope"
SrcPort 1
DstBlock "Memory"
DstPort 1
}
Line {
SrcBlock "Memory"
SrcPort 1
Points [-60, 0; 0, -35]
DstBlock "Mux3"
DstPort 3
}
Annotation {
Position [592, 162]
VerticalAlignment top
Text "i1"
}
Annotation {
Position [372, 167]
VerticalAlignment top
Text "psi1"
}
Annotation {
Position [432, 319]
VerticalAlignment top
Text "Dpsi"
}
Annotation {
Position [377, 338]
VerticalAlignment top
Text "psi2'"
}
Annotation {
Position [592, 369]
VerticalAlignment top
Text "i2'"
}
Annotation {
Position [662, 242]
VerticalAlignment top
Text "psim"
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?