📄 shower.mdl
字号:
# $Revision: 1.6 $
Model {
Name "shower"
Version 2.20
SimParamPage Solver
SampleTimeColors off
InvariantConstants off
WideVectorLines off
ShowLineWidths off
StartTime "0"
StopTime "10000"
Solver ode45
RelTol "1e-3"
AbsTol "1e-3"
Refine "1"
MaxStep "0.1"
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
SimulationMode normal
RTWSystemTargetFile "grt.tlc"
RTWInlineParameters off
RTWPlaceOutputsASAP off
RTWRetainRTWFile off
RTWTemplateMakefile "grt_vc.tmf"
RTWMakeCommand "make_rtw"
RTWGenerateCodeOnly off
ExtModeMexFile "ext_comm"
ExtModeBatchMode off
PreLoadFcn "fisMatrix=readfis('shower'); k=1;"
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
}
LineDefaults {
FontName "Helvetica"
FontSize 9
FontWeight normal
FontAngle normal
}
System {
Name "shower"
Location [103, 76, 629, 493]
Open on
ToolBar on
StatusBar on
ScreenColor white
PaperOrientation landscape
PaperPositionMode auto
PaperType usletter
PaperUnits inches
Block {
BlockType Demux
Name "Demux"
Ports [1, 2, 0, 0, 0]
Position [75, 266, 115, 299]
Orientation left
Outputs "2"
}
Block {
BlockType "S-Function"
Name "Fuzzy Logic Controller"
Ports [1, 1, 0, 0, 0]
Position [155, 259, 210, 311]
Orientation left
FunctionName "sffis"
Parameters "fismatrix"
PortCounts "[]"
SFunctionModules "sfsup"
MaskType "FIS"
MaskDescription "FIS"
MaskHelp "Fuzzy Inference System"
MaskPromptString "FIS Matrix:"
MaskStyleString "edit"
MaskTunableValueString "on"
MaskInitialization "fismatrix = @1;"
MaskDisplay "plot(0, -0.3, 6, -0.3, 0, 1.2, 6, 1.2, [0 6], ["
"0 0], [1 2 3],[0 1 0],[2 3 4],[0 1 0],[3 4 5],[0 1 0])"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate none
MaskIconUnits autoscale
MaskValueString "fisMatrix"
}
Block {
BlockType Mux
Name "Mux2"
Ports [4, 1, 0, 0, 0]
Position [140, 133, 170, 167]
Inputs "4"
}
Block {
BlockType Mux
Name "Mux3"
Ports [2, 1, 0, 0, 0]
Position [255, 265, 285, 300]
Orientation left
Inputs "2"
}
Block {
BlockType Mux
Name "Mux4"
Ports [2, 1, 0, 0, 0]
Position [310, 200, 340, 235]
Orientation left
Inputs "2"
}
Block {
BlockType Mux
Name "Mux5"
Ports [2, 1, 0, 0, 0]
Position [325, 55, 355, 90]
Orientation left
Inputs "2"
}
Block {
BlockType ToWorkspace
Name "To Workspace"
Position [255, 322, 295, 348]
VariableName "in"
Buffer "1000"
Decimation "1"
SampleTime "0"
}
Block {
BlockType ToWorkspace
Name "To Workspace1"
Position [75, 322, 115, 348]
Orientation left
VariableName "out"
Buffer "1000"
Decimation "1"
SampleTime "0"
}
Block {
BlockType SubSystem
Name "cold water\nvalve"
Ports [1, 2, 0, 0, 0]
Position [60, 169, 105, 216]
ShowPortLabels off
System {
Name "cold water\nvalve"
Location [53, 437, 460, 713]
Open off
ToolBar off
StatusBar off
ScreenColor white
PaperOrientation landscape
PaperPositionMode auto
PaperType usletter
PaperUnits inches
Block {
BlockType Inport
Name "in_1"
Position [30, 25, 50, 45]
Port "1"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Mux
Name "Mux"
Ports [2, 1, 0, 0, 0]
Position [220, 26, 250, 59]
Inputs "2"
}
Block {
BlockType Fcn
Name "flow rate\n(cold)"
Position [280, 35, 320, 55]
Expr "k*u(1)*((k*u(1))<=u(2)) + u(2)*((k*u(1))>u("
"2))"
}
Block {
BlockType Sum
Name "max\nflow"
Ports [2, 1, 0, 0, 0]
Position [150, 105, 170, 125]
Inputs "++"
}
Block {
BlockType Constant
Name "max flow\nconstant"
Position [50, 155, 70, 175]
Value "1"
}
Block {
BlockType SignalGenerator
Name "max flow\nvariation"
Position [35, 93, 80, 127]
WaveForm sine
Amplitude "0.000000"
Frequency "0.101325"
Units "rad/sec"
}
Block {
BlockType Constant
Name "temp (cold)"
Position [45, 208, 80, 242]
Value "10"
}
Block {
BlockType SubSystem
Name "valve\nsetting\n(cold)"
Ports [1, 1, 0, 0, 0]
Position [75, 20, 115, 50]
ShowPortLabels off
MaskType "Limited Integrator."
MaskDescription "Limited Integrator"
MaskHelp "Implements a limited integrator with \\nan "
"expression of the form:\\n\\nif(x<=lb and u<0) or (x>=ub and u>0)\\n xdot=0"
"\\nelse\\n xdot=u"
MaskPromptString "Lower bound:|Upper bound:|Initial condition"
":"
MaskStyleString "edit,edit,edit"
MaskTunableValueString "on,on,on"
MaskInitialization "lower_limit=@1;upper_limit=@2;X0=@3;"
MaskDisplay "plot(-1,-0.2,3.5,1.2,[0.05,1,2,2.9],[0,0,1,"
"1]);disp(' 1/s ')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate none
MaskIconUnits autoscale
MaskValueString "0.001|2|0.1"
System {
Name "valve\nsetting\n(cold)"
Location [452, 229, 1117, 789]
Open off
ToolBar off
StatusBar off
ScreenColor white
PaperOrientation landscape
PaperPositionMode auto
PaperType usletter
PaperUnits inches
Block {
BlockType Inport
Name "Inport"
Position [25, 85, 45, 105]
Port "1"
PortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Constant
Name "Constant"
Position [325, 179, 395, 201]
ShowName off
Value "upper_limit"
}
Block {
BlockType Constant
Name "Constant1"
Position [325, 345, 390, 365]
ShowName off
Value "lower_limit"
}
Block {
BlockType Constant
Name "Constant2"
Position [20, 135, 40, 155]
Value "0"
}
Block {
BlockType Constant
Name "Constant3"
Position [355, 260, 375, 280]
ShowName off
Value "0"
}
Block {
BlockType Constant
Name "Constant4"
Position [355, 425, 375, 445]
ShowName off
Value "0"
}
Block {
BlockType Integrator
Name "Integrator"
Ports [1, 1, 0, 0, 0]
Position [165, 99, 200, 141]
ExternalReset none
InitialConditionSource internal
InitialCondition "X0"
LimitOutput off
UpperSaturationLimit "inf"
LowerSaturationLimit "-inf"
ShowSaturationPort off
ShowStatePort off
AbsoluteTolerance "auto"
}
Block {
BlockType Logic
Name "Logical\nOperator"
Ports [2, 1, 0, 0, 0]
Position [570, 280, 605, 315]
ShowName off
Operator AND
Inputs "2"
}
Block {
BlockType Logic
Name "Logical\nOperator1"
Ports [2, 1, 0, 0, 0]
Position [490, 200, 525, 235]
ShowName off
Operator OR
Inputs "2"
}
Block {
BlockType Logic
Name "Logical\nOperator2"
Ports [2, 1, 0, 0, 0]
Position [490, 360, 525, 395]
ShowName off
Operator OR
Inputs "2"
}
Block {
BlockType RelationalOperator
Name "Relational\noperator"
Position [415, 151, 445, 204]
ShowName off
Operator "<="
}
Block {
BlockType RelationalOperator
Name "Relational\noperator1"
Position [415, 312, 445, 368]
ShowName off
Operator ">="
}
Block {
BlockType RelationalOperator
Name "Relational\noperator2"
Position [415, 231, 445, 284]
ShowName off
Operator "<="
}
Block {
BlockType RelationalOperator
Name "Relational\noperator3"
Position [415, 396, 445, 449]
ShowName off
Operator ">="
}
Block {
BlockType Saturate
Name "Saturation"
Position [325, 110, 350, 130]
UpperLimit "upper_limit"
LowerLimit "lower_limit"
}
Block {
BlockType Switch
Name "Switch"
Position [110, 80, 135, 160]
Threshold "0.5"
}
Block {
BlockType Outport
Name "Outport"
Position [515, 110, 535, 130]
Port "1"
OutputWhenDisabled held
InitialOutput "0"
}
Line {
SrcBlock "Constant4"
SrcPort 1
DstBlock "Relational\noperator3"
DstPort 2
}
Line {
SrcBlock "Constant3"
SrcPort 1
DstBlock "Relational\noperator2"
DstPort 2
}
Line {
SrcBlock "Logical\nOperator2"
SrcPort 1
Points [10, 0; 0, -75]
DstBlock "Logical\nOperator"
DstPort 2
}
Line {
SrcBlock "Relational\noperator3"
SrcPort 1
Points [10, 0; 0, -40]
DstBlock "Logical\nOperator2"
DstPort 2
}
Line {
SrcBlock "Relational\noperator1"
SrcPort 1
Points [10, 0; 0, 30]
DstBlock "Logical\nOperator2"
DstPort 1
}
Line {
SrcBlock "Logical\nOperator1"
SrcPort 1
Points [10, 0; 0, 70]
DstBlock "Logical\nOperator"
DstPort 1
}
Line {
SrcBlock "Relational\noperator2"
SrcPort 1
Points [15, 0; 0, -35]
DstBlock "Logical\nOperator1"
DstPort 2
}
Line {
SrcBlock "Relational\noperator"
SrcPort 1
Points [15, 0; 0, 30]
DstBlock "Logical\nOperator1"
DstPort 1
}
Line {
SrcBlock "Constant2"
SrcPort 1
DstBlock "Switch"
DstPort 3
}
Line {
SrcBlock "Logical\nOperator"
SrcPort 1
Points [15, 0; 0, 190; -540, 0; 0, -370]
DstBlock "Switch"
DstPort 2
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -