Model { Name "cpc_drug" Version 5.0 SaveDefaultBlockParams on SampleTimeColors off LibraryLinkDisplay "none" WideLines off ShowLineDimensions off ShowPortDataTypes off ShowLoopsOnError on IgnoreBidirectionalLines off ShowStorageClass off ExecutionOrder off RecordCoverage off CovPath "/" CovSaveName "covdata" CovMetricSettings "dw" CovNameIncrementing off CovHtmlReporting on covSaveCumulativeToWorkspaceVar on CovSaveSingleToWorkspaceVar on CovCumulativeVarName "covCumulativeData" CovCumulativeReport off DataTypeOverride "UseLocalSettings" MinMaxOverflowLogging "UseLocalSettings" MinMaxOverflowArchiveMode "Overwrite" BlockNameDataTip off BlockParametersDataTip off BlockDescriptionStringDataTip off ToolBar on StatusBar on BrowserShowLibraryLinks off BrowserLookUnderMasks off Created "Fri Feb 28 16:31:54 2003" UpdateHistory "UpdateHistoryNever" ModifiedByFormat "%" LastModifiedBy "Cesar C. Palerm" ModifiedDateFormat "%" LastModifiedDate "Fri Feb 28 16:32:17 2003" ModelVersionFormat "1.%" ConfigurationManager "None" SimParamPage "Solver" LinearizationMsg "none" Profile off ParamWorkspaceSource "MATLABWorkspace" AccelSystemTargetFile "accel.tlc" AccelTemplateMakefile "accel_default_tmf" AccelMakeCommand "make_rtw" TryForcingSFcnDF off ExtModeMexFile "ext_comm" ExtModeBatchMode off ExtModeTrigType "manual" ExtModeTrigMode "normal" 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 on ExtModeSkipDownloadWhenConnect off ExtModeLogAll on ExtModeAutoUpdateStatusClock on BufferReuse on RTWExpressionDepthLimit 5 SimulationMode "normal" Solver "ode45" SolverMode "SingleTasking" StartTime "0.0" StopTime "20" MaxOrder 5 MaxStep "auto" MinStep "auto" MaxNumMinSteps "-1" InitialStep "auto" FixedStep "auto" RelTol "1e-3" AbsTol "1e-6" OutputOption "RefineOutputTimes" OutputTimes "[]" Refine "1" LoadExternalInput off ExternalInput "[t, u]" LoadInitialState off InitialState "xInitial" SaveTime off TimeSaveName "tout" SaveState off StateSaveName "xout" SaveOutput off OutputSaveName "yout" SaveFinalState off FinalStateName "xFinal" SaveFormat "Array" Decimation "1" LimitDataPoints off MaxDataPoints "1000" SignalLoggingName "sigsOut" ConsistencyChecking "none" ArrayBoundsChecking "none" AlgebraicLoopMsg "warning" BlockPriorityViolationMsg "warning" MinStepSizeMsg "warning" InheritedTsInSrcMsg "warning" DiscreteInheritContinuousMsg "warning" MultiTaskRateTransMsg "error" SingleTaskRateTransMsg "none" CheckForMatrixSingularity "none" IntegerOverflowMsg "warning" Int32ToFloatConvMsg "warning" ParameterDowncastMsg "error" ParameterOverflowMsg "error" ParameterPrecisionLossMsg "warning" UnderSpecifiedDataTypeMsg "none" UnnecessaryDatatypeConvMsg "none" VectorMatrixConversionMsg "none" InvalidFcnCallConnMsg "error" SignalLabelMismatchMsg "none" UnconnectedInputMsg "warning" UnconnectedOutputMsg "warning" UnconnectedLineMsg "warning" SfunCompatibilityCheckMsg "none" RTWInlineParameters off BlockReductionOpt on BooleanDataType off ConditionallyExecuteInputs on ParameterPooling on OptimizeBlockIOStorage on ZeroCross on AssertionControl "UseLocalSettings" ProdHWDeviceType "Microprocessor" ProdHWWordLengths "8,16,32,32" RTWSystemTargetFile "grt.tlc" RTWTemplateMakefile "grt_default_tmf" RTWMakeCommand "make_rtw" RTWGenerateCodeOnly off RTWRetainRTWFile off TLCProfiler off TLCDebug off TLCCoverage off TLCAssertion off BlockDefaults { Orientation "right" ForegroundColor "black" BackgroundColor "white" DropShadow off NamePlacement "normal" FontName "Helvetica" FontSize 10 FontWeight "normal" FontAngle "normal" ShowName on } BlockParameterDefaults { Block { BlockType Clock DisplayTime off } Block { BlockType Constant Value "1" VectorParams1D on ShowAdditionalParam off OutDataTypeMode "Inherit from 'Constant value'" OutDataType "sfix(16)" ConRadixGroup "Use specified scaling" OutScaling "2^0" } Block { BlockType Demux Outputs "4" DisplayOption "none" BusSelectionMode off } Block { BlockType Gain Gain "1" Multiplication "Element-wise(K.*u)" ShowAdditionalParam off 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 } Block { BlockType Inport Port "1" PortDimensions "-1" SampleTime "-1" ShowAdditionalParam off LatchInput off DataType "auto" OutDataType "sfix(16)" OutScaling "2^0" SignalType "auto" SamplingMode "auto" Interpolate on } Block { BlockType Mux Inputs "4" DisplayOption "none" } Block { BlockType Outport Port "1" OutputWhenDisabled "held" InitialOutput "[]" } Block { BlockType RandomNumber Mean "0" Variance "1" Seed "0" SampleTime "-1" VectorParams1D on } Block { BlockType Saturate UpperLimit "0.5" LowerLimit "-0.5" LinearizeAsGain on ZeroCross on } Block { BlockType StateSpace A "1" B "1" C "1" D "1" X0 "0" AbsoluteTolerance "auto" Realization "auto" } Block { BlockType Step Time "1" Before "0" After "1" SampleTime "-1" VectorParams1D on ZeroCross on } Block { BlockType SubSystem ShowPortLabels on Permissions "ReadWrite" RTWSystemCode "Auto" RTWFcnNameOpts "Auto" RTWFileNameOpts "Auto" SimViewingDevice off DataTypeOverride "UseLocalSettings" MinMaxOverflowLogging "UseLocalSettings" } Block { BlockType Sum IconShape "rectangular" Inputs "++" ShowAdditionalParam off InputSameDT on OutDataTypeMode "Same as first input" OutDataType "sfix(16)" OutScaling "2^0" LockScale off RndMeth "Floor" SaturateOnIntegerOverflow on } Block { BlockType Switch Criteria "u2 >= Threshold" Threshold "0" ShowAdditionalParam off InputSameDT on OutDataTypeMode "Inherit via internal rule" RndMeth "Floor" SaturateOnIntegerOverflow on ZeroCross on } Block { BlockType ToWorkspace VariableName "simulink_output" MaxDataPoints "1000" Decimation "1" SampleTime "0" } Block { BlockType TransferFcn Numerator "[1]" Denominator "[1 2 1]" AbsoluteTolerance "auto" Realization "auto" } Block { BlockType TransportDelay DelayTime "1" InitialInput "0" BufferSize "1024" PadeOrder "0" TransDelayFeedthrough off } Block { BlockType ZeroOrderHold SampleTime "1" } } 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 "cpc_drug" Location [475, 597, 1043, 898] Open on ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" ReportName "simulink-default.rpt" Block { BlockType ToWorkspace Name "Cardiac output,\nml/min/kg" Position [430, 182, 480, 198] VariableName "CO" MaxDataPoints "5000" SaveFormat "Array" } Block { BlockType Clock Name "Clock" Position [245, 40, 265, 60] DeleteFcn "simclock BlockIsBeingDestroyed" PostSaveFcn "simclock Save" Decimation "10" } Block { BlockType Constant Name "Disturbance flag for later use.\n(Keep at value" " 0 until then)" Position [235, 230, 255, 250] Value "0" } Block { BlockType Step Name "Dopamine\nug/kg/min" Position [150, 175, 170, 195] Time "0" After "0" } Block { BlockType ToWorkspace Name "Mean arterial pressure,\nmmHg" Position [430, 102, 480, 118] VariableName "MAP" MaxDataPoints "5000" SaveFormat "Array" } Block { BlockType Step Name "Nitroprusside\nug/kg/min" Position [150, 105, 170, 125] Time "0" After "0" } Block { BlockType SubSystem Name "Patient" Ports [3, 2] Position [305, 122, 335, 178] ShowPortLabels off TreatAsAtomicUnit off MaskType "Patient" MaskDescription "Patient in intensive care." MaskHelp "This block simulates the behavior of a patient " "under normal and cardiac-arrest conditions. It is necessary to keep the mean " "arterial pressure (MAP) and the cardiac output (CO) at desired values using t" "he two drugs NP and DP. A cardiac-arrest can be simulated by turning \"on\" " "the third input." MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" System { Name "Patient" Location [60, 62, 861, 420] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Block { BlockType Inport Name "in_1" Position [30, 95, 50, 115] ForegroundColor "red" } Block { BlockType Inport Name "in_2" Position [30, 175, 50, 195] ForegroundColor "green" Port "2" } Block { BlockType Inport Name "Disturbance" Position [30, 280, 50, 300] ForegroundColor "blue" Port "3" } Block { BlockType Gain Name "10 % loss\nin elastance" Position [145, 223, 185, 247] ForegroundColor "blue" Gain "0.1" } Block { BlockType Constant Name "CO,ss" Position [530, 230, 550, 250] Value "130" } Block { BlockType Constant Name "Constant1" Position [150, 295, 170, 315] ForegroundColor "blue" Value "0" } Block { BlockType Constant Name "DP, base" Position [25, 224, 65, 246] ForegroundColor "green" Value "0" } Block { BlockType TransportDelay Name "Delay" Position [265, 120, 305, 150] } Block { BlockType TransportDelay Name "Delay1" Position [265, 175, 305, 205] DelayTime "1.75" } Block { BlockType SubSystem Name "Flowmeter Noise" Ports [0, 1] Position [540, 292, 585, 328] ShowPortLabels off TreatAsAtomicUnit off MaskType "Continuous White Noise." MaskDescription "White noise for continuous (s-domain) syste" "ms.\nBand-limited using zero-order-hold." MaskHelp "Implemented using white noise into Zero-Ord" "er Hold block. The seed and power can be vectors of the same length to produc" "e a vector of white noise sources. For faster simulation, set sample time to " "the highest value possible but in accordance with the fastest dynamics of sys" "tem." MaskPromptString "Noise Power:|Sample Time:|Seed" MaskStyleString "edit,edit,edit" MaskTunableValueString "on,on,on" MaskCallbackString "||" MaskEnableString "on,on,on" MaskVisibilityString "on,on,on" MaskToolTipString "on,on,on" MaskVarAliasString ",," MaskInitialization "Cov = @1; Ts = @2; seed = @3; r = rand(1,12" "); r2 = [r(1),r;r,r(12)]; t =[1:13;1:13];" MaskDisplay "plot(t(:),r2(:))" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" MaskValueString "[0.01]|0.1|[231]" System { Name "Flowmeter Noise" Location [54, 332, 339, 461] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Block { BlockType Gain Name "Gain" Position [155, 31, 195, 69] Gain "[sqrt(Cov)]/[sqrt(Ts)]" } Block { BlockType RandomNumber Name "White Noise" Position [25, 40, 45, 60] Seed "seed" } Block { BlockType ZeroOrderHold Name "Zero-Order\nHold" Position [85, 34, 120, 66] SampleTime "Ts" } Block { BlockType Outport Name "Out_1" Position [230, 40, 250, 60] } Line { SrcBlock "Zero-Order\nHold" SrcPort 1 DstBlock "Gain" DstPort 1 } Line { SrcBlock "Gain" SrcPort 1 DstBlock "Out_1" DstPort 1 } Line { SrcBlock "White Noise" SrcPort 1 DstBlock "Zero-Order\nHold" DstPort 1 } } } Block { BlockType Constant Name "MAP,ss" Position [535, 115, 555, 135] Value "120" } Block { BlockType Constant Name "NP, base" Position [30, 54, 70, 76] ForegroundColor "red" Value "0" } Block { BlockType Saturate Name "Saturation" Position [135, 88, 165, 112] ForegroundColor "red" UpperLimit "10" LowerLimit "0" } Block { BlockType Saturate Name "Saturation1" Position [135, 178, 165, 202] ForegroundColor "green" UpperLimit "10" LowerLimit "0" } Block { BlockType StateSpace Name "State-Space" Position [415, 170, 475, 210] A "[-1.4993 0 0 0 0;0 -1.4993 0 0 0;0 0 -0.500" "0 0 0;0 0 0 -0.2000 0;0 0 0 0 -0.1429]" B "[1 0 0;1 0 0;0 1 0;0 1 0;0 0 1]" C "[-8.9955 0 1.5000 0 -2.8571;0 17.9910 " " 0 1.0000 -7.1429]" D "[0 0 0;0 0 0]" X0 "[0 0 0 0 0]" } Block { BlockType Sum Name "Sum1" Ports [3, 1] Position [655, 107, 675, 143] Inputs "+++" } Block { BlockType Sum Name "Sum2" Ports [3, 1] Position [655, 222, 675, 258] Inputs "+++" } Block { BlockType Sum Name "Sum3" Ports [2, 1] Position [90, 90, 110, 110] ForegroundColor "red" Inputs "-+" } Block { BlockType Sum Name "Sum4" Ports [2, 1] Position [85, 180, 105, 200] ForegroundColor "green" Inputs "+-" } Block { BlockType Switch Name "Switch" Position [235, 259, 265, 291] ForegroundColor "blue" Threshold "1" } Block { BlockType SubSystem Name "Transducer Noise" Ports [0, 1] Position [530, 57, 575, 93] ShowPortLabels off TreatAsAtomicUnit off MaskType "Continuous White Noise." MaskDescription "White noise for continuous (s-domain) syste" "ms.\nBand-limited using zero-order-hold." MaskHelp "Implemented using white noise into Zero-Ord" "er Hold block. The seed and power can be vectors of the same length to produc" "e a vector of white noise sources. For faster simulation, set sample time to " "the highest value possible but in accordance with the fastest dynamics of sys" "tem." MaskPromptString "Noise Power:|Sample Time:|Seed" MaskStyleString "edit,edit,edit" MaskTunableValueString "on,on,on" MaskCallbackString "||" MaskEnableString "on,on,on" MaskVisibilityString "on,on,on" MaskToolTipString "on,on,on" MaskVarAliasString ",," MaskInitialization "Cov = @1; Ts = @2; seed = @3; r = rand(1,12" "); r2 = [r(1),r;r,r(12)]; t =[1:13;1:13];" MaskDisplay "plot(t(:),r2(:))" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" MaskValueString "[0.01]|0.08|[100]" System { Name "Transducer Noise" Location [54, 332, 339, 461] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Block { BlockType Gain Name "Gain" Position [155, 31, 195, 69] Gain "[sqrt(Cov)]/[sqrt(Ts)]" } Block { BlockType RandomNumber Name "White Noise" Position [25, 40, 45, 60] Seed "seed" } Block { BlockType ZeroOrderHold Name "Zero-Order\nHold" Position [85, 34, 120, 66] SampleTime "Ts" } Block { BlockType Outport Name "Out_1" Position [230, 40, 250, 60] } Line { SrcBlock "Zero-Order\nHold" SrcPort 1 DstBlock "Gain" DstPort 1 } Line { SrcBlock "Gain" SrcPort 1 DstBlock "Out_1" DstPort 1 } Line { SrcBlock "White Noise" SrcPort 1 DstBlock "Zero-Order\nHold" DstPort 1 } } } Block { BlockType Demux Name "[MAP;CO]" Ports [1, 2] Position [495, 170, 535, 205] Outputs "2" } Block { BlockType Mux Name "[u1;u2;d]" Ports [3, 1] Position [360, 168, 395, 212] Inputs "3" } Block { BlockType TransferFcn Name "lag" Position [190, 80, 240, 120] ForegroundColor "red" Denominator "[0.1 1]" } Block { BlockType TransferFcn Name "lag1" Position [190, 173, 240, 207] ForegroundColor "green" Denominator "[0.5 1]" } Block { BlockType Outport Name "MAP, mmHg" Position [715, 115, 735, 135] } Block { BlockType Outport Name "CO, ml/min/kg" Position [720, 190, 740, 210] Port "2" } Line { SrcBlock "State-Space" SrcPort 1 DstBlock "[MAP;CO]" DstPort 1 } Line { SrcBlock "[u1;u2;d]" SrcPort 1 DstBlock "State-Space" DstPort 1 } Line { SrcBlock "MAP,ss" SrcPort 1 DstBlock "Sum1" DstPort 2 } Line { SrcBlock "in_1" SrcPort 1 DstBlock "Sum3" DstPort 2 } Line { SrcBlock "in_2" SrcPort 1 DstBlock "Sum4" DstPort 1 } Line { SrcBlock "DP, base" SrcPort 1 Points [0, 0] DstBlock "Sum4" DstPort 2 } Line { SrcBlock "Sum1" SrcPort 1 DstBlock "MAP, mmHg" DstPort 1 } Line { SrcBlock "CO,ss" SrcPort 1 DstBlock "Sum2" DstPort 2 } Line { SrcBlock "Sum2" SrcPort 1 Points [10, 0; 0, -40] DstBlock "CO, ml/min/kg" DstPort 1 } Line { SrcBlock "10 % loss\nin elastance" SrcPort 1 Points [15, 0; 0, 30] DstBlock "Switch" DstPort 1 } Line { SrcBlock "Switch" SrcPort 1 Points [40, 0; 0, -70] DstBlock "[u1;u2;d]" DstPort 3 } Line { SrcBlock "Sum3" SrcPort 1 DstBlock "Saturation" DstPort 1 } Line { SrcBlock "Saturation" SrcPort 1 DstBlock "lag" DstPort 1 } Line { SrcBlock "Sum4" SrcPort 1 DstBlock "Saturation1" DstPort 1 } Line { SrcBlock "Saturation1" SrcPort 1 DstBlock "lag1" DstPort 1 } Line { SrcBlock "NP, base" SrcPort 1 Points [0, 0] DstBlock "Sum3" DstPort 1 } Line { SrcBlock "Constant1" SrcPort 1 Points [20, 0; 0, -20] DstBlock "Switch" DstPort 3 } Line { SrcBlock "Delay" SrcPort 1 Points [15, 0; 0, 40] DstBlock "[u1;u2;d]" DstPort 1 } Line { SrcBlock "Delay1" SrcPort 1 DstBlock "[u1;u2;d]" DstPort 2 } Line { SrcBlock "[MAP;CO]" SrcPort 1 Points [45, 0; 0, -45] DstBlock "Sum1" DstPort 3 } Line { SrcBlock "[MAP;CO]" SrcPort 2 Points [45, 0; 0, 35] DstBlock "Sum2" DstPort 1 } Line { SrcBlock "lag" SrcPort 1 Points [5, 0] DstBlock "Delay" DstPort 1 } Line { SrcBlock "lag1" SrcPort 1 DstBlock "Delay1" DstPort 1 } Line { SrcBlock "Transducer Noise" SrcPort 1 Points [30, 0; 0, 40] DstBlock "Sum1" DstPort 1 } Line { SrcBlock "Flowmeter Noise" SrcPort 1 Points [25, 0; 0, -60] DstBlock "Sum2" DstPort 3 } Line { SrcBlock "Disturbance" SrcPort 1 Points [0, 0] Branch { Points [80, 0; 0, -15] DstBlock "Switch" DstPort 2 } Branch { Points [35, 0; 0, -55] DstBlock "10 % loss\nin elastance" DstPort 1 } } } } Block { BlockType ToWorkspace Name "To Workspace" Position [340, 38, 365, 62] VariableName "t" MaxDataPoints "5000" SaveFormat "Array" } Line { SrcBlock "Nitroprusside\nug/kg/min" SrcPort 1 Points [55, 0; 0, 15] DstBlock "Patient" DstPort 1 } Line { SrcBlock "Clock" SrcPort 1 DstBlock "To Workspace" DstPort 1 } Line { SrcBlock "Patient" SrcPort 1 Points [45, 0; 0, -25] DstBlock "Mean arterial pressure,\nmmHg" DstPort 1 } Line { SrcBlock "Patient" SrcPort 2 Points [35, 0; 0, 25] DstBlock "Cardiac output,\nml/min/kg" DstPort 1 } Line { SrcBlock "Dopamine\nug/kg/min" SrcPort 1 Points [55, 0; 0, -35] DstBlock "Patient" DstPort 2 } Line { SrcBlock "Disturbance flag for later use.\n(Keep at value" " 0 until then)" SrcPort 1 Points [15, 0; 0, -70] DstBlock "Patient" DstPort 3 } } }