# $Revision: 1.10.4.4 $ Library { Name "discretizing" Version 5.0 SaveDefaultBlockParams on LibraryLinkDisplay "none" ShowLoopsOnError on IgnoreBidirectionalLines off CovSaveName "covdata" CovMetricSettings "dw" CovNameIncrementing off CovHtmlReporting on covSaveCumulativeToWorkspaceVar on CovSaveSingleToWorkspaceVar on CovCumulativeReport off ProdHWCharacteristics "Microprocessor" ProdHWWordLengths "8,16,32,32" ForwardingTableString "||__slOldName__||discretizing/Discretized\n" "Transport Delay 2||__slNewName__||discretizing/Discretized\nTransport Delay" BlockNameDataTip off BlockParametersDataTip off BlockDescriptionStringDataTip off ToolBar off StatusBar off BrowserShowLibraryLinks off BrowserLookUnderMasks off PostLoadFcn "sldiscutil('hide_TransportDelay',gcs)" Created "Thu May 13 08:51:40 1999" Creator "lqin" UpdateHistory "UpdateHistoryNever" ModifiedByFormat "%" LastModifiedBy "jwu" ModifiedDateFormat "%" LastModifiedDate "Tue Mar 25 15:12:09 2003" ModelVersionFormat "1.%" ConfigurationManager "none" SimParamPage "Solver" LinearizationMsg "none" Profile off ParamWorkspaceSource "MATLABWorkspace" 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 SimulationMode "normal" 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" 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 Constant Value "1" VectorParams1D on ShowAdditionalParam off OutDataTypeMode "Inherit from 'Constant value'" OutDataType "sfix(16)" ConRadixGroup "Use specified scaling" OutScaling "2^0" } Block { BlockType DigitalClock SampleTime "1" } Block { BlockType DiscretePulseGenerator PulseType "Sample based" Amplitude "1" Period "2" PulseWidth "1" PhaseDelay "0" SampleTime "1" VectorParams1D on } Block { BlockType DiscreteStateSpace A "1" B "1" C "1" D "1" X0 "0" SampleTime "1" Realization "auto" RTWStateStorageClass "Auto" } Block { BlockType DiscreteTransferFcn Numerator "[1]" Denominator "[1 0.5]" SampleTime "1" Realization "auto" RTWStateStorageClass "Auto" } Block { BlockType DiscreteZeroPole Zeros "[1]" Poles "[0 1]" Gain "[1]" SampleTime "1" RTWStateStorageClass "Auto" } Block { BlockType Fcn Expr "sin(u[1])" } 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 Lookup InputValues "[-4:5]" OutputValues " rand(1,10)-0.5" ShowAdditionalParam off LookUpMeth "Interpolation-Extrapolation" OutDataTypeMode "Same as input" OutDataType "sfix(16)" OutScaling "2^0" LockScale off RndMeth "Floor" SaturateOnIntegerOverflow on } Block { BlockType Math Operator "exp" OutputSignalType "auto" } Block { BlockType MultiPortSwitch Inputs "4" ShowAdditionalParam off zeroidx off InputSameDT on OutDataTypeMode "Inherit via internal rule" RndMeth "Floor" SaturateOnIntegerOverflow on } Block { BlockType Outport Port "1" OutputWhenDisabled "held" InitialOutput "[]" } Block { BlockType Product Inputs "2" Multiplication "Element-wise(.*)" ShowAdditionalParam off InputSameDT on OutDataTypeMode "Same as first input" OutDataType "sfix(16)" OutScaling "2^0" LockScale off RndMeth "Floor" SaturateOnIntegerOverflow on } Block { BlockType "S-Function" FunctionName "system" PortCounts "[]" SFunctionModules "''" } Block { BlockType Sin SineType "Time based" Amplitude "1" Bias "0" Frequency "1" Phase "0" Samples "10" Offset "0" SampleTime "-1" VectorParams1D on } Block { BlockType Step Time "1" Before "0" After "1" SampleTime "-1" VectorParams1D on ZeroCross off } 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 TransportDelay DelayTime "1" InitialInput "0" BufferSize "1024" PadeOrder "0" } Block { BlockType Trigonometry Operator "sin" OutputSignalType "auto" } Block { BlockType UniformRandomNumber Minimum "-1" Maximum "1" Seed "0" SampleTime "-1" VectorParams1D 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 "discretizing_1" Location [195, 78, 692, 544] 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 "Discretized\nChirp Signal" Ports [0, 1] Position [400, 35, 430, 65] TreatAsAtomicUnit off MaskType "discretizedchirp" MaskDescription "Output a linear chirp signal (sine wave whose " "frequency varies linearly with time)." MaskHelp "The chirp signal has linearly increasing freque" "ncy with time. This block can be used for spectral analysis of nonlinear sys" "tems. " MaskPromptString "Initial frequency (Hz):|Target time (secs):|Fre" "quency at target time (Hz):|Interpret vectors parameters as 1-D|Sample Time" MaskStyleString "edit,edit,edit,checkbox,edit" MaskTunableValueString "on,on,on,on,on" MaskCallbackString "||||" MaskEnableString "on,on,on,on,on" MaskVisibilityString "on,on,on,on,on" MaskToolTipString "on,on,on,on,on" MaskVarAliasString ",,,," MaskVariables "f1=@1;T=@2;f2=@3;VectorParams1D=&4;SampleTime=@" "5;" MaskInitialization "t=[0:.1:5];\nset_param([gcb '/startTime'], 'Vec" "torParams1D', VectorParams1D);\nset_param([gcb '/targetTime'], 'VectorParams1" "D', VectorParams1D);\nset_param([gcb '/initialFreq'], 'VectorParams1D', Vecto" "rParams1D);\nset_param([gcb '/deltaFreq'], 'VectorParams1D', VectorParams1D);" "\nst=SampleTime;\nif length(st)>1\n st=SampleTime(1);\nend\nsldiscutil('in" "itchirpmask', st);" MaskDisplay "plot(t,sin(t.*t))" MaskSelfModifiable on MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" MaskValueString "0.1|50|20|on|1" System { Name "Discretized\nChirp Signal" Location [99, 156, 795, 683] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Block { BlockType DigitalClock Name "Digital Clock" Position [255, 128, 285, 152] SampleTime "SampleTime" } Block { BlockType Gain Name "Gain" Position [270, 89, 310, 121] ShowName off Gain "0.5" } Block { BlockType Math Name "Math\nFunction" Ports [1, 1] Position [345, 128, 370, 152] ShowName off Operator "magnitude^2" } Block { BlockType Product Name "Product" Ports [2, 1] Position [270, 181, 290, 219] ShowName off } Block { BlockType Product Name "Product1" Ports [2, 1] Position [395, 169, 415, 211] ShowName off } Block { BlockType Product Name "Product2" Ports [2, 1] Position [200, 58, 220, 147] ShowName off Inputs "*/" } Block { BlockType Product Name "Product3" Ports [2, 1] Position [395, 87, 415, 158] ShowName off } Block { BlockType Sum Name "Sum1" Ports [2, 1] Position [310, 190, 330, 210] ShowName off IconShape "round" Inputs "|-+" } Block { BlockType Sum Name "Sum2" Ports [2, 1] Position [440, 115, 460, 135] ShowName off IconShape "round" Inputs "|++" } Block { BlockType Sum Name "Sum3" Ports [2, 1] Position [155, 115, 175, 135] ShowName off IconShape "round" Inputs "|+-" } Block { BlockType Trigonometry Name "Trigonometric\nFunction" Ports [1, 1] Position [485, 115, 515, 135] ShowName off } Block { BlockType Constant Name "deltaFreq" Position [60, 67, 130, 93] Value "2*pi*(f2-f1)" } Block { BlockType Constant Name "initialFreq" Position [70, 250, 120, 270] Value "2*pi*f1" } Block { BlockType Constant Name "startTime" Position [70, 199, 120, 221] Value "evalin('base',get_param(bdroot(gcb),'StartT" "ime'))" } Block { BlockType Constant Name "targetTime" Position [60, 113, 130, 137] Value "T" } Block { BlockType Outport Name "Out1" Position [545, 118, 575, 132] ShowName off } Line { SrcBlock "Digital Clock" SrcPort 1 Points [0, 0; 30, 0] Branch { Points [0, 40] DstBlock "Product1" DstPort 1 } Branch { DstBlock "Math\nFunction" DstPort 1 } } Line { SrcBlock "Product2" SrcPort 1 Points [0, 0; 15, 0] Branch { DstBlock "Gain" DstPort 1 } Branch { Points [0, 85] DstBlock "Product" DstPort 1 } } Line { SrcBlock "deltaFreq" SrcPort 1 DstBlock "Product2" DstPort 1 } Line { SrcBlock "Sum3" SrcPort 1 DstBlock "Product2" DstPort 2 } Line { SrcBlock "targetTime" SrcPort 1 DstBlock "Sum3" DstPort 1 } Line { SrcBlock "startTime" SrcPort 1 Points [0, 0; 40, 0] Branch { DstBlock "Sum3" DstPort 2 } Branch { DstBlock "Product" DstPort 2 } } Line { SrcBlock "Trigonometric\nFunction" SrcPort 1 DstBlock "Out1" DstPort 1 } Line { SrcBlock "Product" SrcPort 1 DstBlock "Sum1" DstPort 1 } Line { SrcBlock "Sum2" SrcPort 1 DstBlock "Trigonometric\nFunction" DstPort 1 } Line { SrcBlock "Product3" SrcPort 1 DstBlock "Sum2" DstPort 1 } Line { SrcBlock "Product1" SrcPort 1 Points [30, 0] DstBlock "Sum2" DstPort 2 } Line { SrcBlock "Sum1" SrcPort 1 DstBlock "Product1" DstPort 2 } Line { SrcBlock "Gain" SrcPort 1 DstBlock "Product3" DstPort 1 } Line { SrcBlock "Math\nFunction" SrcPort 1 DstBlock "Product3" DstPort 2 } Line { SrcBlock "initialFreq" SrcPort 1 Points [195, 0] DstBlock "Sum1" DstPort 2 } Annotation { Name "freqSlope = deltaFreq/(targetTime - startTi" "me);\ninstantaneousFreq(t) = freqSlope*(t - startTime) + initialFreq;\nintant" "aneousPhase(t) = integral(instFreq) = ...\n 0.5*freqSlope*t^2 + (initial" "Freq - freqSlope*startTime)*t;\noutputSignal(t) = sin(instantaneousPhase(t));" Position [123, 325] HorizontalAlignment "left" FontName "Courier New" FontSize 11 } } } Block { BlockType SubSystem Name "Discretized\nDerivative" Ports [1, 1] Position [50, 143, 85, 177] TreatAsAtomicUnit off MaskType "DiscretizedDerivative" MaskDescription "Continuous mask uses c2d to transform an 's' tr" "ansfer function onto a Discrete Transfer function block inside at the sample " "time specified." MaskPromptString "Method:|Sample time:|Critical Frequency (Hz):" MaskStyleString "popup(zoh|foh|tustin|prewarp|matched),edit,edit" MaskTunableValueString "on,on,on" MaskCallbackString "hidecrit||" MaskEnableString "on,on,on" MaskVisibilityString "on,on,off" MaskToolTipString "on,on,on" MaskVarAliasString ",," MaskVariables "method=&1;SampleTime=@2;Wc=@3;" MaskInitialization "st=SampleTime;\nif length(st)>1\n st=SampleT" "ime(1);\nend\nNumerator = [1 0];\nDenominator = [1];\nif(st>0)\n% if(s" "trcmpi(method, 'zoh') | strcmpi(method, 'foh'))\n% [numd, dend] = sldis" "cutil('disctransferfcn', {st, 'tustin', Wc, Numerator, Denominator});\n%" " else\n [numd, dend] = sldiscutil('disctransferfcn', {st, method, W" "c, Numerator, Denominator});\n% end\nend\ns = get_param(gcb,'maskvalue" "s');\nnums = s{1};\ndens = s{2};\nsldiscutil('initderivativemask', st);" MaskDisplay "text( 0.5, 0.45, 'du/dt', 'horizontalAlignment'" ",'center')\ntext( 0.5, 1.0, method,'verticalAlignment','top')" MaskSelfModifiable on MaskIconFrame on MaskIconOpaque on MaskIconRotate "port" MaskIconUnits "normalized" MaskValueString "tustin|1|1" System { Name "Discretized\nDerivative" Location [178, 282, 584, 474] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Block { BlockType Inport Name "In1" Position [65, 53, 95, 67] } Block { BlockType DiscreteTransferFcn Name "Discrete\nTransfer Fcn" Position [120, 42, 180, 78] Numerator "numd" Denominator "dend" SampleTime "SampleTime" } Block { BlockType Outport Name "Out1" Position [205, 53, 235, 67] } Line { SrcBlock "In1" SrcPort 1 DstBlock "Discrete\nTransfer Fcn" DstPort 1 } Line { SrcBlock "Discrete\nTransfer Fcn" SrcPort 1 DstBlock "Out1" DstPort 1 } } } Block { BlockType SubSystem Name "Discretized\nLTI System" Ports [1, 1] Position [150, 229, 250, 271] TreatAsAtomicUnit off MaskType "DiscretizedLTISystem" MaskDescription "Continuous mask uses c2d to transform parameter" "s onto the Discrete block parameters." MaskPromptString "System (enter in s-domain):|Initial conditions " "(enter in s-domain):|Sample time (enter in s-domain):|Method (enter in s-doma" "in):|Critical frquency(Hz) (enter in s-domain):" MaskStyleString "edit,edit,edit,popup(zoh|foh|tustin|prewarp|mat" "ched|imp),edit" MaskTunableValueString "off,on,on,on,on" MaskCallbackString "|||hidecrit|" MaskEnableString "on,on,on,on,on" MaskVisibilityString "on,on,on,on,off" MaskToolTipString "on,on,on,on,on" MaskVarAliasString ",,,," MaskVariables "sysc=@1;cic=@2;SampleTime=@3;method=&4;Wc=@5;" MaskInitialization "st=SampleTime; \n\n\n\n\n\n\nif length(st)>1 \n" "\n\n\n\n\n\n st=SampleTime(1); \n\n\n\n\n\n\nend \n\n\n\n\n\n\nif(isa(sysc" ",'ss')) \n\n\n\n\n\n\n set_param(gcb, 'MaskEnables',{'on','on','on','on','" "on'}); \n\n\n\n\n\n\nelse \n\n\n\n\n\n\n set_param(gcb, 'MaskEnables'," "{'on','off','on','on','on'}); \n\n\n\n\n\n\nend \n\n\n\n\n\n\n \n\n\n\n\n\n\n" "if st > 0 \n\n\n\n\n\n\n [discsys, discic] = sldiscutil('disclti', {st" ", method, Wc, sysc, cic}); \n\n\n\n\n\n\nelse \n\n\n\n\n\n\n discsys =" " sysc; \n\n\n\n\n\n\n discic = 0; \n\n\n\n\n\n\nend \n\n\n\n\n\n\n \n" "\n\n\n\n\n\nltiblk = sprintf('%s/LTI System',gcb); \n\n\n\n\n\n\ntry \n\n\n\n" "\n\n\n% set_param(ltiblk, 'sys', 'discsys'); \n\n\n\n\n\n\nset_param(ltiblk, " "'IC', 'discic'); \n\n\n\n\n\n\ncatch \n\n\n\n\n\n\nend \n\n\n\n\n\n\n" MaskDisplay "disp(get_param(gcb, 'sysc')) \n\n\n\n\n\n\ntext" "( 0.5, 1.0, method, 'verticalAlignment','top')" MaskSelfModifiable on MaskIconFrame on MaskIconOpaque on MaskIconRotate "port" MaskIconUnits "normalized" MaskValueString "ss(tf(1,[1 1]))|0|1|tustin|0" System { Name "Discretized\nLTI System" Location [127, 360, 625, 660] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Block { BlockType Inport Name "In1" Position [110, 103, 140, 117] } Block { BlockType SubSystem Name "LTI System" Ports [1, 1] Position [190, 92, 285, 128] AncestorBlock "cstblocks/LTI System" TreatAsAtomicUnit off MaskType "LTI Block" MaskDescription "The LTI System block accepts both continuou" "s and discrete LTI models as defined in the Control System Toolbox. Transfer " "function, state-space, and zero-pole-gain formats are all supported in this b" "lock.\n\nNote: Initial states are only meaningful for state-space systems." MaskHelp "The LTI System block accepts any of the thr" "ee standard LTI models described in the Control System Toolbox: transfer func" "tion, zero/pole/gain, or state space. Internally, LTI models will be converte" "d to their state space equivalent for evaluation.\n

\nIn the editable text " "box labeled LTI System Variable, enter a valid LTI model.\n

\nIn the" " editable text box labeled Initial States enter the initial state vect" "or. Initial states are only valid for state-space systems. \n

\nSee also T" "F, ZPK, SS, LTIMODELS." MaskPromptString "LTI system variable|Initial states (state" "-space only)" MaskStyleString "edit,edit" MaskTunableValueString "on,on" MaskCallbackString "ltimask('MaskLTICallback',gcb);|" MaskEnableString "on,on" MaskVisibilityString "on,on" MaskToolTipString "on,on" MaskVarAliasString "," MaskVariables "sys=@1;IC=@2;" MaskInitialization "[A,B,C,D,Ts,Tdi,Tdo,X0,sysname]=ltimask('In" "itialize',gcb,sys,IC);" MaskDisplay "disp(sysname)" MaskSelfModifiable on MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" MaskValueString "discsys|discic" System { Name "LTI System" Location [602, 399, 976, 510] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Block { BlockType Inport Name "In1" Position [20, 35, 40, 55] } Block { BlockType DiscreteStateSpace Name "Internal" Position [135, 25, 240, 65] A "A" B "B" C "C" D "D" X0 "X0" SampleTime "Ts" } Block { BlockType Reference Name "Tdi" Tag "InputDelayBlock" Ports [1, 1] Position [75, 31, 105, 59] SourceBlock "cstextras/Transport Delay\n(masked)" SourceType "Transport Delay (masked)" Td "Tdi" u0 "0" bufsize "1024" } Block { BlockType Reference Name "Tdo" Tag "OutputDelayBlock" Ports [1, 1] Position [275, 31, 305, 59] SourceBlock "cstextras/Transport Delay\n(masked)" SourceType "Transport Delay (masked)" Td "Tdo" u0 "0" bufsize "1024" } Block { BlockType Outport Name "Out1" Position [335, 35, 355, 55] InitialOutput "0" } Line { SrcBlock "Tdo" SrcPort 1 DstBlock "Out1" DstPort 1 } Line { SrcBlock "Internal" SrcPort 1 DstBlock "Tdo" DstPort 1 } Line { SrcBlock "Tdi" SrcPort 1 DstBlock "Internal" DstPort 1 } Line { SrcBlock "In1" SrcPort 1 DstBlock "Tdi" DstPort 1 } } } Block { BlockType Outport Name "Out1" Position [360, 103, 390, 117] } Line { SrcBlock "LTI System" SrcPort 1 DstBlock "Out1" DstPort 1 } Line { SrcBlock "In1" SrcPort 1 DstBlock "LTI System" DstPort 1 } } } Block { BlockType SubSystem Name "Discretized\nRamp" Ports [0, 1] Position [60, 35, 90, 65] TreatAsAtomicUnit off MaskType "DiscretizedRamp" MaskDescription "ramp" MaskPromptString "Slope:|Start time:|Initial output:|Sample time:" MaskStyleString "edit,edit,edit,edit" MaskTunableValueString "on,on,on,on" MaskCallbackString "|||" MaskEnableString "on,on,on,on" MaskVisibilityString "on,on,on,on" MaskToolTipString "on,on,on,on" MaskVarAliasString ",,," MaskVariables "slope=@1;start=@2;X0=@3;SampleTime=@4;" MaskInitialization "curblkc = find_system(gcb,'FollowLinks','on','" "LookUnderMasks','all','searchdepth', 1, 'BlockType','Clock'); \n\n\n\n\n\n\nc" "urblkdc = find_system(gcb,'FollowLinks','on','LookUnderMasks','all','searchde" "pth', 1, 'BlockType','DigitalClock'); \n\n\n\n\n\n\nst=SampleTime; \n\n\n\n\n" "\n\nif length(st)>1 \n\n\n\n\n\n\n st=SampleTime(1); \n\n\n\n\n\n\nend \n" "\n\n\n\n\n\nsldiscutil('initrampmask', st);" MaskDisplay "plot([0:10],[1,1,1,1:8])" MaskSelfModifiable on MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" MaskValueString "1|0|0|1" System { Name "Discretized\nRamp" Location [285, 106, 730, 303] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Block { BlockType Constant Name "Constant" Position [95, 139, 130, 161] Value "start" } Block { BlockType Constant Name "Constant1" Position [250, 139, 285, 161] Value "X0" } Block { BlockType DigitalClock Name "Digital Clock" Position [60, 78, 125, 102] SampleTime "SampleTime" } Block { BlockType Product Name "Product" Ports [2, 1] Position [255, 68, 280, 97] ShowName off } Block { BlockType Step Name "Step" Position [165, 17, 195, 43] Time "start" After "slope" SampleTime "SampleTime" } Block { BlockType Sum Name "Sum" Ports [2, 1] Position [165, 80, 185, 100] ShowName off IconShape "round" Inputs "|+-" } Block { BlockType Sum Name "Sum1" Ports [2, 1] Position [330, 75, 350, 95] ShowName off IconShape "round" Inputs "|++" } Block { BlockType Outport Name "Out1" Position [390, 78, 420, 92] } Line { SrcBlock "Digital Clock" SrcPort 1 DstBlock "Sum" DstPort 1 } Line { SrcBlock "Constant" SrcPort 1 Points [40, 0] DstBlock "Sum" DstPort 2 } Line { SrcBlock "Sum" SrcPort 1 DstBlock "Product" DstPort 2 } Line { SrcBlock "Sum1" SrcPort 1 DstBlock "Out1" DstPort 1 } Line { SrcBlock "Constant1" SrcPort 1 Points [50, 0] DstBlock "Sum1" DstPort 2 } Line { SrcBlock "Product" SrcPort 1 DstBlock "Sum1" DstPort 1 } Line { SrcBlock "Step" SrcPort 1 Points [30, 0; 0, 45] DstBlock "Product" DstPort 1 } } } Block { BlockType SubSystem Name "Discretized\nRepeating Sequence" Ports [0, 1] Position [170, 35, 200, 65] TreatAsAtomicUnit off MaskType "DiscretizedRepeatingTable" MaskDescription "Repeating table." MaskHelp "Repeats cycle given in table. Time values shoul" "d be monotonically increasing." MaskPromptString "Time values:|Output values:|Sample time:" MaskStyleString "edit,edit,edit" MaskTunableValueString "on,on,on" MaskCallbackString "||" MaskEnableString "on,on,on" MaskVisibilityString "on,on,on" MaskToolTipString "on,on,on" MaskVarAliasString ",," MaskVariables "rep_seq_t=@1;rep_seq_y=@2;SampleTime=@3;" MaskInitialization "period = max(rep_seq_t);\nst=SampleTime;\nif le" "ngth(st)>1\n st=SampleTime(1);\nend\nsldiscutil('initrepeatsequencemask', " "st);" MaskDisplay "plot([rep_seq_t,rep_seq_t+period,rep_seq_t+2*pe" "riod,rep_seq_t(1)+3*period],[rep_seq_y,rep_seq_y,rep_seq_y,rep_seq_y(1)])" MaskSelfModifiable on MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" MaskValueString "[0 2]|[0 2]|1" System { Name "Discretized\nRepeating Sequence" Location [337, 135, 737, 274] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Block { BlockType DigitalClock Name "Digital Clock" Position [40, 43, 105, 67] SampleTime "SampleTime" } Block { BlockType Fcn Name "Fcn1" Position [135, 46, 225, 64] Expr "rem(u[1],period)" } Block { BlockType Lookup Name "Look-Up Table" Position [260, 43, 300, 67] InputValues "rep_seq_t" OutputValues "rep_seq_y" } Block { BlockType Outport Name "Out1" Position [335, 45, 355, 65] } Line { SrcBlock "Look-Up Table" SrcPort 1 DstBlock "Out1" DstPort 1 } Line { SrcBlock "Digital Clock" SrcPort 1 DstBlock "Fcn1" DstPort 1 } Line { SrcBlock "Fcn1" SrcPort 1 DstBlock "Look-Up Table" DstPort 1 } } } Block { BlockType SubSystem Name "Discretized\nSignal Generator" Ports [0, 1] Position [290, 28, 325, 62] TreatAsAtomicUnit off MaskType "DiscretizedSignalGenerator" MaskDescription "A discrete equivalent to the Signal Generator B" "lock." MaskPromptString "Waveform:|Amplitude:|Frequency:|Units:|Sample t" "ime:" MaskStyleString "popup(sine|square|sawtooth|random),edit,edit,po" "pup(rad/sec|Hertz),edit" MaskTunableValueString "on,on,on,on,on" MaskCallbackString "||||" MaskEnableString "on,on,on,on,on" MaskVisibilityString "on,on,on,on,on" MaskToolTipString "on,on,on,on,on" MaskVarAliasString ",,,," MaskVariables "WaveForm=@1;Amplitude=@2;Frequency=@3;Units=&4;" "SampleTime=@5;" MaskInitialization "xdrw = 11*[1,1,2,2,1];\nydrw = [72,88,88,72,72]" ";\nxcirc = 11*[0,0,0.25,0.75,1,1,0.75,0.25,0];\nycirc = 16*[0.25,0.75,1,1,0.7" "5,0.25,0,0,0.25];\nswitch Units\n case 'rad/sec'\n frequencyHz = Frequenc" "y/(2*pi);\n frequencyRads = Frequency;\n case 'Hertz'\n frequencyHz = " "Frequency;\n frequencyRads = Frequency*2*pi;\nend\nPeriod = 1.0/frequencyH" "z;\nst=SampleTime;\nDupSampleTime = SampleTime;\nif length(SampleTime) > 1\n " " st=SampleTime(1);\nend\n%discretePeriod = round(period/st);\n%pulseWidth =" " round(period*duty/100/st);\n%phaseDelay =round(start/st);\n%SampleTime=st;\n" "if(st > 0)\n PeriodSamples = max(2,round(Period/st));\n halfSamples = m" "ax(1,round(PeriodSamples/2));\nelse\n PeriodSamples = 2;\n halfSamp" "les = 1;\nend\n\nsldiscutil('initsiggenmask', st);" MaskDisplay "plot( 1,1,99,99, 0+xdrw, ydrw );\nplot( 1,1,9" "9,99, 22+xdrw, ydrw );\nplot( 1,1,99,99, 44+xdrw, ydrw );\nplot( 1,1,99,99, 6" "6+xdrw, ydrw );\nplot( 1,1,99,99, 22+xcirc, 44+ycirc );\nplot( 1,1,99,99, 44+" "xcirc, 44+ycirc );\n" MaskSelfModifiable on MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" MaskValueString "sine|1|1|Hertz|0.1" System { Name "Discretized\nSignal Generator" Location [348, 154, 964, 428] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Block { BlockType Constant Name "Control Signal" Position [145, 39, 245, 71] Value "WaveForm" } Block { BlockType SubSystem Name "Discretized\nRepeating Sequence1" Ports [0, 1] Position [230, 145, 260, 175] AncestorBlock "discretizing/Discretized\nRepeating Sequenc" "e" TreatAsAtomicUnit off MaskType "DiscretizedRepeatingTable" MaskDescription "Repeating table." MaskHelp "Repeats cycle given in table. Time values s" "hould be monotonically increasing." MaskPromptString "Time values:|Output values:|Sample time:" MaskStyleString "edit,edit,edit" MaskTunableValueString "on,on,on" MaskCallbackString "||" MaskEnableString "on,on,on" MaskVisibilityString "on,on,on" MaskToolTipString "on,on,on" MaskVarAliasString ",," MaskVariables "rep_seq_t=@1;rep_seq_y=@2;SampleTime=@3;" MaskInitialization "period = max(rep_seq_t);\nst=SampleTime;\ni" "f length(st)>1\n st=SampleTime(1);\nend\nsldiscutil('initrepeatsequencemas" "k', st);" MaskDisplay "plot([rep_seq_t,rep_seq_t+period,rep_seq_t+" "2*period,rep_seq_t(1)+3*period],[rep_seq_y,rep_seq_y,rep_seq_y,rep_seq_y(1)])" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" MaskValueString "[0 Period]|[0 ((-2)*Amplitude)]|DupSampleTi" "me" System { Name "Discretized\nRepeating Sequence1" Location [337, 135, 737, 274] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Block { BlockType DigitalClock Name "Digital Clock" Position [40, 43, 105, 67] SampleTime "SampleTime" } Block { BlockType Fcn Name "Fcn1" Position [135, 46, 225, 64] Expr "rem(u[1],period)" } Block { BlockType Lookup Name "Look-Up Table" Position [260, 43, 300, 67] InputValues "rep_seq_t" OutputValues "rep_seq_y" } Block { BlockType Outport Name "Out1" Position [335, 45, 355, 65] } Line { SrcBlock "Fcn1" SrcPort 1 DstBlock "Look-Up Table" DstPort 1 } Line { SrcBlock "Digital Clock" SrcPort 1 DstBlock "Fcn1" DstPort 1 } Line { SrcBlock "Look-Up Table" SrcPort 1 DstBlock "Out1" DstPort 1 } } } Block { BlockType MultiPortSwitch Name "Multiport\nSwitch" Ports [5, 1] Position [470, 60, 515, 150] SaturateOnIntegerOverflow off } Block { BlockType Constant Name "Offset" Position [60, 211, 130, 239] Value "Amplitude" } Block { BlockType DiscretePulseGenerator Name "Pulse Generator" Position [85, 108, 130, 142] Amplitude "2*Amplitude" Period "PeriodSamples" PulseWidth "halfSamples" PhaseDelay "halfSamples" SampleTime "st" } Block { BlockType Sin Name "Sine Wave" Position [35, 75, 65, 105] SineType "Time based" Amplitude "Amplitude" Frequency "frequencyRads" SampleTime "SampleTime" } Block { BlockType Sum Name "Sum" Ports [2, 1] Position [160, 115, 180, 135] ShowName off IconShape "round" Inputs "|+-" } Block { BlockType Sum Name "Sum1" Ports [2, 1] Position [305, 150, 325, 170] ShowName off IconShape "round" Inputs "|++" } Block { BlockType UniformRandomNumber Name "Uniform Random\nNumber" Position [390, 189, 420, 221] Minimum "(-1)*Amplitude" Maximum "Amplitude" SampleTime "SampleTime" } Block { BlockType Outport Name "Out1" Position [550, 98, 580, 112] } Line { SrcBlock "Uniform Random\nNumber" SrcPort 1 Points [15, 0; 0, -70] DstBlock "Multiport\nSwitch" DstPort 5 } Line { SrcBlock "Sine Wave" SrcPort 1 DstBlock "Multiport\nSwitch" DstPort 2 } Line { SrcBlock "Control Signal" SrcPort 1 Points [65, 0; 0, 20] DstBlock "Multiport\nSwitch" DstPort 1 } Line { SrcBlock "Pulse Generator" SrcPort 1 DstBlock "Sum" DstPort 1 } Line { SrcBlock "Sum" SrcPort 1 Points [130, 0; 0, -20] DstBlock "Multiport\nSwitch" DstPort 3 } Line { SrcBlock "Multiport\nSwitch" SrcPort 1 DstBlock "Out1" DstPort 1 } Line { SrcBlock "Discretized\nRepeating Sequence1" SrcPort 1 DstBlock "Sum1" DstPort 1 } Line { SrcBlock "Sum1" SrcPort 1 Points [95, 0; 0, -40] DstBlock "Multiport\nSwitch" DstPort 4 } Line { SrcBlock "Offset" SrcPort 1 Points [35, 0] Branch { Points [145, 0] DstBlock "Sum1" DstPort 2 } Branch { DstBlock "Sum" DstPort 2 } } } } Block { BlockType SubSystem Name "Discretized\nState-Space" Ports [1, 1] Position [155, 137, 215, 183] TreatAsAtomicUnit off MaskType "DiscretizedStateSpace" MaskDescription "Continuous mask uses c2d to transform parameter" "s onto the Discrete State-Space block inside." MaskPromptString "A (enter in s-domain:)|B (enter in s-domain:)|C" " (enter in s-domain:)|D (enter in s-domain:)|Initial conditions (enter in s-d" "omain:)|Absolute tolerance|Sample time:|Method:|Critical Frequency (Hz):" MaskStyleString "edit,edit,edit,edit,edit,edit,edit,popup(zoh|fo" "h|tustin|prewarp|matched),edit" MaskTunableValueString "on,on,on,on,on,on,on,on,on" MaskCallbackString "|||||||hidecrit|" MaskEnableString "on,on,on,on,on,on,on,on,on" MaskVisibilityString "on,on,on,on,on,on,on,on,off" MaskToolTipString "on,on,on,on,on,on,on,on,on" MaskVarAliasString ",,,,,,,," MaskVariables "A=@1;B=@2;C=@3;D=@4;ic=@5;AbsTol=&6;SampleTime=" "@7;method=&8;Wc=@9;" MaskInitialization "st=SampleTime;\nif length(st)>1\n st=SampleT" "ime(1);\nend\nif(st>0)\n [Ad, Bd, Cd, Dd, icd] = sldiscutil('discstatespac" "e', {st,method,Wc,A,B,C,D,ic});\nend\nsldiscutil('initssmask', st);\nif(st==0" ")\nset_param([gcb '/State Space'], 'AbsoluteTolerance', AbsTol);\nend" MaskDisplay "text( 0.5, 0.65, 'x'' = Ax+Bu', 'horizontalAlig" "nment', 'center');\ntext( 0.5, 0.4, 'y = Cx+Du', 'horizontalAlignment', 'cent" "er');\ntext( 0.5, 1.0, method, 'verticalAlignment', 'top')" MaskSelfModifiable on MaskIconFrame on MaskIconOpaque on MaskIconRotate "port" MaskIconUnits "normalized" MaskValueString "1|1|1|1|0|auto|1|tustin|1" System { Name "Discretized\nState-Space" Location [81, 369, 373, 516] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Block { BlockType Inport Name "In1" Position [25, 68, 55, 82] } Block { BlockType DiscreteStateSpace Name "Discrete State-Space" Position [85, 52, 200, 98] A "Ad" B "Bd" C "Cd" D "Dd" X0 "icd" SampleTime "SampleTime" } Block { BlockType Outport Name "Out1" Position [240, 68, 270, 82] } Line { SrcBlock "In1" SrcPort 1 DstBlock "Discrete State-Space" DstPort 1 } Line { SrcBlock "Discrete State-Space" SrcPort 1 DstBlock "Out1" DstPort 1 } } } Block { BlockType SubSystem Name "Discretized\nTransfer Fcn" Ports [1, 1] Position [270, 134, 340, 186] TreatAsAtomicUnit off MaskType "DiscretizedTransferFcn" MaskDescription "Continuous mask uses c2d to transform parameter" "s onto the Discrete Transfer function block inside." MaskPromptString "Numerator (enter in s-domain:)|Denominator (ent" "er in s-domain:)|Absolute tolerance:|Sample time:|Method:|Critical Frequency " "(Hz):" MaskStyleString "edit,edit,edit,edit,popup(zoh|foh|tustin|prewar" "p|matched),edit" MaskTunableValueString "on,on,on,on,on,on" MaskCallbackString "||||hidecrit|" MaskEnableString "on,on,on,on,on,on" MaskVisibilityString "on,on,on,on,on,off" MaskToolTipString "on,on,on,on,on,on" MaskVarAliasString ",,,,," MaskVariables "Numerator=@1;Denominator=@2;AbsTol=&3;SampleTim" "e=@4;method=&5;Wc=@6;" MaskInitialization "st=SampleTime;\nif length(st)>1\n st=SampleT" "ime(1);\nend\nif(st>0)\n [numd,dend] = sldiscutil('disctransferfcn',{st,me" "thod,Wc,Numerator,Denominator});\nend \ns = get_param(gcb,'maskvalues'" ");\nnums = s{1};\ndens = s{2};\n%numc = eval(nums);\n%denc = eval(dens);\nsld" "iscutil('inittfmask', st);\nif(st==0)\nset_param([gcb '/Transfer Fcn'], 'Abso" "luteTolerance', AbsTol);\nend" MaskDisplay "dpoly(nums,dens)\ntext( 0.5, 1.0, method, 'vert" "icalAlignment','top')" MaskSelfModifiable on MaskIconFrame on MaskIconOpaque on MaskIconRotate "port" MaskIconUnits "normalized" MaskValueString "[1]|[1 1]|auto|1|tustin|1" System { Name "Discretized\nTransfer Fcn" Location [129, 251, 421, 508] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Block { BlockType Inport Name "In1" Position [60, 103, 90, 117] } Block { BlockType DiscreteTransferFcn Name "Discrete\nTransfer Fcn" Position [115, 92, 175, 128] Numerator "numd" Denominator "dend" SampleTime "SampleTime" } Block { BlockType Outport Name "Out1" Position [200, 103, 230, 117] } Line { SrcBlock "Discrete\nTransfer Fcn" SrcPort 1 DstBlock "Out1" DstPort 1 } Line { SrcBlock "In1" SrcPort 1 DstBlock "Discrete\nTransfer Fcn" DstPort 1 } } } Block { BlockType SubSystem Name "Discretized\nTransfer Fcn\n(with initial states" ")" Ports [1, 1] Position [280, 224, 350, 276] TreatAsAtomicUnit off MaskType "DiscretizedTransferFcnWithIC" MaskDescription "Continuous mask uses c2d to transform parameter" "s onto the Discrete Transfer function block inside." MaskPromptString "Numerator (enter in s-domain:)|Denominator (ent" "er in s-domain:)|Initial conditions:|Sample time:|Method:|Critical Frequency " "(Hz):" MaskStyleString "edit,edit,edit,edit,popup(zoh|foh|tustin|prewar" "p|matched),edit" MaskTunableValueString "on,on,on,on,on,on" MaskCallbackString "||||hidecrit|" MaskEnableString "on,on,on,on,on,on" MaskVisibilityString "on,on,on,on,on,off" MaskToolTipString "on,on,on,on,on,on" MaskVarAliasString ",,,,," MaskVariables "Numerator=@1;Denominator=@2;X0=&3;SampleTime=@4" ";method=&5;Wc=@6;" MaskInitialization "st=SampleTime;\nif length(st)>1\n st=SampleT" "ime(1);\nend\nif(st>0)\n [numd,dend] = sldiscutil('disctransferfcn',{st,me" "thod,Wc,Numerator,Denominator});\nend \ns = get_param(gcb,'maskvalues'" ");\nnums = s{1};\ndens = s{2};\n%numc = eval(nums);\n%denc = eval(dens);\nsld" "iscutil('inittfmask', st);\n%if(st==0)\n%set_param([gcb '/Transfer Fcn'], 'X0" "', X0);\n%end" MaskDisplay "dpoly(nums,dens)\ntext( 0.5, 1.0, method, 'vert" "icalAlignment','top')" MaskSelfModifiable on MaskIconFrame on MaskIconOpaque on MaskIconRotate "port" MaskIconUnits "normalized" MaskValueString "[1]|[1 1]|auto|1|tustin|1" System { Name "Discretized\nTransfer Fcn\n(with initial stat" "es)" Location [129, 251, 421, 508] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Block { BlockType Inport Name "In1" Position [60, 103, 90, 117] } Block { BlockType DiscreteTransferFcn Name "Discrete\nTransfer Fcn" Position [115, 92, 175, 128] Numerator "numd" Denominator "dend" SampleTime "SampleTime" } Block { BlockType Outport Name "Out1" Position [200, 103, 230, 117] } Line { SrcBlock "In1" SrcPort 1 DstBlock "Discrete\nTransfer Fcn" DstPort 1 } Line { SrcBlock "Discrete\nTransfer Fcn" SrcPort 1 DstBlock "Out1" DstPort 1 } } } Block { BlockType SubSystem Name "Discretized\nTransport Delay" Ports [1, 1] Position [55, 237, 90, 273] AttributesFormatString "(Round to %)" TreatAsAtomicUnit off MaskType "DiscretizedTransportDelay" MaskDescription "Uses either an integer delay or a Discrete State " "Space Transfer Function for fractional delays internally to mimic the " "behavior of a continuous transport delay." MaskHelp "An Integer Delay block is used whenever rounding is " "performed (Floor, Ceiling, or Nearest), or when the Delay divided by the Sample time is " "an integer. If the Fractional Delay is chosen, a Discrete State Space Transfer " "Function is developed using the Thiran filter algorithm to approximate the continuous " "Transport Delay. When the Fractional Delay (no Dir. FT) option is selected, the " "Thiran filter is approximated to accomodate systems requiring no direct feedthrough " "(such as algebraic loops). If the Delay is less than the Sample time, then an Integer " "Delay of one is used." MaskPromptString "Delay (sec):|Initial value:|Sample time:|Round " "toward:" MaskStyleString "edit,edit,edit,popup(Floor|Ceiling|Nearest|Frac" "tional Delay|Fractional Delay (no direct FT))" MaskTunableValueString "on,on,on,on" MaskCallbackString "|||" MaskEnableString "on,on,on,on" MaskVisibilityString "on,on,on,on" MaskToolTipString "on,on,on,on" MaskVarAliasString ",,," MaskVariables "delay=@1;ic=@2;SampleTime=@3;rounding=@4;" MaskInitialization "n = 10;t = 0:pi/n:2.25*pi;pshift = floor(2*n/3)" ";\nst=SampleTime;\nif length(st)>1\n st=SampleTime(1);\nend\nif(st>0)\n " " if (abs(delay/st-round(delay/st)) < eps*abs(delay/st)) | rounding == " "3\n samples=round(delay/st);\n elseif rounding == 1\n" " samples = floor(delay/st);\n elseif rounding == 2\n" " samples = ceil(delay/st);\n else\n samp" "les=delay/st;\n if (rounding == 5)\n sa" "mples = samples - 1;\n end\n N = floor(samples)" "+1;\n den = 1;\n num = 1;\n ct =" " 0:N;\n for k = 1:N\n ak = ((-1)^k)*fac" "torial(N)/(factorial(k)*factorial(N-k))...\n *" "prod((samples-N+ct)./(samples-N+k+ct));\n num = [ak nu" "m];\n den = [den ak];\n end\n " " if (rounding == 5)\n den = [den 0];\n " " samples=delay/st;\nif samples<1\nsamples = 1;\nend\n end\n [A,B," "C,Dd] = tf2ss(num,den);\n if (isempty(ic))\n " " ic = zeros(1,size(A,1));\n end\n end\nelse\n" " samples = 0;\nend\nsldiscutil('inittransdelaymask', samples);\n" MaskDisplay "plot(t, sin(t))\nplot(t(pshift+1:end),sin(t(1:e" "nd-pshift)))\nplot([0 t(pshift+1)],[0 0])\nplot([3 4.2 4 4 4.2],[.4 .4 .46 .3" "4 .4])\nplot([3.9 5.1 4.9 4.9 5.1],-[.4 .4 .46 .34 .4])\n" MaskSelfModifiable on MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" MaskValueString "1|0|1|Floor" System { Name "Discretized\nTransport Delay" Location [468, 72, 997, 366] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Block { BlockType Inport Name "In1" Position [50, 58, 80, 72] SampleTime "SampleTime" } Block { BlockType Reference Name "Integer Delay" Ports [1, 1] Position [130, 45, 200, 85] SourceBlock "simulink/Discrete/Integer Delay" SourceType "Integer Delay" NumDelays "samples" vinit "ic" samptime "st" } Block { BlockType Outport Name "Out1" Position [245, 58, 275, 72] } Line { SrcBlock "Integer Delay" SrcPort 1 DstBlock "Out1" DstPort 1 } Line { SrcBlock "In1" SrcPort 1 DstBlock "Integer Delay" DstPort 1 } } } Block { BlockType SubSystem Name "Discretized\nVariable\nTransport Delay" Ports [2, 1] Position [55, 317, 85, 348] TreatAsAtomicUnit off MaskType "DiscretizedVarTransDelay" MaskDescription "Uses a Z^-k variable delay line to mimic the be" "havior of the continuous variable transport delay block." MaskHelp "Note: the Buffer size parameter is included onl" "y for holding the parameter value in case of conversion back to the continuou" "s variable transport delay." MaskPromptString "Maximum delay (sec):|Initial input:|Buffer size" ":|Sample time:" MaskStyleString "edit,edit,edit,edit" MaskTunableValueString "on,on,on,on" MaskCallbackString "|||" MaskEnableString "on,on,on,on" MaskVisibilityString "on,on,on,on" MaskToolTipString "on,on,on,on" MaskVarAliasString ",,," MaskVariables "MaximumDelay=@1;InitialInput=@2;MaximumPoints=@" "3;SampleTime=@4;" MaskInitialization "st=SampleTime;\nif length(st)>1\n st=Sample" "Time(1);\nend\nif(st>0)\n maxDelaySamples=ceil(MaximumDelay/st);\nelse\n" " maxDelaySamples = 0;\nend\npos = get_param(gcb,'Position');\nwidth = " "pos(3) - pos(1);\nheight = pos(4) - pos(2);\nexpWidth = 2;\nsldiscutil('initv" "artransdelaymask', st);" MaskDisplay "text(width/2-3*expWidth, height/2, 'z');\ntext(" "width/2-3*(expWidth-1), height/2+5, '-k');" MaskSelfModifiable on MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "pixels" MaskValueString "1|0|1024|1" System { Name "Discretized\nVariable\nTransport Delay" Location [142, 510, 474, 635] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Block { BlockType Inport Name "input" Position [35, 38, 65, 52] SampleTime "SampleTime" } Block { BlockType Inport Name "delay" Position [75, 58, 105, 72] Port "2" SampleTime "SampleTime" } Block { BlockType Reference Name "Variable\nInteger Delay" Ports [2, 1] Position [135, 35, 220, 75] SourceBlock "dspbdsp2/Variable\nInteger Delay" SourceType "Variable Integer Delay" dmax "maxDelaySamples" ic "InitialInput" frame off numChans "1" } Block { BlockType Outport Name "Out1" Position [255, 48, 285, 62] } Line { SrcBlock "Variable\nInteger Delay" SrcPort 1 DstBlock "Out1" DstPort 1 } Line { SrcBlock "delay" SrcPort 1 DstBlock "Variable\nInteger Delay" DstPort 2 } Line { SrcBlock "input" SrcPort 1 DstBlock "Variable\nInteger Delay" DstPort 1 } } } Block { BlockType SubSystem Name "Discretized\nZero-Pole" Ports [1, 1] Position [385, 139, 455, 191] TreatAsAtomicUnit off MaskType "DiscretizedZeroPole" MaskDescription "Continuous mask uses c2d to transform parameter" "s onto the Discrete Zero-Pole block inside." MaskPromptString "Zeros (enter in s-main:)|Poles (enter in s-doma" "in:)|Gain (enter in s-domain:)|Absolute tolerance:|Sample time:|Method:|Criti" "cal Frequency (Hz):" MaskStyleString "edit,edit,edit,edit,edit,popup(zoh|foh|tustin|p" "rewarp|matched),edit" MaskTunableValueString "on,on,on,on,on,on,on" MaskCallbackString "|||||hidecrit|" MaskEnableString "on,on,on,on,on,on,on" MaskVisibilityString "on,on,on,on,on,on,off" MaskToolTipString "on,on,on,on,on,on,on" MaskVarAliasString ",,,,,," MaskVariables "Zeros=@1;Poles=@2;Gain=@3;AbsTol=&4;SampleTime=" "@5;method=&6;Wc=@7;" MaskInitialization "st=SampleTime;\nif length(st)>1\n st=SampleT" "ime(1);\nend\nif(st>0)\n [zerosd,polesd,gaind] = sldiscutil('disczpk', {st" ",method,Wc,Zeros,Poles,Gain});\nend \ns = get_param(gcb,'maskvalues');" "\nzeross = s{1};\npoless = s{2};\ngainss = s{3};\n%zerosc = eval(zeross);\n%p" "olesc = eval(poless);\n%gainsc = eval(gainss);\nsldiscutil('initzpkmask', st)" ";\nif(st==0)\nset_param([gcb '/Zero Pole'], 'AbsoluteTolerance', AbsTol);\nen" "d" MaskDisplay "droots(zeross,poless,gainss)\ntext( 0.5, 1.0, m" "ethod, 'verticalAlignment','top')" MaskSelfModifiable on MaskIconFrame on MaskIconOpaque on MaskIconRotate "port" MaskIconUnits "normalized" MaskValueString "[1]|[1 1]|[2]|auto|1|tustin|1" System { Name "Discretized\nZero-Pole" Location [499, 349, 791, 606] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Block { BlockType Inport Name "In1" Position [60, 103, 90, 117] } Block { BlockType DiscreteZeroPole Name "Discrete\nZero-Pole" Position [115, 92, 200, 128] Zeros "zerosd" Poles "polesd" Gain "gaind" SampleTime "SampleTime" } Block { BlockType Outport Name "Out1" Position [235, 103, 265, 117] } Line { SrcBlock "In1" SrcPort 1 DstBlock "Discrete\nZero-Pole" DstPort 1 } Line { SrcBlock "Discrete\nZero-Pole" SrcPort 1 DstBlock "Out1" DstPort 1 } } } Annotation { Name "Simulink Discretizer Library 1.0\nCopyright (c)" " 1990-2002 The MathWorks, Inc." Position [251, 427] } } }