# $Revision: 1.1.8.2 $ Model { Name "toilet" Version 6.2 MdlSubVersion 0 GraphicalInterface { NumRootInports 0 NumRootOutports 0 ParameterArgumentNames "" ComputedModelVersion "1.17" NumModelReferences 0 NumTestPointedSignals 0 } SavedCharacterEncoding "US-ASCII" PreLoadFcn "toiletgui" SaveDefaultBlockParams on SampleTimeColors off LibraryLinkDisplay "none" WideLines off ShowLineDimensions off ShowPortDataTypes off ShowLoopsOnError on IgnoreBidirectionalLines off ShowStorageClass off ShowTestPointIcons on ShowViewerIcons on SortedOrder off ExecutionContextIcon off ShowLinearizationAnnotations on RecordCoverage off CovPath "/" CovSaveName "covdata" CovMetricSettings "dw" CovNameIncrementing off CovHtmlReporting on covSaveCumulativeToWorkspaceVar on CovSaveSingleToWorkspaceVar on CovCumulativeVarName "covCumulativeData" CovCumulativeReport off CovReportOnPause on ScopeRefreshTime 0.035000 OverrideScopeRefreshTime on DisableAllScopes off DataTypeOverride "UseLocalSettings" MinMaxOverflowLogging "UseLocalSettings" MinMaxOverflowArchiveMode "Overwrite" BlockNameDataTip off BlockParametersDataTip on BlockDescriptionStringDataTip off ToolBar on StatusBar on BrowserShowLibraryLinks off BrowserLookUnderMasks off CloseFcn "toiletgui done" StartFcn "toiletgui start" StopFcn "toiletgui stop" Created "Thu Aug 27 08:56:57 1998" Creator "The MathWorks Inc." UpdateHistory "UpdateHistoryNever" ModifiedByFormat "%" LastModifiedBy "batserve" ModifiedDateFormat "%" LastModifiedDate "Sat Jan 22 19:09:27 2005" ModelVersionFormat "1.%" ConfigurationManager "none" LinearizationMsg "none" Profile off ParamWorkspaceSource "MATLABWorkspace" AccelSystemTargetFile "accel.tlc" AccelTemplateMakefile "accel_default_tmf" AccelMakeCommand "make_rtw" TryForcingSFcnDF off ExtModeBatchMode off ExtModeEnableFloating on ExtModeTrigType "manual" ExtModeTrigMode "oneshot" ExtModeTrigPort "1" ExtModeTrigElement "any" ExtModeTrigDuration 1000 ExtModeTrigDurationFloating "auto" ExtModeTrigHoldOff 0 ExtModeTrigDelay 0 ExtModeTrigDirection "rising" ExtModeTrigLevel 0 ExtModeArchiveMode "off" ExtModeAutoIncOneShot off ExtModeIncDirWhenArm off ExtModeAddSuffixToVar off ExtModeWriteAllDataToWs off ExtModeArmWhenConnect off ExtModeSkipDownloadWhenConnect off ExtModeLogAll on ExtModeAutoUpdateStatusClock off BufferReuse on StrictBusMsg "None" ProdHWDeviceType "32-bit Generic" ShowModelReferenceBlockVersion off ShowModelReferenceBlockIO off Array { Type "Handle" Dimension 1 Simulink.ConfigSet { $ObjectID 1 Version "1.1.0" Array { Type "Handle" Dimension 7 Simulink.SolverCC { $ObjectID 2 Version "1.1.0" StartTime "0.0" StopTime "170" AbsTol "1e-6" FixedStep ".5" InitialStep "auto" MaxNumMinSteps "-1" MaxOrder 5 ExtrapolationOrder 4 NumberNewtonIterations 1 MaxStep "auto" MinStep "auto" RelTol "1e-3" SolverMode "SingleTasking" Solver "ode1" SolverName "ode1" ZeroCrossControl "UseLocalSettings" AlgebraicLoopSolver "TrustRegion" SolverResetMethod "Fast" PositivePriorityOrder off AutoInsertRateTranBlk off SampleTimeConstraint "Unconstrained" RateTranMode "Deterministic" } Simulink.DataIOCC { $ObjectID 3 Version "1.1.0" Decimation "1" ExternalInput "[t, u]" FinalStateName "xFinal" InitialState "xInitial" LimitDataPoints off MaxDataPoints "1000" LoadExternalInput off LoadInitialState off SaveFinalState off SaveFormat "Array" SaveOutput on SaveState off SignalLogging on SaveTime on StateSaveName "xout" TimeSaveName "tout" OutputSaveName "yout" SignalLoggingName "sigsOut" OutputOption "RefineOutputTimes" OutputTimes "[]" Refine "1" } Simulink.OptimizationCC { $ObjectID 4 Array { Type "Cell" Dimension 5 Cell "ZeroExternalMemoryAtStartup" Cell "ZeroInternalMemoryAtStartup" Cell "InitFltsAndDblsToZero" Cell "OptimizeModelRefInitCode" Cell "NoFixptDivByZeroProtection" PropName "DisabledProps" } Version "1.1.0" BlockReduction on BooleanDataType on ConditionallyExecuteInputs on InlineParams off InlineInvariantSignals on OptimizeBlockIOStorage on BufferReuse on EnforceIntegerDowncast on ExpressionFolding on FoldNonRolledExpr on LocalBlockOutputs on ParameterPooling on RollThreshold 5 SystemCodeInlineAuto off StateBitsets off DataBitsets off UseTempVars off ZeroExternalMemoryAtStartup on ZeroInternalMemoryAtStartup on InitFltsAndDblsToZero on NoFixptDivByZeroProtection off EfficientFloat2IntCast off OptimizeModelRefInitCode off LifeSpan "inf" BufferReusableBoundary on } Simulink.DebuggingCC { $ObjectID 5 Version "1.1.0" RTPrefix "error" ConsistencyChecking "none" ArrayBoundsChecking "none" SignalInfNanChecking "none" AlgebraicLoopMsg "warning" ArtificialAlgebraicLoopMsg "warning" CheckSSInitialOutputMsg on CheckExecutionContextPreStartOutputMsg off CheckExecutionContextRuntimeOutputMsg off SignalResolutionControl "TryResolveAllWithWarning" BlockPriorityViolationMsg "warning" MinStepSizeMsg "warning" SolverPrmCheckMsg "none" InheritedTsInSrcMsg "warning" DiscreteInheritContinuousMsg "warning" MultiTaskDSMMsg "warning" MultiTaskRateTransMsg "error" SingleTaskRateTransMsg "none" TasksWithSamePriorityMsg "warning" CheckMatrixSingularityMsg "none" IntegerOverflowMsg "none" Int32ToFloatConvMsg "warning" ParameterDowncastMsg "error" ParameterOverflowMsg "error" ParameterPrecisionLossMsg "warning" UnderSpecifiedDataTypeMsg "none" UnnecessaryDatatypeConvMsg "none" VectorMatrixConversionMsg "none" InvalidFcnCallConnMsg "error" FcnCallInpInsideContextMsg "Use local settings" SignalLabelMismatchMsg "none" UnconnectedInputMsg "warning" UnconnectedOutputMsg "warning" UnconnectedLineMsg "warning" SFcnCompatibilityMsg "none" UniqueDataStoreMsg "none" BusObjectLabelMismatch "warning" RootOutportRequireBusObject "warning" AssertControl "UseLocalSettings" EnableOverflowDetection off ModelReferenceIOMsg "none" ModelReferenceVersionMismatchMessage "none" ModelReferenceIOMismatchMessage "none" ModelReferenceCSMismatchMessage "none" ModelReferenceSimTargetVerbose off UnknownTsInhSupMsg "warning" ModelReferenceDataLoggingMessage "warning" ModelReferenceSymbolNameMessage "warning" ModelReferenceExtraNoncontSigs "error" } Simulink.HardwareCC { $ObjectID 6 Version "1.1.0" ProdBitPerChar 8 ProdBitPerShort 16 ProdBitPerInt 32 ProdBitPerLong 32 ProdIntDivRoundTo "Undefined" ProdEndianess "Unspecified" ProdWordSize 32 ProdShiftRightIntArith on ProdHWDeviceType "32-bit Generic" TargetBitPerChar 8 TargetBitPerShort 16 TargetBitPerInt 32 TargetBitPerLong 32 TargetShiftRightIntArith on TargetIntDivRoundTo "Undefined" TargetEndianess "Unspecified" TargetWordSize 32 TargetTypeEmulationWarnSuppressLevel 0 TargetPreprocMaxBitsSint 32 TargetPreprocMaxBitsUint 32 TargetHWDeviceType "Specified" TargetUnknown on ProdEqTarget on } Simulink.ModelReferenceCC { $ObjectID 7 Version "1.1.0" UpdateModelReferenceTargets "IfOutOfDateOrStructuralChange" CheckModelReferenceTargetMessage "error" ModelReferenceNumInstancesAllowed "Multi" ModelReferencePassRootInputsByReference on ModelReferenceMinAlgLoopOccurrences off } Simulink.RTWCC { $BackupClass "Simulink.RTWCC" $ObjectID 8 Array { Type "Cell" Dimension 1 Cell "IncludeHyperlinkInReport" PropName "DisabledProps" } Version "1.1.0" SystemTargetFile "grt.tlc" GenCodeOnly off MakeCommand "make_rtw" TemplateMakefile "grt_default_tmf" Description "Generic Real-Time Target" GenerateReport off SaveLog off RTWVerbose on RetainRTWFile off ProfileTLC off TLCDebug off TLCCoverage off TLCAssert off ProcessScriptMode "Default" ConfigurationMode "Optimized" ConfigAtBuild off IncludeHyperlinkInReport off LaunchReport off TargetLang "C" Array { Type "Handle" Dimension 2 Simulink.CodeAppCC { $ObjectID 9 Array { Type "Cell" Dimension 9 Cell "IgnoreCustomStorageClasses" Cell "InsertBlockDesc" Cell "SFDataObjDesc" Cell "SimulinkDataObjDesc" Cell "DefineNamingRule" Cell "SignalNamingRule" Cell "ParamNamingRule" Cell "InlinedPrmAccess" Cell "CustomSymbolStr" PropName "DisabledProps" } Version "1.1.0" ForceParamTrailComments off GenerateComments on IgnoreCustomStorageClasses on IncHierarchyInIds off MaxIdLength 31 PreserveName off PreserveNameWithParent off ShowEliminatedStatement off IncAutoGenComments off SimulinkDataObjDesc off SFDataObjDesc off IncDataTypeInIds off PrefixModelToSubsysFcnNames on CustomSymbolStr "$R$N$M" MangleLength 1 DefineNamingRule "None" ParamNamingRule "None" SignalNamingRule "None" InsertBlockDesc off SimulinkBlockComments on EnableCustomComments off InlinedPrmAccess "Literals" ReqsInCode off } Simulink.GRTTargetCC { $BackupClass "Simulink.TargetCC" $ObjectID 10 Array { Type "Cell" Dimension 12 Cell "IncludeMdlTerminateFcn" Cell "CombineOutputUpdateFcns" Cell "SuppressErrorStatus" Cell "ERTCustomFileBanners" Cell "GenerateSampleERTMain" Cell "MultiInstanceERTCode" Cell "PurelyIntegerCode" Cell "SupportNonFinite" Cell "SupportComplex" Cell "SupportAbsoluteTime" Cell "SupportContinuousTime" Cell "SupportNonInlinedSFcns" PropName "DisabledProps" } Version "1.1.0" TargetFcnLib "ansi_tfl_tmw.mat" TargetLibSuffix "" TargetPreCompLibLocation "" GenFloatMathFcnCalls "ANSI_C" UtilityFuncGeneration "Auto" GenerateFullHeader on GenerateSampleERTMain off IsPILTarget off ModelReferenceCompliant on IncludeMdlTerminateFcn on CombineOutputUpdateFcns off SuppressErrorStatus off IncludeFileDelimiter "Auto" ERTCustomFileBanners off SupportAbsoluteTime on LogVarNameModifier "rt_" MatFileLogging on MultiInstanceERTCode off SupportNonFinite on SupportComplex on PurelyIntegerCode off SupportContinuousTime on SupportNonInlinedSFcns on ExtMode off ExtModeStaticAlloc off ExtModeTesting off ExtModeStaticAllocSize 1000000 ExtModeTransport 0 ExtModeMexFile "ext_comm" RTWCAPISignals off RTWCAPIParams off RTWCAPIStates off GenerateASAP2 off } PropName "Components" } } PropName "Components" } Name "Configuration" SimulationMode "normal" CurrentDlgPage "Solver" } PropName "ConfigurationSets" } Simulink.ConfigSet { $PropName "ActiveConfigurationSet" $ObjectID 1 } BlockDefaults { Orientation "right" ForegroundColor "black" BackgroundColor "white" DropShadow off NamePlacement "normal" FontName "Helvetica" FontSize 10 FontWeight "normal" FontAngle "normal" ShowName on } BlockParameterDefaults { Block { BlockType Abs SaturateOnIntegerOverflow on ZeroCross on SampleTime "-1" } Block { BlockType CombinatorialLogic TruthTable "[0 0;0 1;0 1;1 0;0 1;1 0;1 0;1 1]" SampleTime "-1" } Block { BlockType Constant Value "1" VectorParams1D on OutDataTypeMode "Inherit from 'Constant value'" OutDataType "sfix(16)" ConRadixGroup "Use specified scaling" OutScaling "2^0" SampleTime "inf" } Block { BlockType DataTypeConversion OutDataTypeMode "Inherit via back propagation" OutDataType "sfix(16)" OutScaling "2^0" LockScale off ConvertRealWorld "Real World Value (RWV)" RndMeth "Zero" SaturateOnIntegerOverflow on SampleTime "-1" } Block { BlockType Demux Outputs "4" DisplayOption "none" BusSelectionMode off } Block { BlockType FromWorkspace VariableName "simulink_input" SampleTime "-1" Interpolate on ZeroCross off OutputAfterFinalValue "Extrapolation" } Block { BlockType Gain Gain "1" Multiplication "Element-wise(K.*u)" ParameterDataTypeMode "Same as input" ParameterDataType "sfix(16)" ParameterScalingMode "Best Precision: Matrix-wise" ParameterScaling "2^0" OutDataTypeMode "Same as input" OutDataType "sfix(16)" OutScaling "2^0" LockScale off RndMeth "Floor" SaturateOnIntegerOverflow on SampleTime "-1" } Block { BlockType HitCross HitCrossingOffset "0" HitCrossingDirection "either" ShowOutputPort on ZeroCross on SampleTime "-1" } Block { BlockType Inport UseBusObject off BusObject "BusObject" BusOutputAsStruct off PortDimensions "-1" SampleTime "-1" DataType "auto" OutDataType "sfix(16)" OutScaling "2^0" SignalType "auto" SamplingMode "auto" Interpolate on } Block { BlockType Integrator ExternalReset "none" InitialConditionSource "internal" InitialCondition "0" LimitOutput off UpperSaturationLimit "inf" LowerSaturationLimit "-inf" ShowSaturationPort off ShowStatePort off AbsoluteTolerance "auto" IgnoreLimit off ZeroCross on } Block { BlockType Memory X0 "0" InheritSampleTime off LinearizeMemory off StateMustResolveToSignalObject off RTWStateStorageClass "Auto" } Block { BlockType Mux Inputs "4" DisplayOption "none" UseBusObject off BusObject "BusObject" NonVirtualBus off } Block { BlockType Outport Port "1" UseBusObject off BusObject "BusObject" BusOutputAsStruct off PortDimensions "-1" SampleTime "-1" DataType "auto" OutDataType "sfix(16)" OutScaling "2^0" SignalType "auto" SamplingMode "auto" OutputWhenDisabled "held" InitialOutput "[]" } Block { BlockType RelationalOperator Operator ">=" InputSameDT on LogicOutDataTypeMode "Logical (see Configuration Parameters: Optimiza" "tion)" LogicDataType "uint(8)" ZeroCross on SampleTime "-1" } Block { BlockType Scope Floating off ModelBased off TickLabels "OneTimeTick" ZoomMode "on" Grid "on" TimeRange "auto" YMin "-5" YMax "5" SaveToWorkspace off SaveName "ScopeData" LimitDataPoints on MaxDataPoints "5000" Decimation "1" SampleInput off SampleTime "0" } Block { BlockType "S-Function" FunctionName "system" SFunctionModules "''" PortCounts "[]" } Block { BlockType SubSystem ShowPortLabels on Permissions "ReadWrite" PermitHierarchicalResolution "All" SystemSampleTime "-1" RTWFcnNameOpts "Auto" RTWFileNameOpts "Auto" SimViewingDevice off DataTypeOverride "UseLocalSettings" MinMaxOverflowLogging "UseLocalSettings" } Block { BlockType Sum IconShape "rectangular" Inputs "++" InputSameDT on OutDataTypeMode "Same as first input" OutDataType "sfix(16)" OutScaling "2^0" LockScale off RndMeth "Floor" SaturateOnIntegerOverflow on SampleTime "-1" } Block { BlockType Terminator } Block { BlockType ToWorkspace VariableName "simulink_output" MaxDataPoints "1000" Decimation "1" SampleTime "0" FixptAsFi off } } 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 [142, 491, 807, 800] Open 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] Position [435, 46, 505, 104] ShowName off TreatAsAtomicUnit off MinAlgLoopOccurrences off RTWSystemCode "Auto" MaskDisplay "disp('Animation\\nControl')\n" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" System { Name "Animation" Location [117, 321, 569, 462] Open 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" IconDisplay "Port number" LatchInput off } Block { BlockType Inport Name "Water Height" Position [40, 58, 70, 72] Port "2" IconDisplay "Port number" LatchInput off } Block { BlockType Inport Name "Outvalve" Position [65, 88, 95, 102] Port "3" IconDisplay "Port number" LatchInput off } Block { BlockType DataTypeConversion Name "Data Type Conversion" Position [120, 21, 175, 49] OutDataTypeMode "double" } Block { BlockType DataTypeConversion Name "Data Type Conversion1" Position [145, 81, 200, 109] OutDataTypeMode "double" } Block { BlockType Mux Name "Mux" Ports [3, 1] Position [255, 19, 340, 111] Inputs "3" } Block { BlockType "S-Function" Name "S-Function" Ports [1] Position [375, 50, 435, 80] FunctionName "toiletsfun" Parameters "inflow,outflow,lolim,hilim,area" } Line { SrcBlock "Outvalve" SrcPort 1 DstBlock "Data Type Conversion1" DstPort 1 } 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 "Data Type Conversion" DstPort 1 } Line { SrcBlock "Data Type Conversion1" SrcPort 1 DstBlock "Mux" DstPort 3 } Line { SrcBlock "Data Type Conversion" SrcPort 1 DstBlock "Mux" DstPort 1 } } } Block { BlockType SubSystem Name "In Valve" Ports [1, 2] Position [45, 50, 175, 130] TreatAsAtomicUnit off MinAlgLoopOccurrences off RTWSystemCode "Auto" MaskPromptString "Shut Off Height|Flow Rate" MaskStyleString "edit,edit" MaskTunableValueString "on,on" MaskCallbackString "|" MaskEnableString "on,on" MaskVisibilityString "on,on" MaskToolTipString "on,on" MaskVarAliasString "," MaskVariables "hilim=@1;inflow=@2;" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" MaskValueString "hilim|inflow" MaskTabNameString "," System { Name "In Valve" Location [19, 48, 490, 233] Open 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" IconDisplay "Port number" LatchInput off } Block { BlockType DataTypeConversion Name "Data Type Conversion" Position [235, 46, 290, 74] OutDataTypeMode "double" } Block { BlockType Gain Name "Flow Rate - In" Position [320, 44, 370, 76] NamePlacement "alternate" Gain "inflow" OutDataTypeMode "Inherit via back propagation" } 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] IconDisplay "Port number" BusOutputAsStruct off InitialOutput "0" } Block { BlockType Outport Name "ValveFlow" Position [415, 53, 445, 67] Port "2" IconDisplay "Port number" BusOutputAsStruct off InitialOutput "0" } Line { SrcBlock "Flow Rate - In" SrcPort 1 DstBlock "ValveFlow" DstPort 1 } Line { SrcBlock "In Valve \nPosition" SrcPort 1 Points [25, 0] Branch { Points [0, -40] DstBlock "Valve Position" DstPort 1 } Branch { DstBlock "Data Type Conversion" 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 } Line { SrcBlock "Data Type Conversion" SrcPort 1 DstBlock "Flow Rate - In" DstPort 1 } } } Block { BlockType SubSystem Name "Out Valve" Ports [1, 3] Position [45, 156, 180, 244] TreatAsAtomicUnit off MinAlgLoopOccurrences off RTWSystemCode "Auto" System { Name "Out Valve" Location [388, 608, 1273, 847] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Block { BlockType Inport Name "Tank Height" Position [275, 148, 305, 162] Port "1" IconDisplay "Port number" LatchInput off } Block { BlockType Abs Name "Abs1" Position [235, 75, 265, 105] ShowName off } Block { BlockType DataTypeConversion Name "Data Type\nConversion2" Position [315, 76, 370, 104] OutDataTypeMode "boolean" } Block { BlockType DataTypeConversion Name "Data Type Conversion" Position [610, 76, 665, 104] OutDataTypeMode "double" } Block { BlockType Memory Name "Memory1" Position [135, 85, 155, 105] ShowName off } Block { BlockType Gain Name "Outflow Rate" Position [705, 71, 765, 109] Gain "outflow" } Block { BlockType SubSystem Name "S-R\nFlip-Flop" Ports [2, 2] Position [440, 55, 530, 190] ShowName off TreatAsAtomicUnit off MinAlgLoopOccurrences off RTWSystemCode "Auto" MaskType "S-R Flip-Flop" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" System { Name "S-R\nFlip-Flop" Location [495, 404, 797, 606] Open 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" IconDisplay "Port number" LatchInput off } Block { BlockType Inport Name "R" Position [25, 145, 45, 165] Port "2" IconDisplay "Port number" LatchInput off } Block { BlockType Demux Name "Demux" Ports [1, 2] 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" InheritSampleTime on } Block { BlockType Mux Name "Mux" Ports [3, 1] Position [90, 54, 95, 176] Inputs "3" } Block { BlockType Outport Name "Q" Position [255, 80, 275, 100] IconDisplay "Port number" BusOutputAsStruct off InitialOutput "0" } Block { BlockType Outport Name "!Q" Position [255, 125, 275, 145] Port "2" IconDisplay "Port number" BusOutputAsStruct off 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 SubSystem Name "Signal Builder" Tag "STV Subsys" Ports [0, 1] Position [15, 60, 90, 100] CopyFcn "sigbuilder_block('copy');" DeleteFcn "sigbuilder_block('delete');" LoadFcn "sigbuilder_block('load');" ModelCloseFcn "sigbuilder_block('modelClose');" PreSaveFcn "sigbuilder_block('preSave');" StartFcn "sigbuilder_block('start');" StopFcn "sigbuilder_block('stop');" NameChangeFcn "sigbuilder_block('namechange');" ClipboardFcn "sigbuilder_block('clipboard');" OpenFcn "sigbuilder_block('open',[87.75 166.5 618.75" " 375 ]);" CloseFcn "sigbuilder_block('close');" TreatAsAtomicUnit off MinAlgLoopOccurrences off RTWSystemCode "Auto" MaskType "Sigbuilder block" MaskDescription "Sigbuilder GUI" MaskInitialization "if ~strcmp(get_param(bdroot(gcb),'Simulatio" "nStatus'),'stopped') tuvar = sigbuilder_block('maskInit'); end" MaskDisplay "plot(0,0,100,100,[10,10,40,40,10],[80,20,20" ",80,80],[40,10],[50,50], [40,27,10],[65,72,56],[40,25,25,10],[28,28,43,43]);" MaskIconFrame on MaskIconOpaque off MaskIconRotate "port" MaskIconUnits "autoscale" System { Name "Signal Builder" Location [480, 85, 980, 386] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Block { BlockType Demux Name "Demux" Tag "STV Demux" Ports [1, 1] Position [150, 34, 160, 606] Outputs "1" } Block { BlockType FromWorkspace Name "FromWs" Tag "STV FromWs" Position [30, 300, 115, 350] VariableName "tuvar" SampleTime "0" SigBuilderData "DataTag0" VnvData "DataTag1" } Block { BlockType Outport Name "Signal 1" Tag "STV Outport" Position [280, 30, 300, 40] IconDisplay "Port number" BusOutputAsStruct off } Line { SrcBlock "FromWs" SrcPort 1 Points [5, 0; 0, -5] DstBlock "Demux" DstPort 1 } Line { SrcBlock "Demux" SrcPort 1 Points [50, 0; 0, -285] DstBlock "Signal 1" DstPort 1 } } } Block { BlockType Sum Name "Sum2" Ports [2, 1] Position [180, 72, 210, 103] ShowName off Inputs "+-" } Block { BlockType HitCross Name "Tank Height \nCrosses\nLower Limit" Ports [1, 1] Position [350, 140, 380, 170] HitCrossingOffset "lolim" HitCrossingDirection "falling" } Block { BlockType Terminator Name "Terminator" Position [545, 147, 560, 163] ShowName off } Block { BlockType Outport Name "Flow Rate - Out" Position [805, 82, 835, 98] IconDisplay "Port number" BusOutputAsStruct off InitialOutput "0" } Block { BlockType Outport Name "Valve Position" Position [800, 142, 830, 158] Port "2" IconDisplay "Port number" BusOutputAsStruct off InitialOutput "0" } Block { BlockType Outport Name "Flush\nSignal" Position [400, 17, 430, 33] Port "3" IconDisplay "Port number" BusOutputAsStruct off 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 [45, 0] Branch { Points [0, 60] DstBlock "Valve Position" DstPort 1 } Branch { DstBlock "Data Type Conversion" 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 } Line { SrcBlock "Data Type Conversion" SrcPort 1 DstBlock "Outflow Rate" DstPort 1 } Line { SrcBlock "Data Type\nConversion2" SrcPort 1 Points [10, 0] Branch { DstBlock "S-R\nFlip-Flop" DstPort 1 } Branch { DstBlock "Flush\nSignal" DstPort 1 } } Line { SrcBlock "Signal Builder" 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 "Data Type\nConversion2" DstPort 1 } } } Block { BlockType Scope Name "Scope" Ports [1] Position [550, 25, 580, 55] NamePlacement "alternate" Location [11, 396, 809, 635] Open off NumInputPorts "1" TickLabels "on" List { ListType AxesTitles axes1 "%" } TimeRange "20" YMin "0" YMax "12.5" DataFormat "Array" } Block { BlockType SubSystem Name "Tank Dynamics" Ports [2, 1] Position [285, 81, 370, 199] TreatAsAtomicUnit off MinAlgLoopOccurrences off RTWSystemCode "Auto" System { Name "Tank Dynamics" Location [103, 118, 515, 250] Open 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" IconDisplay "Port number" LatchInput off } Block { BlockType Inport Name "Tank Outflow" Position [25, 43, 55, 57] Port "2" IconDisplay "Port number" LatchInput off } Block { BlockType Sum Name "\n" Ports [2, 1] Position [80, 27, 110, 58] Inputs "+-" } Block { BlockType Integrator Name "Cumulative Flow" Ports [1, 1] Position [145, 29, 175, 61] InitialCondition "(hilim+lolim)/2*area" IgnoreLimit off } 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] IconDisplay "Port number" BusOutputAsStruct off 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 { Name "Flow\nDifference" Position [94, 77] } } } Block { BlockType ToWorkspace Name "To Workspace" Position [235, 265, 295, 295] ShowName off VariableName "flushpulse" MaxDataPoints "inf" SampleTime "-1" SaveFormat "Array" } Block { BlockType ToWorkspace Name "To Workspace1" Position [550, 125, 610, 155] ShowName off VariableName "tankheight" MaxDataPoints "inf" SampleTime "-1" SaveFormat "Array" } Block { BlockType ToWorkspace Name "To Workspace2" Position [205, 65, 265, 95] ShowName off VariableName "invalve" MaxDataPoints "inf" SampleTime "-1" SaveFormat "Array" } Block { BlockType ToWorkspace Name "To Workspace3" Position [235, 225, 295, 255] ShowName off VariableName "Outvalve" MaxDataPoints "inf" SampleTime "-1" SaveFormat "Array" } Line { SrcBlock "Out Valve" SrcPort 2 Points [0, 15; 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 [0, 0; 10, 0] Branch { Points [0, -15] DstBlock "Animation" DstPort 1 } Branch { DstBlock "To Workspace2" DstPort 1 } } Line { SrcBlock "Tank Dynamics" SrcPort 1 Points [0, 0; 5, 0] Branch { Points [145, 0; 0, -100] Branch { DstBlock "Scope" DstPort 1 } Branch { Points [-505, 0; 0, 50] Branch { Points [0, 110] 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 "Out Valve" SrcPort 1 DstBlock "Tank Dynamics" DstPort 2 } Line { SrcBlock "Out Valve" SrcPort 3 Points [15, 0; 0, 50] DstBlock "To Workspace" DstPort 1 } } } MatData { NumRecords 2 DataRecord { Tag DataTag1 Data " %)30 . N , 8 ( @ % " "\" $ ! 0 % 0 $0 $ #, =F5R:69Y0FQK4&%T:', !V97)I" "9GE\";&M(86YD;&5S '9N=DUG 86-T:79E1W)O=7 !R97%$:7-P4')C" ";G0 &)L:T1I #@ # " " & \" 0 !0 @ ! @ $ $ \" &]N . N 0 " " 8 ( @ % \" $ ! 0 % 0 \"@ $ \"\" " " >$1A=&$ 'E$871A !S=&5P6