Model { Name "toilet" Version 3.00 SimParamPage "Solver" SampleTimeColors off InvariantConstants off WideVectorLines off ShowLineWidths off ShowPortDataTypes off StartTime "0.0" StopTime "inf" SolverMode "SingleTasking" Solver "ode1" RelTol "1e-3" AbsTol "1e-6" Refine "1" MaxStep "auto" InitialStep "auto" FixedStep ".5" MaxOrder 5 OutputOption "RefineOutputTimes" OutputTimes "[]" LoadExternalInput off ExternalInput "[t, u]" SaveTime on TimeSaveName "tout" SaveState off StateSaveName "xout" SaveOutput on OutputSaveName "yout" LoadInitialState off InitialState "xInitial" SaveFinalState off FinalStateName "xFinal" SaveFormat "Matrix" LimitMaxRows off MaxRows "1000" Decimation "1" AlgebraicLoopMsg "warning" MinStepSizeMsg "warning" UnconnectedInputMsg "warning" UnconnectedOutputMsg "warning" UnconnectedLineMsg "warning" InheritedTsInSrcMsg "warning" IntegerOverflowMsg "none" ConsistencyChecking "off" ZeroCross on SimulationMode "normal" BlockDataTips on BlockParametersDataTip on BlockAttributesDataTip off BlockPortWidthsDataTip off BlockDescriptionStringDataTip off BlockMaskParametersDataTip off BrowserShowLibraryLinks off BrowserLookUnderMasks off OptimizeBlockIOStorage on BufferReuse on BooleanDataType off RTWSystemTargetFile "grt.tlc" RTWInlineParameters off RTWRetainRTWFile off RTWTemplateMakefile "grt_default_tmf" RTWMakeCommand "make_rtw" RTWGenerateCodeOnly off ExtModeMexFile "ext_comm" ExtModeBatchMode off ExtModeTrigType "manual" ExtModeTrigMode "oneshot" ExtModeTrigPort "1" ExtModeTrigElement "any" ExtModeTrigDuration 1000 ExtModeTrigHoldOff 0 ExtModeTrigDelay 0 ExtModeTrigDirection "rising" ExtModeTrigLevel 0 ExtModeArchiveMode "off" ExtModeAutoIncOneShot off ExtModeIncDirWhenArm off ExtModeAddSuffixToVar off ExtModeWriteAllDataToWs off ExtModeArmWhenConnect off PreLoadFcn "toiletgui" CloseFcn "toiletgui done" StartFcn "toiletgui start" StopFcn "toiletgui stop" Created "Thu Aug 27 08:56:57 1998" Creator "kcritz" UpdateHistory "UpdateHistoryNever" ModifiedByFormat "%" LastModifiedBy "edecosta" ModifiedDateFormat "%" LastModifiedDate "Mon Aug 31 15:11:26 1998" ModelVersionFormat "1.%" ConfigurationManager "none" 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 "toilet" Location [99, 596, 890, 905] Open on ToolBar on StatusBar on ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" ReportName "simulink-default.rpt" Block { BlockType SubSystem Name "Animation" Ports [3, 0, 0, 0, 0] Position [580, 46, 650, 104] ShowName off ShowPortLabels on MaskDisplay "disp('Animation\\nControl')\n" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" System { Name "Animation" Location [81, 114, 409, 255] Open off ToolBar off StatusBar off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Block { BlockType Inport Name "In Valve" Position [15, 28, 45, 42] Port "1" PortWidth "-1" SampleTime "-1" DataType "auto" SignalType "auto" } Block { BlockType Inport Name "Water Height" Position [40, 58, 70, 72] Port "2" PortWidth "-1" SampleTime "-1" DataType "auto" SignalType "auto" } Block { BlockType Inport Name "Outvalve" Position [65, 88, 95, 102] Port "3" PortWidth "-1" SampleTime "-1" DataType "auto" SignalType "auto" } Block { BlockType Mux Name "Mux" Ports [3, 1, 0, 0, 0] Position [135, 19, 220, 111] Inputs "3" DisplayOption "none" } Block { BlockType "S-Function" Name "S-Function" Ports [1, 0, 0, 0, 0] Position [255, 50, 315, 80] FunctionName "toiletsfun" Parameters "inflow,outflow,lolim,hilim,area" PortCounts "[]" SFunctionModules "''" } Line { SrcBlock "Outvalve" SrcPort 1 DstBlock "Mux" DstPort 3 } Line { SrcBlock "Water Height" SrcPort 1 DstBlock "Mux" DstPort 2 } Line { SrcBlock "Mux" SrcPort 1 DstBlock "S-Function" DstPort 1 } Line { SrcBlock "In Valve" SrcPort 1 DstBlock "Mux" DstPort 1 } } } Block { BlockType SubSystem Name "Flush Pulse" Ports [0, 1, 0, 0, 0] Position [20, 179, 135, 251] ForegroundColor "blue" ShowName off OpenFcn "toiletgui flush" FontSize 18 FontWeight "bold" ShowPortLabels on MaskDisplay "disp('Double Click\\nTo\\nFlush Me!')" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" System { Name "Flush Pulse" Location [73, 422, 442, 516] Open off ToolBar off StatusBar off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Block { BlockType Abs Name "Abs1" Position [220, 25, 250, 55] ShowName off } Block { BlockType Memory Name "Memory1" Position [100, 35, 120, 55] ShowName off X0 "0" InheritSampleTime off } Block { BlockType Constant Name "PulseConst" Position [35, 20, 55, 40] Value "1" } Block { BlockType Sum Name "Sum2" Ports [2, 1, 0, 0, 0] Position [170, 22, 200, 53] ShowName off IconShape "rectangular" Inputs "+-" } Block { BlockType Outport Name "Flush Signal" Position [285, 33, 315, 47] Port "1" OutputWhenDisabled "held" InitialOutput "0" } Line { SrcBlock "PulseConst" SrcPort 1 Points [20, 0] Branch { DstBlock "Sum2" DstPort 1 } Branch { Points [0, 15] DstBlock "Memory1" DstPort 1 } } Line { SrcBlock "Sum2" SrcPort 1 DstBlock "Abs1" DstPort 1 } Line { SrcBlock "Memory1" SrcPort 1 DstBlock "Sum2" DstPort 2 } Line { SrcBlock "Abs1" SrcPort 1 DstBlock "Flush Signal" DstPort 1 } } } Block { BlockType SubSystem Name "In Valve" Ports [1, 2, 0, 0, 0] Position [190, 50, 320, 130] ShowPortLabels on MaskPromptString "Shut Off Height|Flow Rate" MaskStyleString "edit,edit" MaskTunableValueString "on,on" MaskCallbackString "|" MaskEnableString "on,on" MaskVisibilityString "on,on" MaskVariables "hilim=@1;inflow=@2;" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" MaskValueString "hilim|inflow" System { Name "In Valve" Location [23, 68, 494, 253] Open off ToolBar off StatusBar off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Block { BlockType Inport Name "Tank Height" Position [50, 33, 80, 47] Port "1" PortWidth "-1" SampleTime "-1" DataType "auto" SignalType "auto" } Block { BlockType Gain Name "Flow Rate - In" Position [320, 44, 370, 76] NamePlacement "alternate" Gain "inflow" } Block { BlockType RelationalOperator Name "In Valve \nPosition" Position [130, 19, 160, 101] Operator "<" } Block { BlockType Constant Name "In Valve Setpoint" Position [45, 66, 75, 94] Value "hilim" } Block { BlockType Outport Name "Valve Position" Position [245, 13, 275, 27] Port "1" OutputWhenDisabled "held" InitialOutput "0" } Block { BlockType Outport Name "ValveFlow" Position [415, 53, 445, 67] Port "2" OutputWhenDisabled "held" InitialOutput "0" } Line { SrcBlock "Flow Rate - In" SrcPort 1 DstBlock "ValveFlow" DstPort 1 } Line { SrcBlock "In Valve \nPosition" SrcPort 1 Points [25, 0] Branch { DstBlock "Flow Rate - In" DstPort 1 } Branch { Points [0, -40] DstBlock "Valve Position" DstPort 1 } } Line { SrcBlock "Tank Height" SrcPort 1 DstBlock "In Valve \nPosition" DstPort 1 } Line { SrcBlock "In Valve Setpoint" SrcPort 1 DstBlock "In Valve \nPosition" DstPort 2 } } } Block { BlockType SubSystem Name "Out Valve" Ports [2, 2, 0, 0, 0] Position [190, 149, 325, 236] ShowPortLabels on System { Name "Out Valve" Location [48, 93, 546, 393] Open off ToolBar off StatusBar off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Block { BlockType Inport Name "Tank Height" Position [25, 138, 55, 152] Port "1" PortWidth "-1" SampleTime "-1" DataType "auto" SignalType "auto" } Block { BlockType Inport Name "Flush Signal" Position [75, 73, 105, 87] NamePlacement "alternate" Port "2" PortWidth "-1" SampleTime "-1" DataType "auto" SignalType "auto" } Block { BlockType Gain Name "Outflow Rate" Position [335, 61, 395, 99] Gain "outflow" } Block { BlockType SubSystem Name "S-R\nFlip-Flop" Ports [2, 2, 0, 0, 0] Position [165, 45, 255, 180] ShowName off ShowPortLabels on MaskType "S-R Flip-Flop" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" System { Name "S-R\nFlip-Flop" Location [499, 424, 801, 626] Open off ToolBar off StatusBar off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Block { BlockType Inport Name "S" Position [25, 105, 45, 125] Port "1" PortWidth "-1" SampleTime "-1" DataType "auto" SignalType "auto" } Block { BlockType Inport Name "R" Position [25, 145, 45, 165] Port "2" PortWidth "-1" SampleTime "-1" DataType "auto" SignalType "auto" } Block { BlockType Demux Name "Demux" Ports [1, 2, 0, 0, 0] Position [175, 66, 180, 159] Outputs "2" } Block { BlockType CombinatorialLogic Name "Logic" Position [115, 99, 145, 131] TruthTable "[0 1;0 1;1 0;0 1;1 0;0 1;1 0;1 0]" } Block { BlockType Memory Name "Memory" Position [115, 25, 155, 55] Orientation "left" X0 "0" InheritSampleTime on } Block { BlockType Mux Name "Mux" Ports [3, 1, 0, 0, 0] Position [90, 54, 95, 176] Inputs "3" DisplayOption "none" } Block { BlockType Outport Name "Q" Position [255, 80, 275, 100] Port "1" OutputWhenDisabled "held" InitialOutput "0" } Block { BlockType Outport Name "!Q" Position [255, 125, 275, 145] Port "2" OutputWhenDisabled "held" InitialOutput "1" } Line { SrcBlock "R" SrcPort 1 DstBlock "Mux" DstPort 3 } Line { SrcBlock "S" SrcPort 1 DstBlock "Mux" DstPort 2 } Line { SrcBlock "Memory" SrcPort 1 Points [-50, 0; 0, 35] DstBlock "Mux" DstPort 1 } Line { SrcBlock "Demux" SrcPort 1 Points [25, 0] Branch { Points [0, -50] DstBlock "Memory" DstPort 1 } Branch { DstBlock "Q" DstPort 1 } } Line { SrcBlock "Demux" SrcPort 2 DstBlock "!Q" DstPort 1 } Line { SrcBlock "Logic" SrcPort 1 DstBlock "Demux" DstPort 1 } Line { SrcBlock "Mux" SrcPort 1 DstBlock "Logic" DstPort 1 } } } Block { BlockType HitCross Name "Tank Height \nCrosses\nLower Limit" Ports [1, 1, 0, 0, 0] Position [100, 130, 130, 160] HitCrossingOffset "lolim" HitCrossingDirection "falling" ShowOutputPort on } Block { BlockType Terminator Name "Terminator" Position [270, 137, 285, 153] ShowName off } Block { BlockType Outport Name "Flow Rate - Out" Position [435, 72, 465, 88] Port "1" OutputWhenDisabled "held" InitialOutput "0" } Block { BlockType Outport Name "Valve Position" Position [430, 142, 460, 158] Port "2" OutputWhenDisabled "held" InitialOutput "0" } Line { SrcBlock "Tank Height" SrcPort 1 DstBlock "Tank Height \nCrosses\nLower Limit" DstPort 1 } Line { SrcBlock "Tank Height \nCrosses\nLower Limit" SrcPort 1 DstBlock "S-R\nFlip-Flop" DstPort 2 } Line { SrcBlock "S-R\nFlip-Flop" SrcPort 1 Points [50, 0] Branch { DstBlock "Outflow Rate" DstPort 1 } Branch { Points [0, 70] DstBlock "Valve Position" DstPort 1 } } Line { SrcBlock "Flush Signal" SrcPort 1 DstBlock "S-R\nFlip-Flop" DstPort 1 } Line { SrcBlock "S-R\nFlip-Flop" SrcPort 2 DstBlock "Terminator" DstPort 1 } Line { SrcBlock "Outflow Rate" SrcPort 1 DstBlock "Flow Rate - Out" DstPort 1 } } } Block { BlockType Scope Name "Scope" Ports [1, 0, 0, 0, 0] Position [695, 25, 725, 55] NamePlacement "alternate" Floating off Location [11, 396, 809, 635] Open off NumInputPorts "1" TickLabels "on" ZoomMode "on" List { ListType AxesTitles axes1 "%s" } Grid "on" TimeRange "20" YMin "0" YMax "12.5" SaveToWorkspace off SaveName "ScopeData" DataFormat "Matrix" LimitMaxRows on MaxRows "5000" Decimation "1" SampleInput off SampleTime "0" } Block { BlockType SubSystem Name "Tank Dynamics" Ports [2, 1, 0, 0, 0] Position [430, 81, 515, 199] ShowPortLabels on System { Name "Tank Dynamics" Location [107, 138, 519, 270] Open off ToolBar off StatusBar off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Block { BlockType Inport Name "Tank Inflow" Position [25, 28, 55, 42] NamePlacement "alternate" Port "1" PortWidth "-1" SampleTime "-1" DataType "auto" SignalType "auto" } Block { BlockType Inport Name "Tank Outflow" Position [25, 43, 55, 57] Port "2" PortWidth "-1" SampleTime "-1" DataType "auto" SignalType "auto" } Block { BlockType Sum Name "\n" Ports [2, 1, 0, 0, 0] Position [80, 27, 110, 58] IconShape "rectangular" Inputs "+-" } Block { BlockType Integrator Name "Cumulative Flow" Ports [1, 1, 0, 0, 0] Position [145, 29, 175, 61] ExternalReset "none" InitialConditionSource "internal" InitialCondition "(hilim+lolim)/2*area" LimitOutput off UpperSaturationLimit "inf" LowerSaturationLimit "-inf" ShowSaturationPort off ShowStatePort off AbsoluteTolerance "auto" } Block { BlockType Gain Name "Tank Area" Position [220, 30, 305, 60] Gain "1/area" } Block { BlockType Outport Name "Tank Height" Position [335, 38, 365, 52] Port "1" OutputWhenDisabled "held" InitialOutput "0" } Line { SrcBlock "Tank Outflow" SrcPort 1 DstBlock "\n" DstPort 2 } Line { SrcBlock "Tank Inflow" SrcPort 1 DstBlock "\n" DstPort 1 } Line { SrcBlock "\n" SrcPort 1 DstBlock "Cumulative Flow" DstPort 1 } Line { SrcBlock "Cumulative Flow" SrcPort 1 DstBlock "Tank Area" DstPort 1 } Line { SrcBlock "Tank Area" SrcPort 1 DstBlock "Tank Height" DstPort 1 } Annotation { Position [94, 77] Text "Flow\nDifference" } } } Block { BlockType ToWorkspace Name "To Workspace" Position [210, 265, 270, 295] ShowName off VariableName "flushpulse" Buffer "inf" Decimation "1" SampleTime "-1" SaveFormat "Matrix" } Block { BlockType ToWorkspace Name "To Workspace1" Position [695, 125, 755, 155] ShowName off VariableName "tankheight" Buffer "inf" Decimation "1" SampleTime "-1" SaveFormat "Matrix" } Block { BlockType ToWorkspace Name "To Workspace2" Position [350, 65, 410, 95] ShowName off VariableName "invalve" Buffer "inf" Decimation "1" SampleTime "-1" SaveFormat "Matrix" } Block { BlockType ToWorkspace Name "To Workspace3" Position [380, 225, 440, 255] ShowName off VariableName "Outvalve" Buffer "inf" Decimation "1" SampleTime "-1" SaveFormat "Matrix" } Line { SrcBlock "Out Valve" SrcPort 2 Points [35, 0] Branch { Points [175, 0; 0, -120] DstBlock "Animation" DstPort 3 } Branch { DstBlock "To Workspace3" DstPort 1 } } Line { SrcBlock "In Valve" SrcPort 1 Points [10, 0] Branch { Points [0, -15] DstBlock "Animation" DstPort 1 } Branch { DstBlock "To Workspace2" DstPort 1 } } Line { SrcBlock "Tank Dynamics" SrcPort 1 Points [5, 0] Branch { Points [145, 0; 0, -100] Branch { DstBlock "Scope" DstPort 1 } Branch { Points [-505, 0; 0, 50] Branch { Points [0, 80] DstBlock "Out Valve" DstPort 1 } Branch { DstBlock "In Valve" DstPort 1 } } } Branch { Points [0, -65] DstBlock "Animation" DstPort 2 } Branch { DstBlock "To Workspace1" DstPort 1 } } Line { SrcBlock "In Valve" SrcPort 2 DstBlock "Tank Dynamics" DstPort 1 } Line { SrcBlock "Flush Pulse" SrcPort 1 Points [10, 0] Branch { DstBlock "Out Valve" DstPort 2 } Branch { Points [0, 65] DstBlock "To Workspace" DstPort 1 } } Line { SrcBlock "Out Valve" SrcPort 1 DstBlock "Tank Dynamics" DstPort 2 } } }