Model { Name "ballandbeamnonlinear" Version 4.00 SampleTimeColors off LibraryLinkDisplay "none" WideLines on ShowLineDimensions off ShowPortDataTypes off RecordCoverage off CovPath "/" CovSaveName "covdata" CovNameIncrementing off CovHtmlReporting on BlockNameDataTip off BlockParametersDataTip off BlockDescriptionStringDataTip off ToolBar on StatusBar on BrowserShowLibraryLinks off BrowserLookUnderMasks off Created "Thu Oct 14 13:34:31 2004" UpdateHistory "UpdateHistoryNever" ModifiedByFormat "%" LastModifiedBy "Jacek Nawrot" ModifiedDateFormat "%" LastModifiedDate "Fri Oct 29 16:48:22 2004" ModelVersionFormat "1.%" ConfigurationManager "None" SimParamPage "Solver" StartTime "0" StopTime "1000" SolverMode "SingleTasking" Solver "ode45" RelTol "1e-3" AbsTol "1e-6" Refine "1" MaxStep "0.05" MinStep "auto" MaxNumMinSteps "-1" InitialStep "auto" FixedStep "auto" MaxOrder 5 OutputOption "RefineOutputTimes" OutputTimes "[]" LoadExternalInput off ExternalInput "[]" SaveTime off TimeSaveName "tout" SaveState off StateSaveName "xout" SaveOutput off OutputSaveName "yout" LoadInitialState off InitialState "[]" SaveFinalState off FinalStateName "xFinal" SaveFormat "Array" LimitDataPoints off MaxDataPoints "1000" Decimation "1" AlgebraicLoopMsg "warning" MinStepSizeMsg "warning" UnconnectedInputMsg "warning" UnconnectedOutputMsg "warning" UnconnectedLineMsg "warning" InheritedTsInSrcMsg "warning" SingleTaskRateTransMsg "none" MultiTaskRateTransMsg "error" IntegerOverflowMsg "warning" CheckForMatrixSingularity "none" UnnecessaryDatatypeConvMsg "none" Int32ToFloatConvMsg "warning" SignalLabelMismatchMsg "none" LinearizationMsg "none" VectorMatrixConversionMsg "none" SfunCompatibilityCheckMsg "none" BlockPriorityViolationMsg "warning" ArrayBoundsChecking "none" ConsistencyChecking "none" ZeroCross on Profile off SimulationMode "normal" RTWSystemTargetFile "grt.tlc" RTWInlineParameters off RTWRetainRTWFile off RTWTemplateMakefile "grt_default_tmf" RTWMakeCommand "make_rtw" RTWGenerateCodeOnly off TLCProfiler off TLCDebug off TLCCoverage off AccelSystemTargetFile "accel.tlc" AccelTemplateMakefile "accel_default_tmf" AccelMakeCommand "make_rtw" 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 ExtModeLogAll on OptimizeBlockIOStorage on BufferReuse on ParameterPooling on BlockReductionOpt on BooleanDataType 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 "ballandbeamnonlinear" Location [266, 604, 1013, 918] 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 Clock Name "Clock" Position [620, 170, 640, 190] ShowName off DisplayTime off Decimation "10" } Block { BlockType SubSystem Name "Controller" Ports [2, 1] Position [300, 240, 340, 275] Orientation "left" NamePlacement "alternate" ShowPortLabels on TreatAsAtomicUnit off RTWSystemCode "Auto" RTWFcnNameOpts "Auto" RTWFileNameOpts "Auto" System { Name "Controller" Location [206, 359, 1262, 702] Open on ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" AutoZoom on Block { BlockType Inport Name "y" Position [55, 198, 85, 212] Port "1" Interpolate on } Block { BlockType Inport Name "r_ref" Position [130, 253, 160, 267] Port "2" Interpolate on } Block { BlockType Outport Name "u" Position [945, 88, 975, 102] Port "1" OutputWhenDisabled "held" InitialOutput "[]" } } } Block { BlockType Demux Name "Demux" Ports [1, 2] Position [535, 136, 540, 174] BackgroundColor "black" ShowName off Outputs "2" BusSelectionMode off } Block { BlockType Gain Name "Linearization\nGain\n" Position [170, 150, 200, 180] Gain "m*g/Km" Multiplication "Element-wise(K.*u)" SaturateOnIntegerOverflow on } Block { BlockType Mux Name "Mux" Ports [3, 1] Position [600, 56, 605, 94] ShowName off Inputs "3" DisplayOption "bar" } Block { BlockType SubSystem Name "Non Linear Plant" Ports [2, 1] Position [310, 137, 350, 173] ShowPortLabels on TreatAsAtomicUnit off RTWSystemCode "Auto" RTWFcnNameOpts "Auto" RTWFileNameOpts "Auto" System { Name "Non Linear Plant" Location [174, 493, 1155, 972] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" AutoZoom on Block { BlockType Inport Name "r_ref\n" Position [415, 33, 445, 47] Port "1" Interpolate on } Block { BlockType Inport Name "u" Position [70, 363, 100, 377] Port "2" Interpolate on } Block { BlockType SubSystem Name "Animation" Ports [1] Position [760, 65, 815, 115] ShowPortLabels on TreatAsAtomicUnit off RTWSystemCode "Auto" RTWFcnNameOpts "Auto" RTWFileNameOpts "Auto" MaskType "Pendulum plot" MaskDescription "Pendulum plot" MaskHelp "Pendulum animation function using Handle gr" "aphics." MaskPromptString "DC reference signal block name:|Radius of B" "all|Length of Beam|Initial ball position|Initial beam angle|Pause between fra" "me|Mass of ball|Beam's moment of inertia|Drawing Scale|Km" MaskStyleString "edit,edit,edit,edit,edit,edit,edit,edit,edi" "t,edit" MaskTunableValueString "on,on,on,on,on,on,on,on,on,on" MaskCallbackString "|||||||||" MaskEnableString "on,on,on,on,on,on,on,on,on,on" MaskVisibilityString "on,on,on,on,on,on,on,on,on,on" MaskToolTipString "on,on,on,on,on,on,on,on,on,on" MaskVariables "RefBlock=&1;BallRadius=@2;BeamLength=@3;ini" "t_r=@4;init_angle=@5;pauseTime=@6;Mball=@7;Ibeam=@8;DrawingScale=@9;Km=@10;" MaskDisplay "plot([-10 10 10 -10 -10],[0 0 3 3 0],[-2 0 " "2],[0 1 0],[-7 -7 7 7 -7],[1 1.5 1.5 1 1])\nplot([ 5.2500\n 5.1915\n " " 5.0434\n 4.8750\n 4.7651\n 4.7651\n 4.8750\n 5.0434\n 5.19" "15\n 5.2500], [ 1.7500\n 1.9107\n 1.9962\n 1.9665\n 1.8355" "\n 1.6645\n 1.5335\n 1.5038\n 1.5893\n 1.7500])" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" MaskValueString "Reference|Rball|Lbeam|x_init_plant(2)|x_ini" "t_plant(4)|[0]|m|JB|20|Km" MaskVariableAliases ",,,,,,,,," System { Name "Animation" Location [560, 319, 988, 455] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" AutoZoom on Block { BlockType Inport Name "in_1" Position [40, 25, 60, 45] Port "1" Interpolate on } Block { BlockType "S-Function" Name "S-function" Ports [1, 1] Position [95, 22, 210, 48] DeleteFcn "pendan([],[],[],'DeleteBlock');" FunctionName "s_ball_and_beam_an" Parameters "RefBlock,Lbeam,Rball,[init_r init_angle" "],pauseTime,Ibeam,Mball,DrawingScale,Km" PortCounts "[]" SFunctionModules "''" } Block { BlockType Stop Name "Stop Simulation" Position [295, 17, 330, 53] } Block { BlockType Display Name "u" Ports [1] Position [315, 85, 405, 115] Format "short" Decimation "1" Floating off SampleTime "-1" } Line { SrcBlock "in_1" SrcPort 1 DstBlock "S-function" DstPort 1 } Line { SrcBlock "S-function" SrcPort 1 Points [30, 0] Branch { DstBlock "Stop Simulation" DstPort 1 } Branch { Points [0, 65] DstBlock "u" DstPort 1 } } } } Block { BlockType Fcn Name "Function r_ddot" Position [245, 265, 305, 295] Expr "(-m*g*sin(u(1)) - Fr*u(2)) / (JB/Rball^2 + " "m)" } Block { BlockType Fcn Name "Function theta_ddot" Position [245, 375, 305, 405] Expr "(Km*u(1) - m*g*u(2)*cos(u(3)))/JR" } Block { BlockType Mux Name "Mux" Ports [2, 1] Position [625, 286, 630, 324] ShowName off Inputs "2" DisplayOption "bar" } Block { BlockType Mux Name "Mux1" Ports [3, 1] Position [195, 360, 200, 420] ShowName off Inputs "3" DisplayOption "bar" } Block { BlockType Mux Name "Mux2" Ports [2, 1] Position [195, 250, 200, 310] ShowName off Inputs "2" DisplayOption "bar" } Block { BlockType Mux Name "Mux3" Ports [6, 1] Position [695, 29, 700, 151] ShowName off Inputs "6" DisplayOption "bar" } Block { BlockType Integrator Name "r" Ports [1, 1] Position [470, 265, 500, 295] ExternalReset "none" InitialConditionSource "internal" InitialCondition "x_init_plant(1)" LimitOutput off UpperSaturationLimit "inf" LowerSaturationLimit "-inf" ShowSaturationPort off ShowStatePort off AbsoluteTolerance "auto" Port { PortNumber 1 Name "r" TestPoint off LinearAnalysisOutput off LinearAnalysisInput off RTWStorageClass "Auto" } } Block { BlockType Integrator Name "r_dot" Ports [1, 1] Position [380, 265, 410, 295] ExternalReset "none" InitialConditionSource "internal" InitialCondition "x_init_plant(3)" LimitOutput off UpperSaturationLimit "inf" LowerSaturationLimit "-inf" ShowSaturationPort off ShowStatePort off AbsoluteTolerance "auto" } Block { BlockType Integrator Name "theta" Ports [1, 1] Position [470, 375, 500, 405] ExternalReset "none" InitialConditionSource "internal" InitialCondition "x_init_plant(2)" LimitOutput off UpperSaturationLimit "inf" LowerSaturationLimit "-inf" ShowSaturationPort off ShowStatePort off AbsoluteTolerance "auto" Port { PortNumber 1 Name "theta" TestPoint off LinearAnalysisOutput off LinearAnalysisInput off RTWStorageClass "Auto" } } Block { BlockType Integrator Name "theta_dot" Ports [1, 1] Position [380, 375, 410, 405] ExternalReset "none" InitialConditionSource "internal" InitialCondition "x_init_plant(4)" LimitOutput off UpperSaturationLimit "inf" LowerSaturationLimit "-inf" ShowSaturationPort off ShowStatePort off AbsoluteTolerance "auto" } Block { BlockType Outport Name "y" Position [680, 298, 710, 312] Port "1" OutputWhenDisabled "held" InitialOutput "[]" } Line { SrcBlock "Mux" SrcPort 1 DstBlock "y" DstPort 1 } Line { SrcBlock "r_dot" SrcPort 1 Points [-10, 0; 25, 0] Branch { DstBlock "r" DstPort 1 } Branch { Points [0, 45; -270, 0; 0, -30] DstBlock "Mux2" DstPort 2 } Branch { Points [0, -180] DstBlock "Mux3" DstPort 4 } } Line { SrcBlock "theta_dot" SrcPort 1 Points [0, 0; 30, 0] Branch { Points [0, 0] DstBlock "theta" DstPort 1 } Branch { Points [0, -270] DstBlock "Mux3" DstPort 5 } } Line { Name "theta" Labels [0, 0] SrcBlock "theta" SrcPort 1 Points [0, 0; 65, 0] Branch { Points [40, 0] DstBlock "Mux" DstPort 2 } Branch { Points [0, 55; -415, 0; 0, -35] Branch { DstBlock "Mux1" DstPort 3 } Branch { Points [-15, 0; 0, -145] DstBlock "Mux2" DstPort 1 } } Branch { Points [0, -310] DstBlock "Mux3" DstPort 3 } } Line { Name "r" Labels [0, 0] SrcBlock "r" SrcPort 1 Points [0, 0; 35, 0] Branch { Points [70, 0] DstBlock "Mux" DstPort 1 } Branch { Points [0, 60; -385, 0; 0, 50] DstBlock "Mux1" DstPort 2 } Branch { Points [0, -220] DstBlock "Mux3" DstPort 2 } } Line { SrcBlock "u" SrcPort 1 Points [0, 0; 15, 0] Branch { DstBlock "Mux1" DstPort 1 } Branch { Points [0, -230] DstBlock "Mux3" DstPort 6 } } Line { SrcBlock "Function theta_ddot" SrcPort 1 DstBlock "theta_dot" DstPort 1 } Line { SrcBlock "Mux1" SrcPort 1 DstBlock "Function theta_ddot" DstPort 1 } Line { SrcBlock "Function r_ddot" SrcPort 1 DstBlock "r_dot" DstPort 1 } Line { SrcBlock "Mux2" SrcPort 1 DstBlock "Function r_ddot" DstPort 1 } Line { SrcBlock "r_ref\n" SrcPort 1 DstBlock "Mux3" DstPort 1 } Line { SrcBlock "Mux3" SrcPort 1 DstBlock "Animation" DstPort 1 } } } Block { BlockType Constant Name "Reference" Position [45, 30, 95, 50] Value "0.418" VectorParams1D on } Block { BlockType Reference Name "Reference Switch" Ports [2, 1] Position [185, 45, 220, 85] SourceBlock "simulink3/Nonlinear/Manual Switch" SourceType "Manual Switch" sw "0" action "0" Port { PortNumber 1 Name "r_ref" TestPoint off LinearAnalysisOutput off LinearAnalysisInput off RTWStorageClass "Auto" } } Block { BlockType Scope Name "Scope" Ports [2] Position [650, 221, 680, 254] Floating off Location [430, 489, 1248, 956] Open off NumInputPorts "2" TickLabels "OneTimeTick" ZoomMode "on" List { ListType AxesTitles axes1 "%" axes2 "%" } Grid "on" TimeRange "auto" YMin "-7~-0.45" YMax "8~0.3" SaveToWorkspace off SaveName "ScopeData" DataFormat "StructureWithTime" LimitDataPoints off MaxDataPoints "5000" Decimation "1" SampleInput off SampleTime "0" } Block { BlockType Step Name "Step" Position [50, 80, 80, 110] Time "2" Before "0" After "0.4" SampleTime "0" VectorParams1D on } Block { BlockType Sum Name "Sum" Ports [2, 1] Position [235, 155, 255, 175] ShowName off IconShape "round" Inputs "|++" SaturateOnIntegerOverflow on } Block { BlockType ToWorkspace Name "To Workspace" Position [680, 126, 715, 144] ShowName off VariableName "y" MaxDataPoints "1000" Decimation "1" SampleTime "0.1" SaveFormat "Array" } Block { BlockType ToWorkspace Name "To Workspace1" Position [680, 171, 715, 189] ShowName off VariableName "t" MaxDataPoints "1000" Decimation "1" SampleTime "0.1" SaveFormat "Array" } Line { SrcBlock "Mux" SrcPort 1 Points [25, 0; 0, 60] DstBlock "To Workspace" DstPort 1 } Line { SrcBlock "Clock" SrcPort 1 DstBlock "To Workspace1" DstPort 1 } Line { SrcBlock "Reference" SrcPort 1 Points [5, 0; 0, 15] DstBlock "Reference Switch" DstPort 1 } Line { SrcBlock "Non Linear Plant" SrcPort 1 Points [55, 0] Branch { Points [0, 95] DstBlock "Controller" DstPort 1 } Branch { DstBlock "Demux" DstPort 1 } } Line { SrcBlock "Demux" SrcPort 1 Points [0, 0; 20, 0] Branch { Points [0, -70] DstBlock "Mux" DstPort 2 } Branch { Points [0, 85] DstBlock "Scope" DstPort 1 } } Line { SrcBlock "Demux" SrcPort 2 Points [0, 0; 30, 0] Branch { Points [0, -80] DstBlock "Mux" DstPort 3 } Branch { Points [0, 80] DstBlock "Scope" DstPort 2 } } Line { SrcBlock "Step" SrcPort 1 Points [25, 0; 0, -20] DstBlock "Reference Switch" DstPort 2 } Line { Name "r_ref" SrcBlock "Reference Switch" SrcPort 1 Points [30, 0] Branch { Points [0, 60; -130, 0; 0, 40] DstBlock "Linearization\nGain\n" DstPort 1 } Branch { Points [25, 0] Branch { Labels [1, 0] Points [190, 0] Branch { DstBlock "Mux" DstPort 1 } Branch { Points [0, 200] DstBlock "Controller" DstPort 2 } } Branch { Points [0, 80] DstBlock "Non Linear Plant" DstPort 1 } } } Line { Labels [1, 0] SrcBlock "Linearization\nGain\n" SrcPort 1 DstBlock "Sum" DstPort 1 } Line { SrcBlock "Controller" SrcPort 1 Points [-50, 0] DstBlock "Sum" DstPort 2 } Line { SrcBlock "Sum" SrcPort 1 DstBlock "Non Linear Plant" DstPort 2 } } }