📄 ch8_a.mdl
字号:
Model { Name "ch7_a" Version 2.09 SimParamPage Solver SampleTimeColors off InvariantConstants off WideVectorLines off ShowLineWidths off PaperOrientation landscape PaperType usletter PaperUnits inches StartTime "0.0" StopTime "1000" Solver ode23 RelTol "1e-3" AbsTol "1e-6" Refine "1" MaxStep "10" 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 SimulationMode normal RTWSystemTargetFile "grt.tlc" RTWInlineParameters off RTWRetainRTWFile off RTWTemplateMakefile "grt_vc.tmf" RTWMakeCommand "make_rtw" RTWGenerateCodeOnly off ExtModeMexFile "ext_comm" ExtModeBatchMode off 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 "ch7_a" Location [484, 162, 998, 351] Open on ScreenColor white Block { BlockType SubSystem Name "Automobile\nModel" Ports [2, 1, 0, 0, 0] Position [305, 27, 410, 78] ShowPortLabels on System { Name "Automobile\nModel" Location [220, 441, 645, 712] Open off ScreenColor white Block { BlockType Inport Name "Commanded\nThrust" Position [25, 109, 45, 131] Port "1" PortWidth "-1" SampleTime "-1" } Block { BlockType Inport Name "Time In" Position [310, 186, 330, 204] Orientation left Port "2" PortWidth "-1" SampleTime "-1" MaskIconFrame on MaskIconOpaque on MaskIconRotate none MaskIconUnits autoscale } Block { BlockType Gain Name "1/mass" Position [240, 94, 275, 126] Gain "0.01" } Block { BlockType Fcn Name "Aero\nForce" Position [190, 180, 230, 200] Orientation left Expr "0.001*(u[1]+20*sin(0.01*u[2]))^2" MaskIconFrame on MaskIconOpaque on MaskIconRotate none MaskIconUnits autoscale } Block { BlockType Integrator Name "Distance" Ports [1, 1, 0, 0, 0] Position [350, 92, 375, 128] ExternalReset none InitialConditionSource internal InitialCondition "0" LimitOutput off UpperSaturationLimit "inf" LowerSaturationLimit "-inf" ShowSaturationPort off ShowStatePort off AbsoluteTolerance "auto" } Block { BlockType Fcn Name "Hill\nForce" Position [305, 225, 345, 245] Orientation left Expr "30*sin(0.0001*u[1])" MaskIconFrame on MaskIconOpaque on MaskIconRotate none MaskIconUnits autoscale } Block { BlockType MinMax Name "Lower\nLimit" Ports [2, 1, 0, 0, 0] Position [130, 81, 155, 119] Function max Inputs "2" } Block { BlockType Constant Name "Max\nBrake" Position [70, 14, 100, 36] Value "-2000" } Block { BlockType Constant Name "Max\nThrust" Position [15, 59, 45, 81] Value "1000" } Block { BlockType Mux Name "Mux" Ports [2, 1, 0, 0, 0] Position [250, 172, 275, 203] Orientation left Inputs "2" MaskIconFrame on MaskIconOpaque on MaskIconRotate none MaskIconUnits autoscale } Block { BlockType Integrator Name "Speed" Ports [1, 1, 0, 0, 0] Position [295, 92, 320, 128] ExternalReset none InitialConditionSource internal InitialCondition "0" LimitOutput off UpperSaturationLimit "inf" LowerSaturationLimit "-inf" ShowSaturationPort off ShowStatePort off AbsoluteTolerance "auto" } Block { BlockType Sum Name "Sum1" Ports [3, 1, 0, 0, 0] Position [195, 92, 215, 128] Inputs "+--" } Block { BlockType MinMax Name "Upper\nLimit" Ports [2, 1, 0, 0, 0] Position [75, 91, 100, 129] Function min Inputs "2" } Block { BlockType Outport Name "Speed\nOut" Position [360, 40, 380, 60] Port "1" OutputWhenDisabled held InitialOutput "0" MaskIconFrame on MaskIconOpaque on MaskIconRotate none MaskIconUnits autoscale } Line { SrcBlock "Time In" SrcPort 1 DstBlock "Mux" DstPort 2 } Line { SrcBlock "Lower\nLimit" SrcPort 1 DstBlock "Sum1" DstPort 1 } Line { SrcBlock "Max\nBrake" SrcPort 1 Points [5, 0; 0, 65] DstBlock "Lower\nLimit" DstPort 1 } Line { SrcBlock "Max\nThrust" SrcPort 1 Points [0, 30] DstBlock "Upper\nLimit" DstPort 1 } Line { SrcBlock "Upper\nLimit" SrcPort 1 DstBlock "Lower\nLimit" DstPort 2 } Line { SrcBlock "1/mass" SrcPort 1 DstBlock "Speed" DstPort 1 } Line { SrcBlock "Sum1" SrcPort 1 DstBlock "1/mass" DstPort 1 } Line { SrcBlock "Distance" SrcPort 1 Points [5, 0; 0, 125] DstBlock "Hill\nForce" DstPort 1 } Line { SrcBlock "Hill\nForce" SrcPort 1 Points [-140, 0; 0, -125] DstBlock "Sum1" DstPort 2 } Line { SrcBlock "Aero\nForce" SrcPort 1 Points [-15, 0; 0, -70] DstBlock "Sum1" DstPort 3 } Line { SrcBlock "Speed" SrcPort 1 Points [10, 0; 0, 0] Branch { Points [-5, 0; 0, 70] Branch { DstBlock "Mux" DstPort 1 } Branch { Points [0, -130] DstBlock "Speed\nOut" DstPort 1 } } Branch { DstBlock "Distance" DstPort 1 } } Line { SrcBlock "Mux" SrcPort 1 DstBlock "Aero\nForce" DstPort 1 } Line { SrcBlock "Commanded\nThrust" SrcPort 1 DstBlock "Upper\nLimit" DstPort 2 } } } Block { BlockType Clock Name "Clock" Position [240, 100, 260, 120] DeleteFcn "simclock BlockIsBeingDestroyed" PostSaveFcn "simclock Save" Location [30, 40, 140, 75] MaskIconFrame on MaskIconOpaque on MaskIconRotate none MaskIconUnits autoscale } Block { BlockType Constant Name "Constant" Position [25, 15, 45, 35] Value "1" } Block { BlockType Display Name "Display Speed" Ports [1, 0, 0, 0, 0] Position [320, 127, 405, 153] Orientation left Format short Decimation "1" Floating off SampleTime "-1" MaskIconFrame on MaskIconOpaque on MaskIconRotate none MaskIconUnits autoscale } Block { BlockType SubSystem Name "Proportional\nController" Ports [2, 1, 0, 0, 0] Position [135, 12, 265, 63] ShowPortLabels on System { Name "Proportional\nController" Location [324, 253, 567, 409] Open off ScreenColor white Block { BlockType Inport Name "Desired\nSpeed" Position [35, 31, 55, 49] Port "1" PortWidth "-1" SampleTime "-1" } Block { BlockType Inport Name "Actual\nSpeed" Position [35, 85, 55, 105] Port "2" PortWidth "-1" SampleTime "-1" MaskIconFrame on MaskIconOpaque on MaskIconRotate none MaskIconUnits autoscale } Block { BlockType Gain Name "Ke" Position [125, 54, 150, 86] Gain "50" } Block { BlockType Sum Name "Sum" Ports [2, 1, 0, 0, 0] Position [80, 50, 100, 85] Inputs "+-" } Block { BlockType Outport Name "Commanded\nThrust" Position [175, 61, 195, 79] Port "1" OutputWhenDisabled held InitialOutput "0" } Line { SrcBlock "Actual\nSpeed" SrcPort 1 Points [5, 0] DstBlock "Sum" DstPort 2 } Line { SrcBlock "Sum" SrcPort 1 DstBlock "Ke" DstPort 1 } Line { SrcBlock "Desired\nSpeed" SrcPort 1 Points [5, 0] DstBlock "Sum" DstPort 1 } Line { SrcBlock "Ke" SrcPort 1 DstBlock "Commanded\nThrust" DstPort 1 } } } Block { BlockType Scope Name "Scope" Ports [1, 0, 0, 0, 0] Position [445, 85, 475, 115] Floating off Location [188, 365, 512, 604] Open off Grid on TickLabels on ZoomMode on TimeRange "auto" YMin "-5" YMax "5" SaveToWorkspace off SaveName "ScopeData" LimitMaxRows on MaxRows "5000" Decimation "1" SampleInput off SampleTime "0" } Block { BlockType Gain Name "Slider\nGain" Position [60, 15, 110, 35] CopyFcn "slideg Copy" DeleteFcn "slideg DeleteBlock" LoadFcn "slideg Load" NameChangeFcn "slideg NameChange" OpenFcn "slideg Open" ParentCloseFcn "slideg ParentClose" Gain "70" MaskType "Slider Gain" MaskPromptString "Low|Gain|High" MaskStyleString "edit,edit,edit" MaskDisplay "disp('70')" MaskIconFrame on MaskIconOpaque on MaskIconRotate none MaskIconUnits autoscale MaskValueString "0|70|100" } Line { SrcBlock "Automobile\nModel" SrcPort 1 Points [75, 0; 0, 85] Branch { Points [-65, 0] Branch { Points [0, -40] DstBlock "Scope" DstPort 1 } Branch { DstBlock "Display Speed" DstPort 1 } } Branch { Points [0, 35; -380, 0; 0, -125] DstBlock "Proportional\nController" DstPort 2 } } Line { SrcBlock "Proportional\nController" SrcPort 1 DstBlock "Automobile\nModel" DstPort 1 } Line { SrcBlock "Constant" SrcPort 1 DstBlock "Slider\nGain" DstPort 1 } Line { SrcBlock "Slider\nGain" SrcPort 1 DstBlock "Proportional\nController" DstPort 1 } Line { SrcBlock "Clock" SrcPort 1 Points [10, 0; 0, -45] DstBlock "Automobile\nModel" DstPort 2 } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -