⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pi_bisection.mdl

📁 这是关于matlab stateflow的源码例子
💻 MDL
字号:
Model {
  Name			  "pi_bisection"
  Version		  3.00
  SimParamPage		  "Solver"
  SampleTimeColors	  off
  InvariantConstants	  off
  WideVectorLines	  off
  ShowLineWidths	  off
  ShowPortDataTypes	  off
  StartTime		  "0.0"
  StopTime		  "10.0"
  SolverMode		  "Auto"
  Solver		  "ode45"
  RelTol		  "1e-3"
  AbsTol		  "auto"
  Refine		  "1"
  MaxStep		  "auto"
  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		  "Matrix"
  LimitMaxRows		  off
  MaxRows		  "1000"
  Decimation		  "1"
  AlgebraicLoopMsg	  "warning"
  MinStepSizeMsg	  "warning"
  UnconnectedInputMsg	  "warning"
  UnconnectedOutputMsg	  "warning"
  UnconnectedLineMsg	  "warning"
  InheritedTsInSrcMsg	  "warning"
  IntegerOverflowMsg	  "warning"
  UnnecessaryDatatypeConvMsg "none"
  Int32ToFloatConvMsg	  "warning"
  SignalLabelMismatchMsg  "none"
  ConsistencyChecking	  "off"
  ZeroCross		  on
  SimulationMode	  "normal"
  BlockDataTips		  on
  BlockParametersDataTip  on
  BlockAttributesDataTip  off
  BlockPortWidthsDataTip  off
  BlockDescriptionStringDataTip	off
  BlockMaskParametersDataTip off
  ToolBar		  on
  StatusBar		  on
  BrowserShowLibraryLinks off
  BrowserLookUnderMasks	  off
  OptimizeBlockIOStorage  on
  BufferReuse		  on
  BooleanDataType	  off
  RTWSystemTargetFile	  "grt.tlc"
  RTWInlineParameters	  off
  RTWRetainRTWFile	  off
  RTWTemplateMakefile	  "grt_default_tmf"
  RTWMakeCommand	  "make_rtw"
  RTWGenerateCodeOnly	  off
  ExtModeMexFile	  "ext_comm"
  ExtModeBatchMode	  off
  ExtModeTrigType	  "manual"
  ExtModeTrigMode	  "oneshot"
  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	  off
  Created		  "Tue Jan 26 16:55:01 1999"
  UpdateHistory		  "UpdateHistoryNever"
  ModifiedByFormat	  "%<Auto>"
  LastModifiedBy	  "pgoddard"
  ModifiedDateFormat	  "%<Auto>"
  LastModifiedDate	  "Wed Mar 10 08:54:40 1999"
  ModelVersionFormat	  "1.%<AutoIncrement:5>"
  ConfigurationManager	  "none"
  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		    "pi_bisection"
    Location		    [7, 75, 340, 223]
    Open		    on
    ModelBrowserVisibility  off
    ModelBrowserWidth	    200
    ScreenColor		    "automatic"
    PaperOrientation	    "landscape"
    PaperPositionMode	    "auto"
    PaperType		    "usletter"
    PaperUnits		    "inches"
    ZoomFactor		    "100"
    AutoZoom		    on
    ReportName		    "simulink-default.rpt"
    Block {
      BlockType		      SubSystem
      Name		      "Chart"
      Ports		      [0, 1, 0, 1, 0]
      Position		      [80, 53, 140, 107]
      ShowPortLabels	      on
      MaskType		      "Stateflow"
      MaskDescription	      "Stateflow diagram"
      MaskDisplay	      "plot(sf('Private','sfblk','xIcon'),sf('Private'"
",'sfblk','yIcon'));text(0.5,0,sf('Private', 'sfblk', 'tIcon'),'HorizontalAl',"
"'Center','VerticalAl','Bottom');"
      MaskSelfModifiable      on
      MaskIconFrame	      off
      MaskIconOpaque	      off
      MaskIconRotate	      "none"
      MaskIconUnits	      "autoscale"
      System {
	Name			"Chart"
	Location		[257, 457, 812, 717]
	Open			off
	ModelBrowserVisibility	off
	ModelBrowserWidth	200
	ScreenColor		"white"
	PaperOrientation	"landscape"
	PaperPositionMode	"auto"
	PaperType		"usletter"
	PaperUnits		"inches"
	ZoomFactor		"100"
	AutoZoom		on
	Block {
	  BlockType		  TriggerPort
	  Name			  "E"
	  Ports			  [0, 1, 0, 0, 0]
	  Position		  [20, 101, 40, 119]
	  TriggerType		  "rising"
	  ShowOutputPort	  on
	  OutputDataType	  "auto"
	}
	Block {
	  BlockType		  Demux
	  Name			  " Demux "
	  Ports			  [1, 1, 0, 0, 0]
	  Position		  [270, 180, 320, 220]
	  Outputs		  "1"
	}
	Block {
	  BlockType		  "S-Function"
	  Name			  " SFunction "
	  Tag			  "Stateflow S-Function pi_bisection 1"
	  Ports			  [1, 2, 0, 0, 0]
	  Position		  [180, 100, 230, 180]
	  FunctionName		  "sf_sfun"
	  PortCounts		  "[1 2]"
	  SFunctionModules	  "''"
	}
	Block {
	  BlockType		  Terminator
	  Name			  " Terminator "
	  Position		  [460, 191, 480, 209]
	}
	Block {
	  BlockType		  Outport
	  Name			  "min"
	  Position		  [460, 101, 480, 119]
	  Port			  "1"
	  OutputWhenDisabled	  "held"
	  InitialOutput		  "[]"
	}
	Line {
	  SrcBlock		  " Demux "
	  SrcPort		  1
	  DstBlock		  " Terminator "
	  DstPort		  1
	}
	Line {
	  SrcBlock		  " SFunction "
	  SrcPort		  1
	  Points		  [0, 80]
	  DstBlock		  " Demux "
	  DstPort		  1
	}
	Line {
	  SrcBlock		  " SFunction "
	  SrcPort		  2
	  DstBlock		  "min"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "E"
	  SrcPort		  1
	  DstBlock		  " SFunction "
	  DstPort		  1
	}
      }
    }
    Block {
      BlockType		      Display
      Name		      "Display"
      Ports		      [1, 0, 0, 0, 0]
      Position		      [170, 63, 315, 97]
      Format		      "long"
      Decimation	      "1"
      Floating		      off
      SampleTime	      "-1"
    }
    Block {
      BlockType		      Step
      Name		      "Step"
      Position		      [20, 15, 50, 45]
      Time		      "1"
      Before		      "0"
      After		      "1"
      SampleTime	      "0"
    }
    Line {
      SrcBlock		      "Step"
      SrcPort		      1
      Points		      [55, 0]
      DstBlock		      "Chart"
      DstPort		      trigger
    }
    Line {
      SrcBlock		      "Chart"
      SrcPort		      1
      DstBlock		      "Display"
      DstPort		      1
    }
  }
}

# Finite State Machines
# -- File save dated 10-Mar-1999 08:54:41
#
#    Stateflow Version 2.0 (R11) dated Jan 21 1999, 19:12:04
#
#

Stateflow {

	machine {
		id         		1
		name       		"pi_bisection"
		created    		"26-Jan-1999 16:55:01"
		firstTarget		19
		sfVersion  		20011061
	}

	chart {
		id                     		2
		name                   		"Chart"
		windowPosition         		[264 261 336.75 282.75]
		viewLimits             		[2.532356521127497 295.7823565211275 0 246.75]
		screen                 		[1 1 1024 768 1.333333333333333]
		firstTransition        		7
		firstJunction          		3
		visible                		1
		machine                		1
		decomposition          		CLUSTER_CHART
		firstEvent             		13
		firstData              		14
		chartFileNumber        		1
	}

	junction {
		id         		3
		position   		[149.2449300590246 72.00000000000023 7]
		chart      		2
		linkNode   		[2 0 4]
		type       		CONNECTIVE_JUNCTION
	}

	junction {
		id         		4
		position   		[278.8771801618627 72.75000000000046 7]
		chart      		2
		linkNode   		[2 3 5]
		type       		CONNECTIVE_JUNCTION
	}

	junction {
		id         		5
		position   		[148.4949300590246 146.2500000000003 7]
		chart      		2
		linkNode   		[2 4 6]
		type       		CONNECTIVE_JUNCTION
	}

	junction {
		id         		6
		position   		[149.2449300590246 214.5000000000003 7]
		chart      		2
		linkNode   		[2 5 0]
		type       		CONNECTIVE_JUNCTION
	}

	transition {
		id           		7
		labelString  		"{min=3;max=4;\n"
						"diff=max-min;}"
		labelPosition		[153.2242262619579 19.25288239487849 95.25000000000001 34.5]
		fontSize     		14
		src {
			intersection		[0 0 0 0 146.9718771315599 14.25000000000006]
		}
		dst {
			id          		3
			intersection		[0 0 -1 -1 149.2449300590246 65.00000000000023]
		}
		midPoint     		[147.9418525404033 29.6678644295971]
		chart        		2
		linkNode     		[2 0 8]
		dataLimits   		[146.8449300590246 151.6449300590246 14.25000000000009 65.00000000000023]
	}

	transition {
		id           		8
		labelPosition		[221.8043313908042 77.96922852439624 9.750000000000002 18]
		fontSize     		14
		src {
			id          		3
			intersection		[0 0.9666809628139204 0.2559842107106455 -1 156.0116967987221 
								  73.79188947497475]
		}
		dst {
			id          		4
			intersection		[0 -0.9960687754500442 0.08858326350642624 -1 271.9046987337124 
								  73.37008284454544]
		}
		midPoint     		[194.0975918359039 78.75511784931882]
		chart        		2
		linkNode     		[2 7 9]
		dataLimits   		[156.0116967987221 271.9046987337124 71.68818389151673 78.81264488641209]
	}

	transition {
		id           		9
		labelString  		"{diff=max-min}"
		labelPosition		[18.76542277649322 67.49447894781844 92.25000000000001 18]
		fontSize     		14
		src {
			id          		6
			intersection		[0 -0.09053574604251853 0.9958932064677039 -1 148.611179836727 
								  221.4712524452742]
		}
		dst {
			id          		3
			intersection		[0 -0.9761870601839527 0.2169304578186562 -1 142.411620637737 
								  73.51851320473082]
		}
		midPoint     		[18.72187713155992 192.7500000000001]
		chart        		2
		linkNode     		[2 8 10]
		dataLimits   		[12.4375328803923 148.6111798367266 72.91110792283858 231.4795187937111]
	}

	transition {
		id           		10
		labelString  		"[diff>1e-6]\n"
						"{mid=(max+min)/2;}"
		labelPosition		[152.9905594296539 93.00000000000023 123.75 34.5]
		fontSize     		14
		src {
			id          		3
			intersection		[0 0.1788854381999832 0.9838699100999075 -1 150.4971281264245 
								  78.88708937069958]
		}
		dst {
			id          		5
			intersection		[0 -0.2747211278973781 -0.9615239476408232 -1 146.571882163743 
								  139.5193323665145]
		}
		midPoint     		[149.0810562741944 97.88031084433246]
		chart        		2
		linkNode     		[2 9 11]
		dataLimits   		[142.066455666226 150.9758374607633 78.88708937069961 139.5193323665145]
	}

	transition {
		id           		11
		labelString  		"{max=mid;}"
		labelPosition		[54.50067186623701 162.7500000000004 72 18]
		fontSize     		14
		src {
			id          		5
			intersection		[0 -0.8741572761215377 0.4856429311786321 -1 142.3758291261739 
								  149.6495005182507]
		}
		dst {
			id          		6
			intersection		[0 -0.9958932064677039 -0.09053574604251853 -1 142.2736776137507 
								  213.8662497777027]
		}
		midPoint     		[126.775423573352 171.5053962368847]
		chart        		2
		linkNode     		[2 10 12]
		dataLimits   		[123.7076414131518 142.3758291261737 149.6495005182509 215.532107504885]
	}

	transition {
		id           		12
		labelString  		"[ml.sin(mid)>0]\n"
						"{min=mid;}"
		labelPosition		[167.236702991974 154.5000000000003 94.50000000000001 34.5]
		fontSize     		14
		src {
			id          		5
			intersection		[0 0.1788854381999832 0.9838699100999075 -1 149.7471281264245 
								  153.1370893706996]
		}
		dst {
			id          		6
			intersection		[0 0.9333456062030595 -0.358979079308869 -1 155.778349302446 
								  211.9871464448382]
		}
		midPoint     		[159.4323678357436 175.6782533332357]
		chart        		2
		linkNode     		[2 11 0]
		dataLimits   		[149.7471281264247 167.9439794346273 153.1370893706996 211.9871464448382]
	}

	event {
		id         		13
		name       		"E"
		linkNode   		[2 0 0]
		scope      		INPUT_EVENT
		trigger    		RISING_EDGE_EVENT
		machine    		1
	}

	data {
		id         		14
		name       		"max"
		linkNode   		[2 0 15]
		scope      		LOCAL_DATA
		machine    		1
		dataType   		"double"
	}

	data {
		id         		15
		name       		"min"
		linkNode   		[2 14 16]
		scope      		OUTPUT_DATA
		machine    		1
		dataType   		"double"
	}

	data {
		id         		16
		name       		"diff"
		linkNode   		[2 15 17]
		scope      		LOCAL_DATA
		machine    		1
		dataType   		"double"
	}

	data {
		id         		17
		name       		"mid"
		linkNode   		[2 16 0]
		scope      		LOCAL_DATA
		machine    		1
		dataType   		"double"
	}

	instance {
		id     		18
		name   		"Chart"
		machine		1
		chart  		2
	}

	target {
		id               		19
		name             		"sfun"
		description      		"Default Simulink S-Function Target."
		machine          		1
		linkNode         		[1 0 0]
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -