Model { Name "pendcart" Version 4.00 SampleTimeColors off LibraryLinkDisplay "none" WideLines off ShowLineDimensions off ShowPortDataTypes off ShowStorageClass off ExecutionOrder off RecordCoverage off CovPath "/" CovSaveName "covdata" CovMetricSettings "dw" CovNameIncrementing off CovHtmlReporting on BlockNameDataTip off BlockParametersDataTip off BlockDescriptionStringDataTip off ToolBar on StatusBar on BrowserShowLibraryLinks off BrowserLookUnderMasks off Created "Tue Apr 28 19:36:39 2009" UpdateHistory "UpdateHistoryNever" ModifiedByFormat "%" LastModifiedBy "bonf" ModifiedDateFormat "%" LastModifiedDate "Wed Jun 03 17:27:45 2009" ModelVersionFormat "1.%" ConfigurationManager "None" SimParamPage "Solver" StartTime "0.0" StopTime "10.0" SolverMode "Auto" Solver "ode45" RelTol "1e-3" AbsTol "auto" Refine "1" MaxStep "auto" MinStep "auto" MaxNumMinSteps "-1" InitialStep "auto" FixedStep "auto" MaxOrder 5 OutputOption "RefineOutputTimes" OutputTimes "[]" LoadExternalInput off ExternalInput "[t, u]" SaveTime on TimeSaveName "tout" SaveState off StateSaveName "xout" SaveOutput on OutputSaveName "yout" LoadInitialState off InitialState "xInitial" SaveFinalState off FinalStateName "xFinal" SaveFormat "Array" LimitDataPoints on 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" InvalidFcnCallConnMsg "error" SignalLabelMismatchMsg "none" LinearizationMsg "none" VectorMatrixConversionMsg "none" SfunCompatibilityCheckMsg "none" BlockPriorityViolationMsg "warning" ArrayBoundsChecking "none" ConsistencyChecking "none" ZeroCross on Profile off SimulationMode "normal" RTWSystemTargetFile "grt.tlc" RTWOptions "-aEnforceIntegerDowncast=1 -aFoldNonRolledExpr=1 -a" "InlineInvariantSignals=1 -aInlineParameters=0 -aLocalBlockOutputs=1 -aRollThr" "eshold=5 -aZeroInternalMemoryAtStartup=1 -aZeroExternalMemoryAtStartup=1 -aIn" "itFltsAndDblsToZero=1 -aGenerateReport=0 -aGenCodeOnly=0 -aRTWVerbose=1 -aInc" "ludeHyperlinkInReport=0 -aLaunchReport=0 -aForceParamTrailComments=0 -aGenera" "teComments=1 -aIgnoreCustomStorageClasses=1 -aIncHierarchyInIds=0 -aMaxRTWIdL" "en=31 -aShowEliminatedStatements=0 -aPrefixModelToSubsysFcnNames=1 -aIncDataT" "ypeInIds=0 -aInsertBlockDesc=0 -aSimulinkBlockComments=1 -aInlinedPrmAccess=" "\"Literals\" -aSuppressErrorStatus=0 -aModelReferenceCompliant=1 -aSupportNo" "nInlinedSFcns=1 -aSupportContinuousTime=1 -aSupportComplex=1 -aSupportNonFini" "te=1 -aSupportAbsoluteTime=1 -aTargetFcnLib=\"ansi_tfl_tmw.mat\" -aMultiInsta" "nceERTCode=0 -aLogVarNameModifier=\"rt_\" -aIsPILTarget=0 -aCombineOutputUpda" "teFcns=0 -aGenerateASAP2=0 -aGenerateSampleERTMain=0 -aGenerateFullHeader=1 -" "aUtilityFuncGeneration=\"Auto\" -aIncludeFileDelimiter=\"Auto\" -aIncludeMdlT" "erminateFcn=1 -aPurelyIntegerCode=0 -aERTCustomFileBanners=0 -aRTWCAPIStates=" "0 -aRTWCAPIParams=0 -aRTWCAPISignals=0 -aMatFileLogging=1 -aGenFloatMathFcnCa" "lls=\"ANSI_C\" -aExtModeMexFile=\"ext_comm\" -aExtModeTransport=0 -aExtModeSt" "aticAllocSize=1000000 -aExtModeTesting=0 -aExtModeStaticAlloc=0 -aExtMode=0 " "-aInitFltsAndDblsToZero=1 " 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" TryForcingSFcnDF off 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 OptimizeBlockIOStorage on BufferReuse on ParameterPooling on BlockReductionOpt on RTWExpressionDepthLimit 5 BooleanDataType 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" } LineDefaults { FontName "Helvetica" FontSize 9 FontWeight "normal" FontAngle "normal" } System { Name "pendcart" Location [480, 93, 1060, 386] Open on ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "A4" PaperUnits "centimeters" ZoomFactor "100" ReportName "simulink-default.rpt" Block { BlockType Inport Name "In1" Position [145, 88, 175, 102] Port "1" LatchInput off Interpolate on } Block { BlockType Constant Name "Constant" Position [150, 125, 180, 155] Value "0" VectorParams1D on } Block { BlockType SubSystem Name "Pendulum" Ports [2, 4] Position [220, 71, 350, 159] ShowPortLabels on TreatAsAtomicUnit off RTWSystemCode "Auto" RTWFcnNameOpts "Auto" RTWFileNameOpts "Auto" MaskType "Inverted pendulum on cart" MaskDescription "Look under mask to see dynamics" MaskHelp "Nonlinear dynamics of inverted pendulum on cart" "." MaskDisplay "plot([-10 10],[0 0],[-2 -2 2 2],[0 1 1 0],[0 -2" "],[1 5])" MaskIconFrame on MaskIconOpaque off MaskIconRotate "none" MaskIconUnits "autoscale" System { Name "Pendulum" Location [113, 142, 717, 458] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "A4" PaperUnits "centimeters" ZoomFactor "100" Block { BlockType Inport Name "Force" Position [15, 20, 35, 40] Port "1" LatchInput off Interpolate on } Block { BlockType Inport Name "Torque" Position [25, 200, 45, 220] Port "2" LatchInput off Interpolate on } Block { BlockType Sum Name "Add" Ports [2, 1] Position [260, 150, 280, 170] IconShape "round" Inputs "|++" SaturateOnIntegerOverflow off } Block { BlockType Fcn Name "Fcn1" Position [210, 30, 250, 50] ShowName off Expr "(u[1]/m - g*sin(u[3])*cos(u[3]) + l*power(u" "[2],2)*sin(u[3]))/(M/m + power(sin(u[3]),2))" } Block { BlockType Fcn Name "Fcn2" Position [205, 150, 245, 170] ShowName off Expr "(-u[1]*cos(u[3])/m + (M+m)*g*sin(u[3])/m - " "l*power(u[2],2)*sin(u[3])*cos(u[3]))/(l*(M/m + power(sin(u[3]),2)))" } Block { BlockType Integrator Name "Integrator1" Ports [1, 1] Position [385, 30, 405, 50] ShowName off ExternalReset "none" InitialConditionSource "internal" InitialCondition "x0" LimitOutput off UpperSaturationLimit "inf" LowerSaturationLimit "-inf" ShowSaturationPort off ShowStatePort off AbsoluteTolerance "auto" } Block { BlockType Integrator Name "Integrator2" Ports [1, 1] Position [380, 150, 400, 170] ShowName off ExternalReset "none" InitialConditionSource "internal" InitialCondition "theta0" LimitOutput off UpperSaturationLimit "inf" LowerSaturationLimit "-inf" ShowSaturationPort off ShowStatePort off AbsoluteTolerance "auto" } Block { BlockType Integrator Name "Integrator3" Ports [1, 1] Position [300, 150, 320, 170] ShowName off ExternalReset "none" InitialConditionSource "internal" InitialCondition "0" LimitOutput off UpperSaturationLimit "inf" LowerSaturationLimit "-inf" ShowSaturationPort off ShowStatePort off AbsoluteTolerance "auto" } Block { BlockType Integrator Name "Integrator4" Ports [1, 1] Position [305, 30, 325, 50] ShowName off ExternalReset "none" InitialConditionSource "internal" InitialCondition "0" LimitOutput off UpperSaturationLimit "inf" LowerSaturationLimit "-inf" ShowSaturationPort off ShowStatePort off AbsoluteTolerance "auto" } Block { BlockType Mux Name "Mux" Ports [3, 1] Position [135, 144, 165, 176] ShowName off Inputs "3" DisplayOption "none" } Block { BlockType Mux Name "Mux1" Ports [3, 1] Position [140, 24, 170, 56] ShowName off Inputs "3" DisplayOption "none" } Block { BlockType Outport Name "X" Position [470, 30, 490, 50] Port "1" OutputWhenDisabled "held" InitialOutput "0" } Block { BlockType Outport Name "Xdot" Position [470, 70, 490, 90] Port "2" OutputWhenDisabled "held" InitialOutput "0" } Block { BlockType Outport Name "Theta" Position [475, 150, 495, 170] Port "3" OutputWhenDisabled "held" InitialOutput "0" } Block { BlockType Outport Name "ThetaDot" Position [475, 190, 495, 210] Port "4" OutputWhenDisabled "held" InitialOutput "0" } Line { SrcBlock "Integrator1" SrcPort 1 DstBlock "X" DstPort 1 } Line { SrcBlock "Mux" SrcPort 1 DstBlock "Fcn2" DstPort 1 } Line { SrcBlock "Mux1" SrcPort 1 DstBlock "Fcn1" DstPort 1 } Line { SrcBlock "Fcn1" SrcPort 1 DstBlock "Integrator4" DstPort 1 } Line { SrcBlock "Integrator4" SrcPort 1 Points [20, 0] Branch { DstBlock "Integrator1" DstPort 1 } Branch { Points [0, 40] DstBlock "Xdot" DstPort 1 } } Line { SrcBlock "Force" SrcPort 1 Points [30, 0] Branch { DstBlock "Mux1" DstPort 1 } Branch { Points [0, 120] DstBlock "Mux" DstPort 1 } } Line { SrcBlock "Integrator3" SrcPort 1 Points [0, 0; 20, 0] Branch { DstBlock "Integrator2" DstPort 1 } Branch { Points [0, -35; -270, 0] Branch { Points [0, -85] DstBlock "Mux1" DstPort 2 } Branch { Points [0, 35] DstBlock "Mux" DstPort 2 } } Branch { Points [0, 40] DstBlock "ThetaDot" DstPort 1 } } Line { SrcBlock "Integrator2" SrcPort 1 Points [20, 0] Branch { DstBlock "Theta" DstPort 1 } Branch { Points [0, -50; -335, 0] Branch { Points [0, -60] DstBlock "Mux1" DstPort 3 } Branch { Points [0, 60] DstBlock "Mux" DstPort 3 } } } Line { SrcBlock "Torque" SrcPort 1 Points [220, 0] DstBlock "Add" DstPort 2 } Line { SrcBlock "Add" SrcPort 1 DstBlock "Integrator3" DstPort 1 } Line { SrcBlock "Fcn2" SrcPort 1 DstBlock "Add" DstPort 1 } } } Block { BlockType Outport Name "Out1" Position [435, 78, 465, 92] Port "1" OutputWhenDisabled "held" InitialOutput "[]" } Block { BlockType Outport Name "Out2" Position [435, 108, 465, 122] Port "2" OutputWhenDisabled "held" InitialOutput "[]" } Block { BlockType Outport Name "Out3" Position [435, 138, 465, 152] Port "3" OutputWhenDisabled "held" InitialOutput "[]" } Block { BlockType Outport Name "Out4" Position [435, 168, 465, 182] Port "4" OutputWhenDisabled "held" InitialOutput "[]" } Line { SrcBlock "Constant" SrcPort 1 DstBlock "Pendulum" DstPort 2 } Line { SrcBlock "In1" SrcPort 1 DstBlock "Pendulum" DstPort 1 } Line { SrcBlock "Pendulum" SrcPort 1 DstBlock "Out1" DstPort 1 } Line { SrcBlock "Pendulum" SrcPort 2 Points [60, 0; 0, 10] DstBlock "Out2" DstPort 1 } Line { SrcBlock "Pendulum" SrcPort 3 Points [40, 0; 0, 20] DstBlock "Out3" DstPort 1 } Line { SrcBlock "Pendulum" SrcPort 4 Points [20, 0; 0, 30] DstBlock "Out4" DstPort 1 } } }