# $Revision: 1.21 $
Model {
  Name			  "simppend"
  Version		  2.20
  SimParamPage		  Solver
  SampleTimeColors	  off
  InvariantConstants	  off
  WideVectorLines	  off
  ShowLineWidths	  off
  StartTime		  "0"
  StopTime		  "10000"
  Solver		  ode45
  RelTol		  "1e-3"
  AbsTol		  "1e-6"
  Refine		  "1"
  MaxStep		  ".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"
  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		    "simppend"
    Location		    [66, 129, 557, 474]
    Open		    on
    ToolBar		    on
    StatusBar		    on
    ScreenColor		    white
    PaperOrientation	    landscape
    PaperPositionMode	    auto
    PaperType		    usletter
    PaperUnits		    inches
    Block {
      BlockType		      Gain
      Name		      "1/len"
      Position		      [85, 69, 125, 121]
      Gain		      "0.25"
    }
    Block {
      BlockType		      SubSystem
      Name		      "Animation\nFunction"
      Ports		      [1, 0, 0, 0, 0]
      Position		      [415, 67, 450, 103]
      ShowPortLabels	      on
      MaskType		      "Animation Block"
      MaskPromptString	      "Sample time:"
      MaskStyleString	      "edit"
      MaskTunableValueString  "on"
      MaskVariables	      "ts=@1;"
      MaskDisplay	      "plot([.1,.9],[.9,.9],[.5,.2],[.9,.25],[.475,.47"
"5,.525,.525,.475],[.875,.925,.925,.875,.875])"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      none
      MaskIconUnits	      normalized
      MaskValueString	      "0.05"
      System {
	Name			"Animation\nFunction"
	Location		[599, 653, 814, 741]
	Open			off
	ToolBar			off
	StatusBar		off
	ScreenColor		white
	PaperOrientation	landscape
	PaperPositionMode	auto
	PaperType		usletter
	PaperUnits		inches
	Block {
	  BlockType		  Inport
	  Name			  "In1"
	  Position		  [20, 40, 50, 50]
	  Port			  "1"
	  PortWidth		  "-1"
	  SampleTime		  "-1"
	}
	Block {
	  BlockType		  "S-Function"
	  Name			  "Animation function"
	  Ports			  [1, 0, 0, 0, 0]
	  Position		  [70, 25, 140, 65]
	  DeleteFcn		  "if ~isempty(findobj('type','figure','name',"
"'simppend Animation'));close('simppend Animation'); end;"
	  FunctionName		  "pndanim1"
	  Parameters		  "ts"
	  PortCounts		  "[]"
	  SFunctionModules	  "''"
	}
	Line {
	  SrcBlock		  "In1"
	  SrcPort		  1
	  DstBlock		  "Animation function"
	  DstPort		  1
	}
      }
    }
    Block {
      BlockType		      SignalGenerator
      Name		      "Applied\nMoment M"
      Position		      [20, 18, 65, 52]
      WaveForm		      square
      Amplitude		      "1"
      Frequency		      "0.100000"
      Units		      "rad/sec"
    }
    Block {
      BlockType		      SubSystem
      Name		      "More Info"
      Ports		      [0, 0, 0, 0, 0]
      Position		      [270, 265, 297, 290]
      DropShadow	      on
      ShowName		      off
      ShowPortLabels	      on
      MaskDisplay	      "disp('?')"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      none
      MaskIconUnits	      autoscale
      System {
	Name			"More Info"
	Location		[125, 256, 484, 429]
	Open			off
	ToolBar			off
	StatusBar		off
	ScreenColor		white
	PaperOrientation	landscape
	PaperPositionMode	auto
	PaperType		usletter
	PaperUnits		inches
	Annotation {
	  Position		  [176, 72]
	  Text			  "Associated with the demo is an animation fu"
"nction that\nwill automatically open a figure window and display to it."
	}
	Annotation {
	  Position		  [170, 27]
	  Text			  "This system models a simple pendulum system"
" with\nan applied external moment that varies periodically."
	}
	Annotation {
	  Position		  [172, 117]
	  Text			  "Try experimenting with different initial co"
"nditions and\ndifferent setting for the applied moment M."
	}
      }
    }
    Block {
      BlockType		      SubSystem
      Name		      "More Info1"
      Ports		      [0, 0, 0, 0, 0]
      Position		      [351, 263, 453, 314]
      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 Info1"
	Location		[128, 280, 487, 453]
	Open			off
	ToolBar			off
	StatusBar		off
	ScreenColor		white
	PaperOrientation	landscape
	PaperPositionMode	auto
	PaperType		usletter
	PaperUnits		inches
      }
    }
    Block {
      BlockType		      Constant
      Name		      "Pivot point\nfor pendulum"
      Position		      [190, 9, 220, 41]
      Value		      "0"
    }
    Block {
      BlockType		      Sum
      Name		      "Sum2"
      Ports		      [3, 1, 0, 0, 0]
      Position		      [180, 77, 200, 113]
      ShowName		      off
      Inputs		      "+--"
    }
    Block {
      BlockType		      Gain
      Name		      "c/(m*len^2)"
      Position		      [185, 138, 220, 182]
      Orientation	      left
      Gain		      ".05"
    }
    Block {
      BlockType		      Fcn
      Name		      "g*sin(theta)"
      Position		      [155, 208, 235, 242]
      Orientation	      left
      Expr		      "9.8*sin(u)"
    }
    Block {
      BlockType		      Integrator
      Name		      "theta"
      Ports		      [1, 1, 0, 0, 0]
      Position		      [260, 78, 285, 112]
      ExternalReset	      none
      InitialConditionSource  internal
      InitialCondition	      "45"
      LimitOutput	      off
      UpperSaturationLimit    "inf"
      LowerSaturationLimit    "-inf"
      ShowSaturationPort      off
      ShowStatePort	      off
      AbsoluteTolerance	      "auto"
    }
    Block {
      BlockType		      Integrator
      Name		      "theta\ndot"
      Ports		      [1, 1, 0, 0, 0]
      Position		      [215, 78, 240, 112]
      ExternalReset	      none
      InitialConditionSource  internal
      InitialCondition	      "0"
      LimitOutput	      off
      UpperSaturationLimit    "inf"
      LowerSaturationLimit    "-inf"
      ShowSaturationPort      off
      ShowStatePort	      off
      AbsoluteTolerance	      "auto"
    }
    Block {
      BlockType		      Mux
      Name		      "x & theta"
      Ports		      [2, 1, 0, 0, 0]
      Position		      [350, 67, 380, 103]
      Inputs		      "2"
    }
    Line {
      SrcBlock		      "Sum2"
      SrcPort		      1
      DstBlock		      "theta\ndot"
      DstPort		      1
    }
    Line {
      SrcBlock		      "c/(m*len^2)"
      SrcPort		      1
      Points		      [-35, 0; 0, -55]
      DstBlock		      "Sum2"
      DstPort		      3
    }
    Line {
      SrcBlock		      "theta\ndot"
      SrcPort		      1
      Points		      [0, 0]
      Branch {
	Points			[0, 65]
	DstBlock		"c/(m*len^2)"
	DstPort			1
      }
      Branch {
	DstBlock		"theta"
	DstPort			1
      }
    }
    Line {
      SrcBlock		      "Pivot point\nfor pendulum"
      SrcPort		      1
      Points		      [80, 0; 0, 50]
      DstBlock		      "x & theta"
      DstPort		      1
    }
    Line {
      SrcBlock		      "theta"
      SrcPort		      1
      Points		      [15, 0]
      Branch {
	DstBlock		"x & theta"
	DstPort			2
      }
      Branch {
	Points			[0, 130]
	DstBlock		"g*sin(theta)"
	DstPort			1
      }
    }
    Line {
      SrcBlock		      "1/len"
      SrcPort		      1
      DstBlock		      "Sum2"
      DstPort		      2
    }
    Line {
      SrcBlock		      "g*sin(theta)"
      SrcPort		      1
      Points		      [-90, 0; 0, -130]
      DstBlock		      "1/len"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Applied\nMoment M"
      SrcPort		      1
      Points		      [75, 0; 0, 50]
      DstBlock		      "Sum2"
      DstPort		      1
    }
    Line {
      SrcBlock		      "x & theta"
      SrcPort		      1
      DstBlock		      "Animation\nFunction"
      DstPort		      1
    }
    Annotation {
      Position		      [157, 277]
      Text		      "Simple Pendulum System\n(Double click on the \""
"?\" for more info)"
    }
    Annotation {
      Position		      [156, 317]
      Text		      "To start and stop the simulation, use the \"Sta"
"rt/Stop\"\nselection in the \"Simulation\" pull-down menu"
    }
  }
}
