Model {
  Name			  "penddemo"
  Version		  2.20
  SimParamPage		  Solver
  SampleTimeColors	  off
  InvariantConstants	  off
  WideVectorLines	  on
  ShowLineWidths	  off
  StartTime		  "0"
  StopTime		  "10000"
  Solver		  ode45
  RelTol		  "1e-3"
  AbsTol		  "1e-6"
  Refine		  "1"
  MaxStep		  "0.02"
  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"
  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
  RTWPlaceOutputsASAP	  off
  RTWRetainRTWFile	  off
  RTWTemplateMakefile	  "grt_default_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		    "penddemo"
    Location		    [51, 133, 743, 476]
    Open		    on
    ToolBar		    on
    StatusBar		    on
    ScreenColor		    white
    PaperOrientation	    landscape
    PaperPositionMode	    auto
    PaperType		    usletter
    PaperUnits		    inches
    Block {
      BlockType		      SubSystem
      Name		      "Animation"
      Ports		      [1, 0, 0, 0, 0]
      Position		      [610, 20, 665, 70]
      ShowPortLabels	      on
      MaskType		      "Pendulum plot"
      MaskDescription	      "Pendulum plot"
      MaskHelp		      "Pendulum animation function using Handle graphi"
"cs."
      MaskPromptString	      "DC reference signal block name:"
      MaskStyleString	      "edit"
      MaskTunableValueString  "on"
      MaskInitialization      "RefBlock=&1;\n"
      MaskDisplay	      "plot([-10 10],[0 0],[-2 -2 2 2],[0 1 1 0],[0 3]"
",[1 5])"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      none
      MaskIconUnits	      autoscale
      MaskValueString	      "Reference"
      System {
	Name			"Animation"
	Location		[636, 545, 877, 643]
	Open			off
	ToolBar			off
	StatusBar		off
	ScreenColor		white
	PaperOrientation	landscape
	PaperPositionMode	auto
	PaperType		usletter
	PaperUnits		inches
	Block {
	  BlockType		  Inport
	  Name			  "in_1"
	  Position		  [40, 25, 60, 45]
	  Port			  "1"
	  PortWidth		  "-1"
	  SampleTime		  "-1"
	}
	Block {
	  BlockType		  "S-Function"
	  Name			  "S-function"
	  Ports			  [1, 0, 0, 0, 0]
	  Position		  [95, 23, 150, 47]
	  DeleteFcn		  "pendan([],[],[],'DeleteBlock');"
	  FunctionName		  "pendan"
	  Parameters		  "RefBlock"
	  PortCounts		  "[]"
	  SFunctionModules	  "''"
	}
	Line {
	  SrcBlock		  "in_1"
	  SrcPort		  1
	  DstBlock		  "S-function"
	  DstPort		  1
	}
      }
    }
    Block {
      BlockType		      Clock
      Name		      "Clock"
      Position		      [560, 140, 580, 160]
      ShowName		      off
      Location		      [30, 40, 140, 75]
    }
    Block {
      BlockType		      SubSystem
      Name		      "Discrete State Estimator"
      Ports		      [2, 1, 0, 0, 0]
      Position		      [425, 192, 470, 243]
      Orientation	      left
      ShowPortLabels	      on
      MaskType		      "Pendulum Discrete state estimator"
      MaskDescription	      "Pendulum discrete state estimator"
      MaskHelp		      "The states of the pendulum and cart system are "
"the pendulum angle and angular velocity and cart position and velocity.  Sinc"
"e the sensors output the pendulum angle and cart position, this state estimat"
"or just does a one step difference calculation to get the velocities."
      MaskPromptString	      "Sample time"
      MaskStyleString	      "edit"
      MaskTunableValueString  "on"
      MaskInitialization      "Ts = @1;"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      none
      MaskIconUnits	      autoscale
      MaskValueString	      "0.02"
      System {
	Name			"Discrete State Estimator"
	Location		[257, 269, 568, 425]
	Open			off
	ToolBar			off
	StatusBar		off
	ScreenColor		white
	PaperOrientation	landscape
	PaperPositionMode	auto
	PaperType		usletter
	PaperUnits		inches
	Block {
	  BlockType		  Inport
	  Name			  "Cart"
	  Position		  [15, 45, 35, 65]
	  Port			  "1"
	  PortWidth		  "-1"
	  SampleTime		  "-1"
	}
	Block {
	  BlockType		  Inport
	  Name			  "Pendulum"
	  Position		  [15, 100, 35, 120]
	  Port			  "2"
	  PortWidth		  "-1"
	  SampleTime		  "-1"
	}
	Block {
	  BlockType		  DiscreteStateSpace
	  Name			  "Dis. State-space"
	  Position		  [115, 65, 235, 105]
	  A			  "zeros(2)"
	  B			  "-eye(2)/Ts"
	  C			  "[0 0; 1 0; 0 0; 0 1]"
	  D			  "[1 0; 1/Ts 0; 0 1; 0 1/Ts]"
	  X0			  "0"
	  SampleTime		  "Ts"
	}
	Block {
	  BlockType		  Mux
	  Name			  "Mux2"
	  Ports			  [2, 1, 0, 0, 0]
	  Position		  [55, 56, 80, 109]
	  ShowName		  off
	  Inputs		  "2"
	}
	Block {
	  BlockType		  Outport
	  Name			  "X"
	  Position		  [260, 75, 280, 95]
	  Port			  "1"
	  OutputWhenDisabled	  held
	  InitialOutput		  "0"
	}
	Line {
	  SrcBlock		  "Pendulum"
	  SrcPort		  1
	  DstBlock		  "Mux2"
	  DstPort		  2
	}
	Line {
	  SrcBlock		  "Dis. State-space"
	  SrcPort		  1
	  DstBlock		  "X"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Cart"
	  SrcPort		  1
	  DstBlock		  "Mux2"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Mux2"
	  SrcPort		  1
	  DstBlock		  "Dis. State-space"
	  DstPort		  1
	}
      }
    }
    Block {
      BlockType		      TransferFcn
      Name		      "Feedforward Gain"
      Position		      [200, 182, 255, 218]
      Numerator		      "[7.12 0]"
      Denominator	      "[1 2]"
    }
    Block {
      BlockType		      Gain
      Name		      "Integral\nGain"
      Position		      [200, 113, 235, 147]
      Gain		      "0.06"
    }
    Block {
      BlockType		      Integrator
      Name		      "Limited\nIntegrator"
      Ports		      [1, 1, 0, 0, 0]
      Position		      [255, 113, 290, 147]
      ExternalReset	      none
      InitialConditionSource  internal
      InitialCondition	      "0"
      LimitOutput	      on
      UpperSaturationLimit    "5"
      LowerSaturationLimit    "-5"
      ShowSaturationPort      off
      ShowStatePort	      off
      AbsoluteTolerance	      "auto"
    }
    Block {
      BlockType		      StateSpace
      Name		      "Matrix gain."
      Position		      [345, 206, 400, 234]
      Orientation	      left
      ShowName		      off
      A			      "[]"
      B			      "[]"
      C			      "[]"
      D			      "K"
      X0		      "0"
      MaskType		      "Matrix gain"
      MaskDescription	      "Matrix Gain:"
      MaskHelp		      "Multiplies input vector by entered matrix to pr"
"oduce output vector."
      MaskPromptString	      "Gain matrix:"
      MaskStyleString	      "edit"
      MaskTunableValueString  "on"
      MaskInitialization      "K = @1;"
      MaskDisplay	      "disp('LQR')"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      none
      MaskIconUnits	      autoscale
      MaskValueString	      "[0 -18 -166.5 -15.2]"
    }
    Block {
      BlockType		      SubSystem
      Name		      "More Info"
      Ports		      [0, 0, 0, 0, 0]
      Position		      [330, 270, 357, 295]
      DropShadow	      on
      ShowName		      off
      ShowPortLabels	      on
      MaskDisplay	      "disp('?')"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      none
      MaskIconUnits	      autoscale
      System {
	Name			"More Info"
	Location		[127, 169, 475, 352]
	Open			off
	ToolBar			off
	StatusBar		off
	ScreenColor		white
	PaperOrientation	landscape
	PaperPositionMode	auto
	PaperType		usletter
	PaperUnits		inches
	Annotation {
	  Position		  [162, 22]
	  Text			  "This system simulates a cart carrying an in"
"verted\npendulum and displays an animation."
	}
	Annotation {
	  Position		  [162, 67]
	  Text			  "The animation is created using MATLAB's \nH"
"andle Graphics. The animation block is \njust a masked S-function."
	}
	Annotation {
	  Position		  [162, 122]
	  Text			  "For more information on what the S-function"
" \ndoes, look at the functions pendan.m, pend0.m, \nand pendsets.m."
	}
      }
    }
    Block {
      BlockType		      SubSystem
      Name		      "More Info2"
      Ports		      [0, 0, 0, 0, 0]
      Position		      [395, 270, 497, 321]
      DropShadow	      on
      ShowName		      off
      OpenFcn		      "simcad(bdroot)"
      ShowPortLabels	      on
      MaskDisplay	      "disp('Double click\\nhere for\\nSimulink Help')"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      none
      MaskIconUnits	      autoscale
      System {
	Name			"More Info2"
	Location		[128, 280, 487, 453]
	Open			off
	ToolBar			off
	StatusBar		off
	ScreenColor		white
	PaperOrientation	landscape
	PaperPositionMode	auto
	PaperType		usletter
	PaperUnits		inches
      }
    }
    Block {
      BlockType		      Mux
      Name		      "Mux"
      Ports		      [3, 1, 0, 0, 0]
      Position		      [540, 29, 570, 61]
      ShowName		      off
      Inputs		      "3"
    }
    Block {
      BlockType		      SubSystem
      Name		      "Pendulum"
      Ports		      [1, 2, 0, 0, 0]
      Position		      [425, 107, 475, 158]
      ShowPortLabels	      on
      MaskType		      "Inverted pendulum on cart"
      MaskDescription	      "Unmask and double-click to see dynamics"
      MaskHelp		      "Nonlinear dynamics of inverted pendulum on cart"
"."
      MaskPromptString	      "Mass of cart (kg):|Mass of pendulum (kg):|Dista"
"nce to pendulum center of mass(m):|Acceleration of gravity (m/s^2):"
      MaskStyleString	      "edit,edit,edit,edit"
      MaskTunableValueString  "on,on,on,on"
      MaskInitialization      "M=@1; m=@2; l=@3; g=@4;"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      none
      MaskIconUnits	      autoscale
      MaskValueString	      "0.455|0.21|0.61/2|9.8"
      System {
	Name			"Pendulum"
	Location		[29, 238, 713, 536]
	Open			off
	ToolBar			off
	StatusBar		off
	ScreenColor		white
	PaperOrientation	landscape
	PaperPositionMode	auto
	PaperType		usletter
	PaperUnits		inches
	Block {
	  BlockType		  Inport
	  Name			  "U"
	  Position		  [35, 70, 55, 90]
	  Port			  "1"
	  PortWidth		  "-1"
	  SampleTime		  "-1"
	}
	Block {
	  BlockType		  Fcn
	  Name			  "Fcn1"
	  Position		  [230, 80, 270, 100]
	  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		  [230, 165, 270, 185]
	  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, 0, 0, 0]
	  Position		  [405, 80, 425, 100]
	  ShowName		  off
	  ExternalReset		  none
	  InitialConditionSource  internal
	  InitialCondition	  "0"
	  LimitOutput		  off
	  UpperSaturationLimit	  "inf"
	  LowerSaturationLimit	  "-inf"
	  ShowSaturationPort	  off
	  ShowStatePort		  off
	  AbsoluteTolerance	  "auto"
	}
	Block {
	  BlockType		  Integrator
	  Name			  "Integrator2"
	  Ports			  [1, 1, 0, 0, 0]
	  Position		  [405, 165, 425, 185]
	  ShowName		  off
	  ExternalReset		  none
	  InitialConditionSource  internal
	  InitialCondition	  "0"
	  LimitOutput		  off
	  UpperSaturationLimit	  "inf"
	  LowerSaturationLimit	  "-inf"
	  ShowSaturationPort	  off
	  ShowStatePort		  off
	  AbsoluteTolerance	  "auto"
	}
	Block {
	  BlockType		  Integrator
	  Name			  "Integrator3"
	  Ports			  [1, 1, 0, 0, 0]
	  Position		  [325, 165, 345, 185]
	  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, 0, 0, 0]
	  Position		  [325, 80, 345, 100]
	  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, 0, 0, 0]
	  Position		  [160, 159, 190, 191]
	  ShowName		  off
	  Inputs		  "3"
	}
	Block {
	  BlockType		  Mux
	  Name			  "Mux1"
	  Ports			  [3, 1, 0, 0, 0]
	  Position		  [160, 74, 190, 106]
	  ShowName		  off
	  Inputs		  "3"
	}
	Block {
	  BlockType		  ToWorkspace
	  Name			  "thp"
	  Position		  [410, 244, 445, 276]
	  VariableName		  "thp"
	  Buffer		  "inf"
	  Decimation		  "1"
	  SampleTime		  "-1"
	}
	Block {
	  BlockType		  ToWorkspace
	  Name			  "thpp"
	  Position		  [320, 244, 355, 276]
	  VariableName		  "thpp"
	  Buffer		  "inf"
	  Decimation		  "1"
	  SampleTime		  "-1"
	}
	Block {
	  BlockType		  ToWorkspace
	  Name			  "xp"
	  Position		  [400, 14, 435, 46]
	  VariableName		  "xp"
	  Buffer		  "inf"
	  Decimation		  "1"
	  SampleTime		  "-1"
	}
	Block {
	  BlockType		  ToWorkspace
	  Name			  "xpp"
	  Position		  [320, 14, 355, 46]
	  VariableName		  "xpp"
	  Buffer		  "inf"
	  Decimation		  "1"
	  SampleTime		  "-1"
	}
	Block {
	  BlockType		  Outport
	  Name			  "Cart"
	  Position		  [490, 80, 510, 100]
	  Port			  "1"
	  OutputWhenDisabled	  held
	  InitialOutput		  "0"
	}
	Block {
	  BlockType		  Outport
	  Name			  "Pendulum"
	  Position		  [490, 165, 510, 185]
	  Port			  "2"
	  OutputWhenDisabled	  held
	  InitialOutput		  "0"
	}
	Line {
	  SrcBlock		  "Integrator1"
	  SrcPort		  1
	  DstBlock		  "Cart"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Mux"
	  SrcPort		  1
	  DstBlock		  "Fcn2"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Mux1"
	  SrcPort		  1
	  DstBlock		  "Fcn1"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "U"
	  SrcPort		  1
	  Points		  [30, 0]
	  Branch {
	    DstBlock		    "Mux1"
	    DstPort		    1
	  }
	  Branch {
	    Points		    [0, 85]
	    DstBlock		    "Mux"
	    DstPort		    1
	  }
	}
	Line {
	  SrcBlock		  "Integrator3"
	  SrcPort		  1
	  Points		  [20, 0]
	  Branch {
	    Points		    [0, 0]
	    DstBlock		    "Integrator2"
	    DstPort		    1
	  }
	  Branch {
	    Points		    [0, -35; -270, 0]
	    Branch {
	      Points		      [0, -50]
	      DstBlock		      "Mux1"
	      DstPort		      2
	    }
	    Branch {
	      Points		      [0, 35]
	      DstBlock		      "Mux"
	      DstPort		      2
	    }
	  }
	  Branch {
	    Points		    [0, 85]
	    DstBlock		    "thp"
	    DstPort		    1
	  }
	}
	Line {
	  SrcBlock		  "Integrator2"
	  SrcPort		  1
	  Points		  [20, 0]
	  Branch {
	    DstBlock		    "Pendulum"
	    DstPort		    1
	  }
	  Branch {
	    Points		    [0, -50; -335, 0]
	    Branch {
	      Points		      [0, -25]
	      DstBlock		      "Mux1"
	      DstPort		      3
	    }
	    Branch {
	      Points		      [0, 60]
	      DstBlock		      "Mux"
	      DstPort		      3
	    }
	  }
	}
	Line {
	  SrcBlock		  "Fcn2"
	  SrcPort		  1
	  Points		  [15, 0]
	  Branch {
	    Points		    [0, 0]
	    DstBlock		    "Integrator3"
	    DstPort		    1
	  }
	  Branch {
	    Points		    [0, 85]
	    DstBlock		    "thpp"
	    DstPort		    1
	  }
	}
	Line {
	  SrcBlock		  "Fcn1"
	  SrcPort		  1
	  Points		  [15, 0]
	  Branch {
	    DstBlock		    "Integrator4"
	    DstPort		    1
	  }
	  Branch {
	    Points		    [0, -60]
	    DstBlock		    "xpp"
	    DstPort		    1
	  }
	}
	Line {
	  SrcBlock		  "Integrator4"
	  SrcPort		  1
	  Points		  [20, 0]
	  Branch {
	    DstBlock		    "Integrator1"
	    DstPort		    1
	  }
	  Branch {
	    Points		    [0, -60]
	    DstBlock		    "xp"
	    DstPort		    1
	  }
	}
      }
    }
    Block {
      BlockType		      Gain
      Name		      "Proportional Gain"
      Position		      [200, 56, 235, 94]
      Gain		      "-9.4"
    }
    Block {
      BlockType		      Constant
      Name		      "Reference"
      Position		      [10, 180, 60, 200]
      Value		      "3.564"
    }
    Block {
      BlockType		      Saturate
      Name		      "Saturation"
      Position		      [380, 125, 405, 145]
      ShowName		      off
      UpperLimit	      "10"
      LowerLimit	      "-10"
    }
    Block {
      BlockType		      SignalGenerator
      Name		      "Signal Gen."
      Position		      [10, 113, 55, 147]
      ShowName		      off
      WaveForm		      sine
      Amplitude		      "5"
      Frequency		      "0.1"
      Units		      Hertz
    }
    Block {
      BlockType		      Sum
      Name		      "Sum"
      Ports		      [4, 1, 0, 0, 0]
      Position		      [340, 112, 360, 158]
      ShowName		      off
      Inputs		      "+++-"
    }
    Block {
      BlockType		      Sum
      Name		      "Sum2"
      Ports		      [2, 1, 0, 0, 0]
      Position		      [140, 120, 160, 140]
      ShowName		      off
      Inputs		      "-+"
    }
    Block {
      BlockType		      Sum
      Name		      "Sum3"
      Ports		      [3, 1, 0, 0, 0]
      Position		      [85, 125, 105, 145]
      ShowName		      off
      Inputs		      "+++"
    }
    Block {
      BlockType		      ToWorkspace
      Name		      "To Workspace"
      Position		      [620, 96, 655, 114]
      ShowName		      off
      VariableName	      "y"
      Buffer		      "1000"
      Decimation	      "1"
      SampleTime	      "0.1"
    }
    Block {
      BlockType		      ToWorkspace
      Name		      "To Workspace1"
      Position		      [620, 141, 655, 159]
      ShowName		      off
      VariableName	      "t"
      Buffer		      "1000"
      Decimation	      "1"
      SampleTime	      "0.1"
    }
    Line {
      SrcBlock		      "Sum2"
      SrcPort		      1
      Points		      [10, 0]
      Branch {
	Points			[0, -55]
	DstBlock		"Proportional Gain"
	DstPort			1
      }
      Branch {
	DstBlock		"Integral\nGain"
	DstPort			1
      }
    }
    Line {
      SrcBlock		      "Discrete State Estimator"
      SrcPort		      1
      DstBlock		      "Matrix gain."
      DstPort		      1
    }
    Line {
      SrcBlock		      "Mux"
      SrcPort		      1
      Points		      [10, 0]
      Branch {
	Points			[0, 60]
	DstBlock		"To Workspace"
	DstPort			1
      }
      Branch {
	DstBlock		"Animation"
	DstPort			1
      }
    }
    Line {
      SrcBlock		      "Pendulum"
      SrcPort		      2
      Points		      [35, 0]
      Branch {
	Points			[0, -90]
	DstBlock		"Mux"
	DstPort			3
      }
      Branch {
	Points			[0, 85]
	DstBlock		"Discrete State Estimator"
	DstPort			2
      }
    }
    Line {
      SrcBlock		      "Sum3"
      SrcPort		      1
      Points		      [0, 0]
      Branch {
	Points			[0, -100]
	DstBlock		"Mux"
	DstPort			1
      }
      Branch {
	Points			[0, 0]
	Branch {
	  Points		  [0, 65]
	  DstBlock		  "Feedforward Gain"
	  DstPort		  1
	}
	Branch {
	  DstBlock		  "Sum2"
	  DstPort		  2
	}
      }
    }
    Line {
      SrcBlock		      "Integral\nGain"
      SrcPort		      1
      DstBlock		      "Limited\nIntegrator"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Sum"
      SrcPort		      1
      DstBlock		      "Saturation"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Proportional Gain"
      SrcPort		      1
      Points		      [65, 0; 0, 45]
      DstBlock		      "Sum"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Feedforward Gain"
      SrcPort		      1
      Points		      [45, 0; 0, -60]
      DstBlock		      "Sum"
      DstPort		      3
    }
    Line {
      SrcBlock		      "Reference"
      SrcPort		      1
      Points		      [0, -55]
      DstBlock		      "Sum3"
      DstPort		      2
    }
    Line {
      SrcBlock		      "Signal Gen."
      SrcPort		      1
      DstBlock		      "Sum3"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Matrix gain."
      SrcPort		      1
      Points		      [-25, 0; 0, -70]
      DstBlock		      "Sum"
      DstPort		      4
    }
    Line {
      SrcBlock		      "Limited\nIntegrator"
      SrcPort		      1
      DstBlock		      "Sum"
      DstPort		      2
    }
    Line {
      SrcBlock		      "Pendulum"
      SrcPort		      1
      Points		      [20, 0]
      Branch {
	Points			[0, -75]
	Branch {
	  Points		  [-375, 0]
	  DstBlock		  "Sum2"
	  DstPort		  1
	}
	Branch {
	  DstBlock		  "Mux"
	  DstPort		  2
	}
      }
      Branch {
	Points			[0, 85]
	DstBlock		"Discrete State Estimator"
	DstPort			1
      }
    }
    Line {
      SrcBlock		      "Saturation"
      SrcPort		      1
      DstBlock		      "Pendulum"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Clock"
      SrcPort		      1
      DstBlock		      "To Workspace1"
      DstPort		      1
    }
    Annotation {
      Position		      [178, 272]
      Text		      "Inverted pendulum on cart with Animation\n(Doub"
"le click on the \"?\" for more info)"
    }
    Annotation {
      Position		      [181, 317]
      Text		      "To start and stop the simulation, use the \"Sta"
"rt/Stop\"\nselection in the \"Simulation\" pull-down menu"
    }
  }
}
