Model { Name "lcodi" Version 3.00 SimParamPage "Solver" SampleTimeColors off InvariantConstants off WideVectorLines off ShowLineWidths off ShowPortDataTypes off StartTime "0.0" StopTime "20" SolverMode "SingleTasking" Solver "ode45" RelTol "1e-3" AbsTol "1e-3" Refine "1" MaxStep ".010" InitialStep "auto" FixedStep "auto" MaxOrder 5 OutputOption "RefineOutputTimes" OutputTimes "[]" LoadExternalInput off ExternalInput "[t, u]" SaveTime on TimeSaveName "t" SaveState off StateSaveName "xout" SaveOutput off 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 "warning" UnnecessaryDatatypeConvMsg "none" Int32ToFloatConvMsg "warning" SignalLabelMismatchMsg "none" ConsistencyChecking "off" ZeroCross on SimulationMode "normal" BlockDataTips on BlockParametersDataTip on BlockAttributesDataTip off BlockPortWidthsDataTip off BlockDescriptionStringDataTip off BlockMaskParametersDataTip off ToolBar on StatusBar on 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 Created "Tue Jan 18 19:50:27 2000" UpdateHistory "UpdateHistoryNever" ModifiedByFormat "%" ModifiedDateFormat "%" LastModifiedDate "Tue Jan 18 19:55:34 2000" 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 "lcodi" Location [2, 74, 802, 558] Open on ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" AutoZoom on ReportName "simulink-default.rpt" Block { BlockType SubSystem Name "Band-Limited\nWhite Noise" Ports [0, 1, 0, 0, 0] Position [405, 156, 460, 194] Orientation "left" BackgroundColor "cyan" DropShadow on FontName "Arial" FontSize 14 ShowPortLabels off MaskType "Continuous White Noise." MaskDescription "White noise for continuous (s-domain) systems." "\nBand-limited using zero-order-hold." MaskHelp "Implemented using white noise into Zero-Order H" "old block. The seed and power can be vectors of the same length to produce 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 system." MaskPromptString "Noise Power:|Sample Time:|Seed" MaskStyleString "edit,edit,edit" MaskTunableValueString "on,on,on" MaskCallbackString "||" MaskEnableString "on,on,on" MaskVisibilityString "on,on,on" MaskInitialization "Cov = @1; Ts = @2; seed = @3; r = rand(1,12); r" "2 = [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]|0.1|[23341]" System { Name "Band-Limited\nWhite Noise" Location [56, 339, 341, 468] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "blue" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" AutoZoom on Block { BlockType Gain Name "Gain" Position [155, 31, 195, 69] Gain "[sqrt(Cov)]/[sqrt(Ts)]" SaturateOnIntegerOverflow on } Block { BlockType RandomNumber Name "White Noise" Position [25, 40, 45, 60] Mean "0" Variance "1" Seed "seed" SampleTime "0" } 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] Port "1" OutputWhenDisabled "held" InitialOutput "0" } Line { SrcBlock "White Noise" SrcPort 1 DstBlock "Zero-Order\nHold" DstPort 1 } Line { SrcBlock "Gain" SrcPort 1 DstBlock "Out_1" DstPort 1 } Line { SrcBlock "Zero-Order\nHold" SrcPort 1 DstBlock "Gain" DstPort 1 } } } Block { BlockType SubSystem Name "Band-Limited\nWhite Noise1" Ports [0, 1, 0, 0, 0] Position [405, 330, 465, 370] Orientation "left" BackgroundColor "cyan" DropShadow on FontName "Arial" FontSize 14 ShowPortLabels off MaskType "Continuous White Noise." MaskDescription "White noise for continuous (s-domain) systems." "\nBand-limited using zero-order-hold." MaskHelp "Implemented using white noise into Zero-Order H" "old block. The seed and power can be vectors of the same length to produce 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 system." MaskPromptString "Noise Power:|Sample Time:|Seed" MaskStyleString "edit,edit,edit" MaskTunableValueString "on,on,on" MaskCallbackString "||" MaskEnableString "on,on,on" MaskVisibilityString "on,on,on" MaskInitialization "Cov = @1; Ts = @2; seed = @3; r = rand(1,12); r" "2 = [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]|0.1|[23341]" System { Name "Band-Limited\nWhite Noise1" Location [56, 339, 341, 468] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "blue" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" AutoZoom on Block { BlockType Gain Name "Gain" Position [155, 31, 195, 69] Gain "[sqrt(Cov)]/[sqrt(Ts)]" SaturateOnIntegerOverflow on } Block { BlockType RandomNumber Name "White Noise" Position [25, 40, 45, 60] Mean "0" Variance "1" Seed "seed" SampleTime "0" } 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] Port "1" OutputWhenDisabled "held" InitialOutput "0" } Line { SrcBlock "White Noise" SrcPort 1 DstBlock "Zero-Order\nHold" DstPort 1 } Line { SrcBlock "Gain" SrcPort 1 DstBlock "Out_1" DstPort 1 } Line { SrcBlock "Zero-Order\nHold" SrcPort 1 DstBlock "Gain" DstPort 1 } } } Block { BlockType TransferFcn Name "Continuous PID" Position [130, 15, 280, 75] ForegroundColor "red" DropShadow on FontName "Arial" FontSize 14 Numerator "[88 100 100]" Denominator "[1 15 0]" } Block { BlockType ToWorkspace Name "Disc. error" Position [665, 68, 705, 92] BackgroundColor "green" DropShadow on NamePlacement "alternate" ShowName off FontName "Arial" FontSize 14 VariableName "yerr" Buffer "10000" Decimation "1" SampleTime "0" SaveFormat "Matrix" } Block { BlockType DiscreteTransferFcn Name "Discrete\nPID" Position [135, 239, 270, 311] ForegroundColor "red" DropShadow on FontName "Arial" FontSize 14 Numerator "[88 -166 79]" Denominator "[1 -0.5 -0.5]" SampleTime "0.1" } Block { BlockType Step Name "Dist_i" Position [275, 88, 305, 112] BackgroundColor "cyan" DropShadow on FontName "Arial" FontSize 14 Time "10" Before "0" After "1" SampleTime "0" } Block { BlockType Step Name "Dist_i1" Position [185, 188, 215, 212] BackgroundColor "cyan" DropShadow on FontName "Arial" FontSize 14 Time "10" Before "0" After "1" SampleTime "0" } Block { BlockType Step Name "Dist_o" Position [430, 98, 460, 122] BackgroundColor "cyan" DropShadow on FontName "Arial" FontSize 14 Time "1" Before "0" After "0" SampleTime "0" } Block { BlockType Step Name "Dist_o1" Position [490, 328, 520, 352] BackgroundColor "cyan" DropShadow on FontName "Arial" FontSize 14 Time "1" Before "0" After "0" SampleTime "0" } Block { BlockType StateSpace Name "HP filter" Position [315, 157, 370, 193] Orientation "left" BackgroundColor "cyan" DropShadow on FontName "Arial" FontSize 14 A "at" B "bt" C "ct" D "dt" X0 "0" MaskType "buttap,lp2hp" MaskDescription "Analog Butterworth high pass filter.\n\n(Requir" "es Signal Processing Toolbox)" MaskHelp "Butterworth high pass filter using MATLAB's but" "ter and lp2hp commands." MaskPromptString "Cutoff frequency (rad/sec):|Order" MaskStyleString "edit,edit" MaskTunableValueString "on,on" MaskCallbackString "|" MaskEnableString "on,on" MaskVisibilityString "on,on" MaskInitialization "[at,bt,ct,dt,w,mag]=filtm('buttap','lp2hp',@1,[" "],20,@2);" MaskDisplay "plot(w,mag)" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" MaskValueString "5|4" } Block { BlockType StateSpace Name "HP filter1" Position [315, 332, 370, 368] Orientation "left" BackgroundColor "cyan" DropShadow on FontName "Arial" FontSize 14 A "at" B "bt" C "ct" D "dt" X0 "0" MaskType "buttap,lp2hp" MaskDescription "Analog Butterworth high pass filter.\n\n(Requir" "es Signal Processing Toolbox)" MaskHelp "Butterworth high pass filter using MATLAB's but" "ter and lp2hp commands." MaskPromptString "Cutoff frequency (rad/sec):|Order" MaskStyleString "edit,edit" MaskTunableValueString "on,on" MaskCallbackString "|" MaskEnableString "on,on" MaskVisibilityString "on,on" MaskInitialization "[at,bt,ct,dt,w,mag]=filtm('buttap','lp2hp',@1,[" "],20,@2);" MaskDisplay "plot(w,mag)" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" MaskValueString "5|4" } Block { BlockType Mux Name "Mux" Ports [3, 1, 0, 0, 0] Position [665, 123, 710, 197] ForegroundColor "green" DropShadow on ShowName off FontName "Arial" FontSize 14 Inputs "3" DisplayOption "none" } Block { BlockType ZeroPole Name "Plant" Position [365, 25, 440, 85] BackgroundColor "yellow" DropShadow on FontName "Arial" FontSize 14 Zeros "[]" Poles "[1; 1]" Gain "[1]" } Block { BlockType ZeroPole Name "Plant1" Position [435, 238, 515, 292] BackgroundColor "yellow" DropShadow on FontName "Arial" FontSize 14 Zeros "[]" Poles "[1; 1]" Gain "[1]" } Block { BlockType Step Name "Ref" Position [15, 23, 45, 47] BackgroundColor "cyan" DropShadow on FontName "Arial" FontSize 14 Time "1" Before "0" After "1" SampleTime "0" } Block { BlockType Scope Name "Scope2" Ports [1, 0, 0, 0, 0] Position [730, 131, 770, 189] BackgroundColor "green" DropShadow on ShowName off FontName "Arial" FontSize 14 Floating off Location [464, 149, 795, 463] Open off NumInputPorts "1" TickLabels "on" ZoomMode "on" List { ListType AxesTitles axes1 "%" } Grid "on" TimeRange "20.000000" YMin "-0.4" YMax "0.4" SaveToWorkspace off SaveName "ScopeData" DataFormat "Matrix" LimitMaxRows on MaxRows "5000" Decimation "1" SampleInput off SampleTime "0" } Block { BlockType Sum Name "Sum" Ports [2, 1, 0, 0, 0] Position [90, 26, 110, 64] ForegroundColor "red" DropShadow on ShowName off FontName "Arial" FontSize 14 IconShape "rectangular" Inputs "+-" SaturateOnIntegerOverflow on } Block { BlockType Sum Name "Sum1" Ports [2, 1, 0, 0, 0] Position [485, 47, 505, 78] BackgroundColor "yellow" DropShadow on ShowName off FontName "Arial" FontSize 14 IconShape "rectangular" Inputs "++" SaturateOnIntegerOverflow on } Block { BlockType Sum Name "Sum2" Ports [2, 1, 0, 0, 0] Position [245, 141, 265, 179] Orientation "left" BackgroundColor "yellow" DropShadow on ShowName off FontName "Arial" FontSize 14 IconShape "rectangular" Inputs "++" SaturateOnIntegerOverflow on } Block { BlockType Sum Name "Sum3" Ports [2, 1, 0, 0, 0] Position [325, 36, 345, 74] BackgroundColor "yellow" DropShadow on ShowName off FontName "Arial" FontSize 14 IconShape "rectangular" Inputs "++" SaturateOnIntegerOverflow on } Block { BlockType Sum Name "Sum4" Ports [2, 1, 0, 0, 0] Position [80, 257, 100, 293] ForegroundColor "red" DropShadow on ShowName off FontName "Arial" FontSize 14 IconShape "rectangular" Inputs "+-" SaturateOnIntegerOverflow on } Block { BlockType Sum Name "Sum5" Ports [2, 1, 0, 0, 0] Position [240, 387, 260, 423] Orientation "left" BackgroundColor "yellow" DropShadow on ShowName off FontName "Arial" FontSize 14 IconShape "rectangular" Inputs "++" SaturateOnIntegerOverflow on } Block { BlockType Sum Name "Sum6" Ports [2, 1, 0, 0, 0] Position [560, 255, 580, 290] BackgroundColor "yellow" DropShadow on ShowName off FontName "Arial" FontSize 14 IconShape "rectangular" Inputs "++" SaturateOnIntegerOverflow on } Block { BlockType Sum Name "Sum7" Ports [2, 1, 0, 0, 0] Position [315, 244, 335, 286] BackgroundColor "yellow" DropShadow on ShowName off FontName "Arial" FontSize 14 IconShape "rectangular" Inputs "++" SaturateOnIntegerOverflow on } Block { BlockType Sum Name "Sum8" Ports [2, 1, 0, 0, 0] Position [610, 140, 630, 175] BackgroundColor "green" DropShadow on ShowName off FontName "Arial" FontSize 14 IconShape "rectangular" Inputs "+-" SaturateOnIntegerOverflow on } Block { BlockType ToWorkspace Name "To Workspace" Position [560, 53, 600, 77] BackgroundColor "green" DropShadow on ShowName off FontName "Arial" FontSize 14 VariableName "y_c" Buffer "10000" Decimation "1" SampleTime "0" SaveFormat "Matrix" } Block { BlockType ToWorkspace Name "To Workspace1" Position [625, 262, 665, 288] BackgroundColor "green" DropShadow on ShowName off FontName "Arial" FontSize 14 VariableName "y_d" Buffer "10000" Decimation "1" SampleTime "0" SaveFormat "Matrix" } Block { BlockType ZeroOrderHold Name "Zero-Order\nHold" Position [365, 249, 400, 281] BackgroundColor "magenta" DropShadow on FontName "Arial" FontSize 14 SampleTime "0.1" } Line { SrcBlock "Sum" SrcPort 1 DstBlock "Continuous PID" DstPort 1 } Line { SrcBlock "Sum3" SrcPort 1 DstBlock "Plant" DstPort 1 } Line { SrcBlock "Mux" SrcPort 1 DstBlock "Scope2" DstPort 1 } Line { SrcBlock "Sum2" SrcPort 1 Points [-170, 0; 0, -105] DstBlock "Sum" DstPort 2 } Line { SrcBlock "Sum1" SrcPort 1 Points [5, 0; 0, 0] Branch { DstBlock "To Workspace" DstPort 1 } Branch { Points [0, 85] Branch { DstBlock "Sum2" DstPort 1 } Branch { Points [65, 0] Branch { DstBlock "Sum8" DstPort 1 } Branch { Points [0, -15] DstBlock "Mux" DstPort 1 } } } } Line { SrcBlock "Sum8" SrcPort 1 Points [5, 0; 0, -5] Branch { Points [0, -75] DstBlock "Disc. error" DstPort 1 } Branch { Points [0, 5] DstBlock "Mux" DstPort 2 } } Line { SrcBlock "Sum4" SrcPort 1 DstBlock "Discrete\nPID" DstPort 1 } Line { SrcBlock "Sum5" SrcPort 1 Points [-180, 0; 0, -120] DstBlock "Sum4" DstPort 2 } Line { SrcBlock "Band-Limited\nWhite Noise1" SrcPort 1 DstBlock "HP filter1" DstPort 1 } Line { SrcBlock "HP filter" SrcPort 1 Points [0, -5] DstBlock "Sum2" DstPort 2 } Line { SrcBlock "Plant" SrcPort 1 DstBlock "Sum1" DstPort 1 } Line { SrcBlock "Dist_o" SrcPort 1 Points [0, -40] DstBlock "Sum1" DstPort 2 } Line { SrcBlock "Continuous PID" SrcPort 1 DstBlock "Sum3" DstPort 1 } Line { SrcBlock "Dist_i" SrcPort 1 DstBlock "Sum3" DstPort 2 } Line { SrcBlock "HP filter1" SrcPort 1 Points [-35, 0] DstBlock "Sum5" DstPort 1 } Line { SrcBlock "Sum6" SrcPort 1 Points [10, 0; 0, 10] Branch { Points [0, 130] DstBlock "Sum5" DstPort 2 } Branch { Points [0, -10] DstBlock "To Workspace1" DstPort 1 } Branch { Points [0, -95] Branch { DstBlock "Sum8" DstPort 2 } Branch { Points [0, -5] DstBlock "Mux" DstPort 3 } } } Line { SrcBlock "Band-Limited\nWhite Noise" SrcPort 1 DstBlock "HP filter" DstPort 1 } Line { SrcBlock "Sum7" SrcPort 1 DstBlock "Zero-Order\nHold" DstPort 1 } Line { SrcBlock "Discrete\nPID" SrcPort 1 DstBlock "Sum7" DstPort 2 } Line { SrcBlock "Dist_i1" SrcPort 1 Points [80, 0] DstBlock "Sum7" DstPort 1 } Line { SrcBlock "Dist_o1" SrcPort 1 Points [0, -60] DstBlock "Sum6" DstPort 2 } Line { SrcBlock "Zero-Order\nHold" SrcPort 1 DstBlock "Plant1" DstPort 1 } Line { SrcBlock "Plant1" SrcPort 1 DstBlock "Sum6" DstPort 1 } Line { SrcBlock "Ref" SrcPort 1 Points [10, 0] Branch { DstBlock "Sum" DstPort 1 } Branch { Points [-10, 0; 0, 230] DstBlock "Sum4" DstPort 1 } } Annotation { Position [367, 438] VerticalAlignment "top" ForegroundColor "blue" Text "COMPARISON OF DIGITAL AND ANALOGUE CONTROL OF A" "N UNSTABLE CONTINUOUS TIME PLANT " DropShadow on FontName "Arial" FontSize 14 } } }