oploop.mdl
来自「一个simulink中调用m函数的例子」· MDL 代码 · 共 520 行
MDL
520 行
Model {
Name "OPLOOP"
Version 3.00
SimParamPage "Solver"
SampleTimeColors off
InvariantConstants off
WideVectorLines off
ShowLineWidths off
ShowPortDataTypes off
StartTime "0.0"
StopTime "400.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 "Thu Dec 27 14:48:00 2001"
UpdateHistory "UpdateHistoryNever"
ModifiedByFormat "%<Auto>"
ModifiedDateFormat "%<Auto>"
LastModifiedDate "Thu Dec 27 15:14:58 2001"
ModelVersionFormat "1.%<AutoIncrement:11>"
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 "OPLOOP"
Location [105, 336, 579, 594]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "automatic"
PaperOrientation "portrait"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
AutoZoom on
ReportName "simulink-default.rpt"
Block {
BlockType Constant
Name "Current"
Position [40, 159, 160, 181]
Value "0.0*[1 1 1 0 0 0]'"
}
Block {
BlockType Demux
Name "Demux"
Ports [1, 9, 0, 0, 0]
Position [375, 24, 380, 236]
BackgroundColor "black"
ShowName off
Outputs "[1 1 1 1 1 1 1 1 4]"
Port {
PortNumber 1
Name "x"
TestPoint off
RTWStorageClass "Auto"
}
Port {
PortNumber 2
Name "y"
TestPoint off
RTWStorageClass "Auto"
}
Port {
PortNumber 3
Name "z"
TestPoint off
RTWStorageClass "Auto"
}
Port {
PortNumber 4
Name "roll"
TestPoint off
RTWStorageClass "Auto"
}
Port {
PortNumber 5
Name "pitch"
TestPoint off
RTWStorageClass "Auto"
}
Port {
PortNumber 6
Name "yaw"
TestPoint off
RTWStorageClass "Auto"
}
Port {
PortNumber 7
Name "vx"
TestPoint off
RTWStorageClass "Auto"
}
Port {
PortNumber 8
Name "vy"
TestPoint off
RTWStorageClass "Auto"
}
Port {
PortNumber 9
Name "vzpqr"
TestPoint off
RTWStorageClass "Auto"
}
}
Block {
BlockType SubSystem
Name "Double click here to load\nmodel and LQRx cont"
"rol\n"
Ports [0, 0, 0, 0, 0]
Position [40, 29, 102, 54]
ForegroundColor "magenta"
DropShadow on
ShowName off
OpenFcn "shark;global veh;[v1,veh,v3]=vehicle;"
ShowPortLabels off
MaskDisplay "disp('Load Data')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
System {
Name "Double click here to load\nmodel and LQRx co"
"ntrol\n"
Location [6, 471, 110, 508]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
AutoZoom on
}
}
Block {
BlockType Constant
Name "F_b"
Position [40, 109, 160, 131]
NamePlacement "alternate"
ShowName off
Value "1*[416 0 0 0 0 0]'"
}
Block {
BlockType Constant
Name "F_b1"
Position [40, 83, 160, 107]
NamePlacement "alternate"
ShowName off
Value "pi/180*[0 0 0 0 0 -5 0 5]'"
}
Block {
BlockType Constant
Name "F_e"
Position [40, 133, 160, 157]
NamePlacement "alternate"
Value "1.0*[0 0 0 0 0 0]'"
}
Block {
BlockType Scope
Name "Floating Scope"
Ports [0, 0, 0, 0, 0]
Position [230, 38, 260, 52]
Floating on
Location [595, 283, 919, 522]
Open on
NumInputPorts "1"
TickLabels "OneTimeTick"
ZoomMode "on"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
Grid "on"
TimeRange "auto"
YMin "-1"
YMax "1"
SaveToWorkspace off
SaveName "ScopeData"
DataFormat "StructureWithTime"
LimitMaxRows off
MaxRows "5000"
Decimation "1"
SampleInput off
SampleTime "0"
}
Block {
BlockType Mux
Name "Input"
Ports [4, 1, 0, 0, 0]
Position [180, 83, 185, 182]
Inputs "[8 6 6 6]"
DisplayOption "bar"
}
Block {
BlockType Integrator
Name "Integrator"
Ports [1, 1, 0, 0, 0]
Position [320, 118, 345, 142]
ShowName off
ExternalReset "none"
InitialConditionSource "internal"
InitialCondition "0"
LimitOutput off
UpperSaturationLimit "inf"
LowerSaturationLimit "-inf"
ShowSaturationPort off
ShowStatePort off
AbsoluteTolerance "auto"
}
Block {
BlockType Terminator
Name "Terminator"
Position [425, 70, 445, 90]
ShowName off
}
Block {
BlockType Terminator
Name "Terminator1"
Position [425, 95, 445, 115]
ShowName off
}
Block {
BlockType Terminator
Name "Terminator2"
Position [425, 120, 445, 140]
ShowName off
}
Block {
BlockType Terminator
Name "Terminator3"
Position [425, 145, 445, 165]
ShowName off
}
Block {
BlockType Terminator
Name "Terminator4"
Position [425, 220, 445, 240]
ShowName off
}
Block {
BlockType MATLABFcn
Name "Vxdot"
Position [240, 115, 300, 145]
MATLABFcn "vxdot"
OutputWidth "12"
OutputSignalType "real"
}
Block {
BlockType Reference
Name "XY Position"
Ports [2, 0, 0, 0, 0]
Position [425, 18, 445, 67]
NamePlacement "alternate"
ShowName off
SourceBlock "simulink3/Sinks/XY Graph"
SourceType "XY scope."
xmin "0"
xmax "16"
ymin "-8"
ymax "8"
st "-1"
}
Block {
BlockType Reference
Name "XY Velocity"
Ports [2, 0, 0, 0, 0]
Position [425, 168, 445, 217]
NamePlacement "alternate"
ShowName off
SourceBlock "simulink3/Sinks/XY Graph"
SourceType "XY scope."
xmin "-2"
xmax "2"
ymin "0"
ymax "2"
st "-1"
}
Block {
BlockType Mux
Name "xu"
Ports [2, 1, 0, 0, 0]
Position [220, 111, 225, 144]
Inputs "[12 26]"
DisplayOption "bar"
}
Line {
SrcBlock "Current"
SrcPort 1
DstBlock "Input"
DstPort 4
}
Line {
SrcBlock "F_b"
SrcPort 1
DstBlock "Input"
DstPort 2
}
Line {
SrcBlock "F_e"
SrcPort 1
DstBlock "Input"
DstPort 3
}
Line {
SrcBlock "F_b1"
SrcPort 1
DstBlock "Input"
DstPort 1
}
Line {
SrcBlock "Input"
SrcPort 1
DstBlock "xu"
DstPort 2
}
Line {
SrcBlock "xu"
SrcPort 1
DstBlock "Vxdot"
DstPort 1
}
Line {
SrcBlock "Integrator"
SrcPort 1
Points [5, 0]
Branch {
DstBlock "Demux"
DstPort 1
}
Branch {
Points [0, -35; -150, 0]
DstBlock "xu"
DstPort 1
}
}
Line {
SrcBlock "Vxdot"
SrcPort 1
DstBlock "Integrator"
DstPort 1
}
Line {
Name "x"
Labels [0, 0]
SrcBlock "Demux"
SrcPort 1
DstBlock "XY Position"
DstPort 1
}
Line {
Name "y"
Labels [0, 0]
SrcBlock "Demux"
SrcPort 2
DstBlock "XY Position"
DstPort 2
}
Line {
Name "roll"
Labels [0, 0]
SrcBlock "Demux"
SrcPort 4
DstBlock "Terminator1"
DstPort 1
}
Line {
Name "pitch"
Labels [0, 0]
SrcBlock "Demux"
SrcPort 5
DstBlock "Terminator2"
DstPort 1
}
Line {
Name "yaw"
Labels [0, 0]
SrcBlock "Demux"
SrcPort 6
DstBlock "Terminator3"
DstPort 1
}
Line {
Name "z"
Labels [0, 0]
SrcBlock "Demux"
SrcPort 3
DstBlock "Terminator"
DstPort 1
}
Line {
Name "vzpqr"
Labels [0, 0]
SrcBlock "Demux"
SrcPort 9
DstBlock "Terminator4"
DstPort 1
}
Line {
Name "vx"
Labels [0, 0]
SrcBlock "Demux"
SrcPort 7
DstBlock "XY Velocity"
DstPort 1
}
Line {
Name "vy"
Labels [0, 0]
SrcBlock "Demux"
SrcPort 8
DstBlock "XY Velocity"
DstPort 2
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?