bp_example.mdl

来自「这里有一个用matlab」· MDL 代码 · 共 925 行 · 第 1/2 页

MDL
925
字号
	  }
	}
	hdlcoderui.hdlcc {
	  $ObjectID		  11
	  Description		  "HDL Coder custom configuration component"
	  Version		  "1.2.0"
	  Name			  "HDL Coder"
	  Array {
	    Type		    "Cell"
	    Dimension		    1
	    Cell		    ""
	    PropName		    "HDLConfigFile"
	  }
	  HDLCActiveTab		  "0"
	}
	PropName		"Components"
      }
      Name		      "Configuration"
      CurrentDlgPage	      "Solver"
    }
    PropName		    "ConfigurationSets"
  }
  Simulink.ConfigSet {
    $PropName		    "ActiveConfigurationSet"
    $ObjectID		    1
  }
  BlockDefaults {
    Orientation		    "right"
    ForegroundColor	    "black"
    BackgroundColor	    "white"
    DropShadow		    off
    NamePlacement	    "normal"
    FontName		    "Arial"
    FontSize		    12
    FontWeight		    "normal"
    FontAngle		    "normal"
    ShowName		    on
  }
  BlockParameterDefaults {
    Block {
      BlockType		      Abs
      SaturateOnIntegerOverflow	on
      ZeroCross		      on
      SampleTime	      "-1"
    }
    Block {
      BlockType		      Constant
      Value		      "1"
      VectorParams1D	      on
      SamplingMode	      "Sample based"
      OutDataTypeMode	      "Inherit from 'Constant value'"
      OutDataType	      "sfix(16)"
      ConRadixGroup	      "Use specified scaling"
      OutScaling	      "2^0"
      SampleTime	      "inf"
      FramePeriod	      "inf"
    }
    Block {
      BlockType		      From
      IconDisplay	      "Tag"
    }
    Block {
      BlockType		      Fcn
      Expr		      "sin(u[1])"
      SampleTime	      "-1"
    }
    Block {
      BlockType		      Gain
      Gain		      "1"
      Multiplication	      "Element-wise(K.*u)"
      ParameterDataTypeMode   "Same as input"
      ParameterDataType	      "sfix(16)"
      ParameterScalingMode    "Best Precision: Matrix-wise"
      ParameterScaling	      "2^0"
      OutDataTypeMode	      "Same as input"
      OutDataType	      "sfix(16)"
      OutScaling	      "2^0"
      LockScale		      off
      RndMeth		      "Floor"
      SaturateOnIntegerOverflow	on
      SampleTime	      "-1"
    }
    Block {
      BlockType		      Goto
      IconDisplay	      "Tag"
    }
    Block {
      BlockType		      Inport
      Port		      "1"
      UseBusObject	      off
      BusObject		      "BusObject"
      BusOutputAsStruct	      off
      PortDimensions	      "-1"
      SampleTime	      "-1"
      DataType		      "auto"
      OutDataType	      "sfix(16)"
      OutScaling	      "2^0"
      SignalType	      "auto"
      SamplingMode	      "auto"
      LatchByDelayingOutsideSignal off
      LatchByCopyingInsideSignal off
      Interpolate	      on
    }
    Block {
      BlockType		      Integrator
      ExternalReset	      "none"
      InitialConditionSource  "internal"
      InitialCondition	      "0"
      LimitOutput	      off
      UpperSaturationLimit    "inf"
      LowerSaturationLimit    "-inf"
      ShowSaturationPort      off
      ShowStatePort	      off
      AbsoluteTolerance	      "auto"
      IgnoreLimit	      off
      ZeroCross		      on
      ContinuousStateAttributes	"''"
    }
    Block {
      BlockType		      Math
      Operator		      "exp"
      OutputSignalType	      "auto"
      SampleTime	      "-1"
      OutDataTypeMode	      "Same as first input"
      OutDataType	      "sfix(16)"
      OutScaling	      "2^0"
      LockScale		      off
      RndMeth		      "Floor"
      SaturateOnIntegerOverflow	on
    }
    Block {
      BlockType		      Outport
      Port		      "1"
      UseBusObject	      off
      BusObject		      "BusObject"
      BusOutputAsStruct	      off
      PortDimensions	      "-1"
      SampleTime	      "-1"
      DataType		      "auto"
      OutDataType	      "sfix(16)"
      OutScaling	      "2^0"
      SignalType	      "auto"
      SamplingMode	      "auto"
      OutputWhenDisabled      "held"
      InitialOutput	      "[]"
    }
    Block {
      BlockType		      Product
      Inputs		      "2"
      Multiplication	      "Element-wise(.*)"
      CollapseMode	      "All dimensions"
      CollapseDim	      "1"
      InputSameDT	      on
      OutDataTypeMode	      "Same as first input"
      OutDataType	      "sfix(16)"
      OutScaling	      "2^0"
      LockScale		      off
      RndMeth		      "Zero"
      SaturateOnIntegerOverflow	on
      SampleTime	      "-1"
    }
    Block {
      BlockType		      RandomNumber
      Mean		      "0"
      Variance		      "1"
      Seed		      "0"
      SampleTime	      "-1"
      VectorParams1D	      on
    }
    Block {
      BlockType		      RateTransition
      Integrity		      on
      Deterministic	      on
      X0		      "0"
      OutPortSampleTime	      "-1"
    }
    Block {
      BlockType		      Scope
      ModelBased	      off
      TickLabels	      "OneTimeTick"
      ZoomMode		      "on"
      Grid		      "on"
      TimeRange		      "auto"
      YMin		      "-5"
      YMax		      "5"
      SaveToWorkspace	      off
      SaveName		      "ScopeData"
      LimitDataPoints	      on
      MaxDataPoints	      "5000"
      Decimation	      "1"
      SampleInput	      off
      SampleTime	      "-1"
    }
    Block {
      BlockType		      SubSystem
      ShowPortLabels	      "FromPortIcon"
      Permissions	      "ReadWrite"
      PermitHierarchicalResolution "All"
      TreatAsAtomicUnit	      off
      SystemSampleTime	      "-1"
      RTWFcnNameOpts	      "Auto"
      RTWFileNameOpts	      "Auto"
      RTWMemSecFuncInitTerm   "Inherit from model"
      RTWMemSecFuncExecute    "Inherit from model"
      RTWMemSecDataConstants  "Inherit from model"
      RTWMemSecDataInternal   "Inherit from model"
      RTWMemSecDataParameters "Inherit from model"
      SimViewingDevice	      off
      DataTypeOverride	      "UseLocalSettings"
      MinMaxOverflowLogging   "UseLocalSettings"
    }
    Block {
      BlockType		      Sum
      IconShape		      "rectangular"
      Inputs		      "++"
      CollapseMode	      "All dimensions"
      CollapseDim	      "1"
      InputSameDT	      on
      OutDataTypeMode	      "Same as first input"
      OutDataType	      "sfix(16)"
      OutScaling	      "2^0"
      LockScale		      off
      RndMeth		      "Floor"
      SaturateOnIntegerOverflow	on
      SampleTime	      "-1"
    }
  }
  AnnotationDefaults {
    HorizontalAlignment	    "center"
    VerticalAlignment	    "middle"
    ForegroundColor	    "black"
    BackgroundColor	    "white"
    DropShadow		    off
    FontName		    "Arial"
    FontSize		    12
    FontWeight		    "normal"
    FontAngle		    "normal"
    UseDisplayTextAsClickCallback off
  }
  LineDefaults {
    FontName		    "Arial"
    FontSize		    12
    FontWeight		    "normal"
    FontAngle		    "normal"
  }
  System {
    Name		    "BP_example"
    Location		    [5, 79, 892, 639]
    Open		    on
    ModelBrowserVisibility  off
    ModelBrowserWidth	    200
    ScreenColor		    "white"
    PaperOrientation	    "landscape"
    PaperPositionMode	    "auto"
    PaperType		    "usletter"
    PaperUnits		    "inches"
    TiledPaperMargins	    [0.500000, 0.500000, 0.500000, 0.500000]
    TiledPageScale	    1
    ShowPageBoundaries	    off
    ZoomFactor		    "89"
    ReportName		    "simulink-default.rpt"
    Block {
      BlockType		      Reference
      Name		      "Bifilar_Pendulum_With_ViscDamping"
      Ports		      [5, 1]
      Position		      [190, 200, 700, 550]
      FontSize		      14
      SourceBlock	      "BifilarPendulumLib/Bifilar_Pendulum_With_ViscDa"
"mping"
      SourceType	      "Bifilar Pendulum Simulation"
      ShowPortLabels	      "FromPortIcon"
      SystemSampleTime	      "-1"
      FunctionWithSeparateData off
      RTWMemSecFuncInitTerm   "Inherit from model"
      RTWMemSecFuncExecute    "Inherit from model"
      RTWMemSecDataConstants  "Inherit from model"
      RTWMemSecDataInternal   "Inherit from model"
      RTWMemSecDataParameters "Inherit from model"
      D			      "Dbp"
      SigD		      "SigDbp"
      h			      "hbp"
      Sigh		      "Sighbp"
      SigTh		      "SigThbp"
      ThSeed		      "0"
    }
    Block {
      BlockType		      Constant
      Name		      "Constant"
      Position		      [65, 220, 120, 250]
      Value		      "m_kg"
    }
    Block {
      BlockType		      Constant
      Name		      "Constant1"
      Position		      [65, 290, 125, 320]
      Value		      "I_kgm2"
    }
    Block {
      BlockType		      Constant
      Name		      "Constant2"
      Position		      [65, 359, 125, 391]
      Value		      "CVisc"
    }
    Block {
      BlockType		      Constant
      Name		      "Constant3"
      Position		      [65, 430, 125, 460]
      Value		      "KDAero"
    }
    Block {
      BlockType		      Constant
      Name		      "Constant4"
      Position		      [65, 500, 125, 530]
      Value		      "Th0rad"
    }
    Block {
      BlockType		      Gain
      Name		      "Gain"
      Position		      [787, 295, 843, 355]
      Orientation	      "up"
      ShowName		      off
      Gain		      "180/pi"
      ParameterDataTypeMode   "Inherit via internal rule"
      OutDataTypeMode	      "Inherit via internal rule"
      SaturateOnIntegerOverflow	off
      Port {
	PortNumber		1
	Name			"Theta_deg"
	RTWStorageClass		"Auto"
	DataLoggingNameMode	"SignalName"
      }
    }
    Block {
      BlockType		      Scope
      Name		      "Scope"
      Ports		      [1]
      Position		      [900, 269, 930, 301]
      Floating		      off
      Location		      [904, 81, 1395, 499]
      Open		      on
      NumInputPorts	      "1"
      List {
	ListType		AxesTitles
	axes1			"%<SignalLabel>"
      }
      TimeRange		      "200"
      YMin		      "-30"
      YMax		      "30"
      DataFormat	      "StructureWithTime"
      LimitDataPoints	      off
      SampleTime	      "0"
    }
    Block {
      BlockType		      RateTransition
      Name		      "Sensor\nSample\nRate"
      Position		      [735, 355, 770, 395]
      OutPortSampleTime	      "0.06"
    }
    Block {
      BlockType		      SubSystem
      Name		      "Subsystem"
      Ports		      []
      Position		      [15, 15, 949, 130]
      ShowName		      off
      MinAlgLoopOccurrences   off
      RTWSystemCode	      "Auto"
      FunctionWithSeparateData off
      MaskHideContents	      off
      MaskDisplay	      "image(imread('BP_equation.jpg'))"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      "none"
      MaskIconUnits	      "autoscale"
      System {
	Name			"Subsystem"
	Location		[433, 403, 723, 499]
	Open			off
	ModelBrowserVisibility	off
	ModelBrowserWidth	200
	ScreenColor		"white"
	PaperOrientation	"landscape"
	PaperPositionMode	"auto"
	PaperType		"usletter"
	PaperUnits		"inches"
	TiledPaperMargins	[0.500000, 0.500000, 0.500000, 0.500000]
	TiledPageScale		1
	ShowPageBoundaries	off
	ZoomFactor		"100"
	Annotation {
	  Name			  "This subsystem intentionally left blank."
	  Position		  [137, 45]
	}
      }
    }
    Block {
      BlockType		      Outport
      Name		      "Out1"
      Position		      [900, 368, 930, 382]
      IconDisplay	      "Port number"
      BusOutputAsStruct	      off
    }
    Line {
      SrcBlock		      "Constant"
      SrcPort		      1
      DstBlock		      "Bifilar_Pendulum_With_ViscDamping"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Constant1"
      SrcPort		      1
      DstBlock		      "Bifilar_Pendulum_With_ViscDamping"
      DstPort		      2
    }
    Line {
      SrcBlock		      "Constant2"
      SrcPort		      1
      DstBlock		      "Bifilar_Pendulum_With_ViscDamping"
      DstPort		      3
    }
    Line {
      SrcBlock		      "Constant3"
      SrcPort		      1
      DstBlock		      "Bifilar_Pendulum_With_ViscDamping"
      DstPort		      4
    }
    Line {
      SrcBlock		      "Constant4"
      SrcPort		      1
      DstBlock		      "Bifilar_Pendulum_With_ViscDamping"
      DstPort		      5
    }
    Line {
      Name		      "Theta_deg"
      Labels		      [2, 0]
      SrcBlock		      "Gain"
      SrcPort		      1
      Points		      [0, -5]
      DstBlock		      "Scope"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Bifilar_Pendulum_With_ViscDamping"
      SrcPort		      1
      DstBlock		      "Sensor\nSample\nRate"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Sensor\nSample\nRate"
      SrcPort		      1
      Points		      [40, 0]
      Branch {
	DstBlock		"Out1"
	DstPort			1
      }
      Branch {
	DstBlock		"Gain"
	DstPort			1
      }
    }
  }
}

⌨️ 快捷键说明

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