block421.mdl
来自「realize analysis and design for computer」· MDL 代码 · 共 716 行
MDL
716 行
Model { Name "block421" Version 2.00 SimParamPage Solver SampleTimeColors off WideVectorLines on PaperOrientation landscape StartTime "0.0" StopTime "999999" Solver ode45 RelTol "1e-3" AbsTol "1e-6" Refine "1" MaxStep "auto" InitialStep "auto" FixedStep "auto" MaxOrder 5 OutputOption RefineOutputTimes OutputTimes "[]" LoadExternalInput off ExternalInput "[t, u]" SaveTime off TimeSaveName "tout" SaveState off StateSaveName "xout" SaveOutput off OutputSaveName "yout" LoadInitialState off InitialState "xInitial" SaveFinalState off FinalStateName "xFinal" LimitMaxRows off MaxRows "1000" Decimation "1" AlgebraicLoopMsg warning MinStepSizeMsg warning UnconnectedInputMsg warning UnconnectedOutputMsg warning UnconnectedLineMsg warning ConsistencyChecking off ZeroCross on 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 } System { Name "block421" Location [199, 195, 621, 461] Open on ScreenColor white Block { BlockType SubSystem Name "Kalman3" Position [105, 101, 135, 159] BackgroundColor magenta DropShadow on ShowPortLabels off System { Name "Kalman3" Location [64, 257, 621, 461] Open off ScreenColor magenta Block { BlockType Inport Name "u" Position [50, 50, 70, 70] Port "1" PortWidth "-1" SampleTime "-1" } Block { BlockType Inport Name "y" Position [50, 100, 70, 120] Port "2" PortWidth "-1" SampleTime "-1" } Block { BlockType Demux Name "Demux" Position [415, 74, 460, 116] DropShadow on ShowName off Outputs "[3 1]" } Block { BlockType DiscreteStateSpace Name "Discrete State-Space" Position [280, 73, 395, 117] DropShadow on A "phi" B "[gamma(:,1) K']" C "[1 0 0;0 1 0; 0 0 1; 0 0 1]" D "[0 0; 0 0; 0 0; 0 0]" X0 "0" SampleTime "h" } Block { BlockType Mux Name "Mux" Position [225, 76, 255, 109] DropShadow on ShowName off Inputs "2" } Block { BlockType Sum Name "Sum" Position [160, 101, 180, 134] DropShadow on ShowName off Inputs "+-" } Block { BlockType ZeroOrderHold Name "ZoH6" Position [85, 95, 125, 125] DropShadow on ShowName off SampleTime "[h t0]" } Block { BlockType Outport Name "xhat" Position [510, 75, 530, 95] Port "1" OutputWhenDisabled held InitialOutput "0" } Line { SrcBlock "ZoH6" SrcPort 1 DstBlock "Sum" DstPort 1 } Line { SrcBlock "y" SrcPort 1 DstBlock "ZoH6" DstPort 1 } Line { SrcBlock "Demux" SrcPort 1 DstBlock "xhat" DstPort 1 } Line { SrcBlock "Demux" SrcPort 2 Points [10, 0; 0, 45; -335, 0; 0, -25] DstBlock "Sum" DstPort 2 } Line { SrcBlock "u" SrcPort 1 Points [105, 0; 0, 25] DstBlock "Mux" DstPort 1 } Line { SrcBlock "Sum" SrcPort 1 Points [20, 0; 0, -20] DstBlock "Mux" DstPort 2 } Line { SrcBlock "Discrete State-Space" SrcPort 1 DstBlock "Demux" DstPort 1 } Line { SrcBlock "Mux" SrcPort 1 DstBlock "Discrete State-Space" DstPort 1 } } } Block { BlockType SubSystem Name "Pulse" Position [30, 208, 55, 232] DropShadow on ShowPortLabels off MaskType "Pulse" MaskDescription "Pulse Generator." MaskHelp "Pulse generator which ensures pulse\\ntransition" "s are hit. Provides a vector of pulses when " "the height is entered as a vector.\\nUnmask " "to see how it works." MaskPromptString "Pulse width:|Pulse height:|Pulse start time:" MaskStyleString "edit,edit,edit" MaskInitialization "width=@1;height=@2;tstep=@3;" MaskDisplay "plot(-30,-10,100,100,[60,35,35,20,20,0],[20,20,8" "0,80,20,20])" MaskIconFrame on MaskIconOpaque on MaskIconRotate off MaskIconUnits autoscale MaskValueString "0.1|-10|25" System { Name "Pulse" Location [100, 215, 335, 385] Open off ScreenColor white Block { BlockType Step Name "Step Input1" Position [65, 50, 85, 70] ShowName off Time "tstep" Before "0" After "height" } Block { BlockType Step Name "Step Input2" Position [65, 105, 85, 125] ShowName off Time "tstep+width" Before "0" After "height" } Block { BlockType Sum Name "Sum" Position [145, 75, 165, 95] Inputs "+-" } Block { BlockType Outport Name "out_1" Position [205, 75, 225, 95] Port "1" OutputWhenDisabled held InitialOutput "0" } Line { SrcBlock "Step Input2" SrcPort 1 Points [25, 0; 0, -25] DstBlock "Sum" DstPort 2 } Line { SrcBlock "Step Input1" SrcPort 1 Points [15, 0; 0, 20] DstBlock "Sum" DstPort 1 } Line { SrcBlock "Sum" SrcPort 1 DstBlock "out_1" DstPort 1 } } } Block { BlockType SubSystem Name "Robot" Position [250, 105, 280, 160] DropShadow on ShowPortLabels off System { Name "Robot" Location [42, 365, 453, 546] Open off ScreenColor white Block { BlockType Inport Name "u" Position [30, 40, 50, 60] Port "1" PortWidth "-1" SampleTime "-1" } Block { BlockType Inport Name "v" Position [30, 85, 50, 105] Port "2" PortWidth "-1" SampleTime "-1" } Block { BlockType Demux Name "Demux" Position [260, 56, 300, 89] Outputs "[1 3]" } Block { BlockType Mux Name "Mux2" Position [90, 56, 120, 89] DropShadow on ShowName off Inputs "2" } Block { BlockType StateSpace Name "robmech" Position [150, 54, 225, 96] A "om0*[0 1 -1; al-1 -be1 be1; al be2 -be2]" B "[0 0; ga de; 0 0]" C "[0 0 om0;1 0 0; 0 1 0; 0 0 1]" D "[0 0; 0 0; 0 0; 0 0]" X0 "0" } Block { BlockType Outport Name "y" Position [350, 25, 370, 45] Port "1" OutputWhenDisabled held InitialOutput "0" } Block { BlockType Outport Name "x" Position [350, 70, 370, 90] Port "2" OutputWhenDisabled held InitialOutput "0" } Line { SrcBlock "robmech" SrcPort 1 DstBlock "Demux" DstPort 1 } Line { SrcBlock "Mux2" SrcPort 1 DstBlock "robmech" DstPort 1 } Line { SrcBlock "Demux" SrcPort 2 DstBlock "x" DstPort 1 } Line { SrcBlock "v" SrcPort 1 Points [5, 0; 0, -15] DstBlock "Mux2" DstPort 2 } Line { SrcBlock "u" SrcPort 1 Points [5, 0; 0, 15] DstBlock "Mux2" DstPort 1 } Line { SrcBlock "Demux" SrcPort 1 Points [15, 0; 0, -30] DstBlock "y" DstPort 1 } } } Block { BlockType Step Name "Step Input" Position [30, 30, 50, 50] DropShadow on ShowName off Time "0" Before "0" After "1" } Block { BlockType Terminator Name "Terminator" Position [305, 135, 325, 155] ShowName off } Block { BlockType SubSystem Name "dstfb3" Position [185, 90, 215, 145] BackgroundColor magenta DropShadow on ShowPortLabels off System { Name "dstfb3" Location [594, 524, 950, 774] Open off ScreenColor magenta Block { BlockType Inport Name "uc" Position [20, 40, 40, 60] Port "1" PortWidth "-1" SampleTime "-1" } Block { BlockType Inport Name "x" Position [20, 140, 40, 160] Port "2" PortWidth "-1" SampleTime "-1" } Block { BlockType Demux Name "Demux" Position [70, 134, 110, 166] BackgroundColor magenta ShowName off Outputs "3" } Block { BlockType Sum Name "Sum2" Position [280, 82, 300, 128] BackgroundColor magenta DropShadow on ShowName off Inputs "+---" } Block { BlockType ZeroOrderHold Name "ZoH4" Position [140, 35, 180, 65] BackgroundColor magenta DropShadow on ShowName off SampleTime "[h t0]" } Block { BlockType ZeroOrderHold Name "ZoH5" Position [140, 85, 180, 115] BackgroundColor magenta DropShadow on ShowName off SampleTime "[h t0]" } Block { BlockType ZeroOrderHold Name "ZoH6" Position [140, 135, 180, 165] BackgroundColor magenta DropShadow on ShowName off SampleTime "[h t0]" } Block { BlockType ZeroOrderHold Name "ZoH7" Position [140, 185, 180, 215] BackgroundColor magenta DropShadow on ShowName off SampleTime "[h t0]" } Block { BlockType Gain Name "l3" Position [200, 85, 230, 115] BackgroundColor magenta DropShadow on ShowName off Gain "l1" } Block { BlockType Gain Name "l4" Position [200, 135, 230, 165] BackgroundColor magenta DropShadow on ShowName off Gain "l2" } Block { BlockType Gain Name "l5" Position [200, 185, 230, 215] BackgroundColor magenta DropShadow on ShowName off Gain "l3" } Block { BlockType Gain Name "l6" Position [200, 35, 230, 65] BackgroundColor magenta DropShadow on ShowName off Gain "lc" } Block { BlockType Outport Name "u" Position [330, 95, 350, 115] Port "1" OutputWhenDisabled held InitialOutput "0" } Line { SrcBlock "Demux" SrcPort 3 Points [10, 0] DstBlock "ZoH7" DstPort 1 } Line { SrcBlock "Demux" SrcPort 2 DstBlock "ZoH6" DstPort 1 } Line { SrcBlock "Demux" SrcPort 1 Points [10, 0] DstBlock "ZoH5" DstPort 1 } Line { SrcBlock "x" SrcPort 1 DstBlock "Demux" DstPort 1 } Line { SrcBlock "l5" SrcPort 1 Points [30, 0] DstBlock "Sum2" DstPort 4 } Line { SrcBlock "ZoH7" SrcPort 1 DstBlock "l5" DstPort 1 } Line { SrcBlock "l3" SrcPort 1 DstBlock "Sum2" DstPort 2 } Line { SrcBlock "l4" SrcPort 1 Points [20, 0; 0, -40] DstBlock "Sum2" DstPort 3 } Line { SrcBlock "ZoH6" SrcPort 1 DstBlock "l4" DstPort 1 } Line { SrcBlock "ZoH5" SrcPort 1 DstBlock "l3" DstPort 1 } Line { SrcBlock "l6" SrcPort 1 Points [20, 0; 0, 40] DstBlock "Sum2" DstPort 1 } Line { SrcBlock "ZoH4" SrcPort 1 DstBlock "l6" DstPort 1 } Line { SrcBlock "uc" SrcPort 1 DstBlock "ZoH4" DstPort 1 } Line { SrcBlock "Sum2" SrcPort 1 DstBlock "u" DstPort 1 } } } Block { BlockType Outport Name "u" Position [370, 110, 390, 130] Port "1" OutputWhenDisabled held InitialOutput "0" } Block { BlockType Outport Name "u1" Position [275, 55, 295, 75] Port "2" OutputWhenDisabled held InitialOutput "0" } Block { BlockType Outport Name "u2" Position [200, 30, 220, 50] Port "3" OutputWhenDisabled held InitialOutput "0" } Line { SrcBlock "Robot" SrcPort 2 DstBlock "Terminator" DstPort 1 } Line { SrcBlock "Robot" SrcPort 1 Points [0, 0] Branch { DstBlock "u" DstPort 1 } Branch { Points [55, 0; 0, 75; -265, 0; 0, -50] DstBlock "Kalman3" DstPort 2 } } Line { SrcBlock "Kalman3" SrcPort 1 DstBlock "dstfb3" DstPort 2 } Line { SrcBlock "dstfb3" SrcPort 1 Points [0, 0] Branch { Points [10, 0; 0, -55; -145, 0; 0, 50] DstBlock "Kalman3" DstPort 1 } Branch { Points [10, 0; 0, -55] DstBlock "u1" DstPort 1 } Branch { DstBlock "Robot" DstPort 1 } } Line { SrcBlock "Step Input" SrcPort 1 Points [0, 0] Branch { DstBlock "u2" DstPort 1 } Branch { Points [100, 0; 0, 65] DstBlock "dstfb3" DstPort 1 } } Line { SrcBlock "Pulse" SrcPort 1 Points [170, 0; 0, -75] DstBlock "Robot" DstPort 2 } }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?