📄 c8mgpc1.mdl
字号:
SuppressErrorStatus off
IncludeFileDelimiter "Auto"
ERTCustomFileBanners off
SupportAbsoluteTime on
LogVarNameModifier "rt_"
MatFileLogging on
MultiInstanceERTCode off
SupportNonFinite on
SupportComplex on
PurelyIntegerCode off
SupportContinuousTime on
SupportNonInlinedSFcns on
ExtMode off
ExtModeStaticAlloc off
ExtModeTesting off
ExtModeStaticAllocSize 1000000
ExtModeTransport 0
ExtModeMexFile "ext_comm"
RTWCAPISignals off
RTWCAPIParams off
RTWCAPIStates off
GenerateASAP2 off
}
PropName "Components"
}
}
PropName "Components"
}
Name "Configuration"
SimulationMode "normal"
CurrentDlgPage "Solver"
}
PropName "ConfigurationSets"
}
Simulink.ConfigSet {
$PropName "ActiveConfigurationSet"
$ObjectID 1
}
BlockDefaults {
Orientation "right"
ForegroundColor "black"
BackgroundColor "white"
DropShadow off
NamePlacement "normal"
FontName "Helvetica"
FontSize 10
FontWeight "normal"
FontAngle "normal"
ShowName on
}
BlockParameterDefaults {
Block {
BlockType Mux
Inputs "4"
DisplayOption "none"
BusObject "BusObject"
NonVirtualBus off
}
Block {
BlockType Scope
Floating off
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 "0"
}
Block {
BlockType "S-Function"
FunctionName "system"
SFunctionModules "''"
PortCounts "[]"
}
Block {
BlockType SignalGenerator
WaveForm "sine"
TimeSource "Use simulation time"
Amplitude "1"
Frequency "1"
Units "Hertz"
VectorParams1D on
}
Block {
BlockType Step
Time "1"
Before "0"
After "1"
SampleTime "-1"
VectorParams1D on
ZeroCross on
}
Block {
BlockType Sum
IconShape "rectangular"
Inputs "++"
InputSameDT on
OutDataTypeMode "Same as first input"
OutDataType "sfix(16)"
OutScaling "2^0"
LockScale off
RndMeth "Floor"
SaturateOnIntegerOverflow on
SampleTime "-1"
}
Block {
BlockType TransferFcn
Numerator "[1]"
Denominator "[1 2 1]"
AbsoluteTolerance "auto"
Realization "auto"
}
}
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 "c8mgpc1"
Location [4, 82, 534, 347]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "portrait"
PaperPositionMode "auto"
PaperType "a4letter"
PaperUnits "centimeters"
ZoomFactor "100"
ReportName "simulink-default.rpt"
Block {
BlockType Step
Name "Bias"
Position [185, 44, 220, 66]
FontName "Times New Roman"
FontSize 15
Time "0"
After "0"
SampleTime "1"
}
Block {
BlockType Scope
Name "Control"
Ports [1]
Position [20, 120, 55, 150]
Orientation "left"
FontName "Times New Roman"
FontSize 15
Location [553, 310, 1016, 616]
Open off
NumInputPorts "1"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
TimeRange "30"
SaveToWorkspace on
SaveName "yy1"
DataFormat "Array"
LimitDataPoints off
}
Block {
BlockType Mux
Name "Mux"
Ports [2, 1]
Position [410, 106, 415, 144]
ShowName off
FontName "Times New Roman"
FontSize 15
Inputs "2"
DisplayOption "bar"
}
Block {
BlockType Mux
Name "Mux1"
Ports [2, 1]
Position [265, 177, 270, 208]
Orientation "left"
ShowName off
FontName "Times New Roman"
FontSize 15
Inputs "2"
DisplayOption "bar"
}
Block {
BlockType Scope
Name "Output and\nset-point"
Ports [1]
Position [460, 112, 500, 138]
FontName "Times New Roman"
FontSize 15
Location [553, 60, 1017, 353]
Open on
NumInputPorts "1"
ZoomMode "xonly"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
TimeRange "30"
YMin "-2.5"
YMax "1.5"
SaveToWorkspace on
SaveName "yy"
DataFormat "Array"
LimitDataPoints off
}
Block {
BlockType TransferFcn
Name "Plant"
Position [135, 86, 245, 144]
FontName "Times New Roman"
FontSize 15
Numerator "1"
Denominator "[2 8 1]"
}
Block {
BlockType SignalGenerator
Name "Reference"
Ports [0, 1]
Position [395, 170, 445, 200]
Orientation "left"
FontName "Times New Roman"
FontSize 15
WaveForm "square"
Amplitude "1.000000"
Frequency "0.300000"
Units "rad/sec"
}
Block {
BlockType "S-Function"
Name "S-function"
Ports [1, 1]
Position [105, 174, 215, 216]
Orientation "left"
DropShadow on
ShowName off
FontName "Times New Roman"
FontSize 15
FunctionName "gpc_1a"
Parameters "N1,N2,Nu,r,rho,k_delay,B_pocz,A_pocz,P_pocz,alf"
"a,ts"
MaskType "Controller"
MaskDescription "Adaptive GPC"
MaskHelp "Adaptive GPC algorithm. Parameters: N1, N2 - mi"
"nimal and maximal horizon of output prediction respectively, Nu - control pre"
"diction horizon, r - control increments weight, alpha - tuning parameter of r"
"eference trajectory, k - assumed delay time, B_init - initial value of polyno"
"mial B, A_init - initial value of polynomial A, P_init - initial value on dia"
"gonal of covariance matrix (RLS), forgetting_factor - forgetting factor of RL"
"S, offset, Ts - offset and sampling time respectively."
MaskPromptString "Controller parameters: N1, N2, Nu, r, alpha:|De"
"lay-time of the model: k|Initial value of B polynomial: B_init|Initial value "
"of A polynomial: A_init|RLS parameters P_init, forgetting factor|Sampling par"
"ameters: Ts"
MaskStyleString "edit,edit,edit,edit,edit,edit"
MaskTunableValueString "on,on,on,on,on,on"
MaskCallbackString "|||||"
MaskEnableString "on,on,on,on,on,on"
MaskVisibilityString "on,on,on,on,on,on"
MaskToolTipString "on,on,on,on,on,on"
MaskVarAliasString ",,,,,"
MaskVariables "NN=@1;k_delay=@2;B_pocz=@3;A_pocz=@4;PP=@5;ts=@"
"6;"
MaskInitialization "N1=NN(1);N2=NN(2);Nu=NN(3);r=NN(4);rho=NN(5);\n"
"P_pocz=PP(1);alfa=PP(2);"
MaskDisplay "disp('Adaptive GPC')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
MaskValueString "[1 10 2 0 0]|2|[1 0]|[1 0]|[1000 1]|[1]"
MaskTabNameString ",,,,,"
}
Block {
BlockType Sum
Name "Sum"
Ports [2, 1]
Position [295, 105, 315, 125]
ShowName off
FontName "Times New Roman"
FontSize 15
IconShape "round"
Inputs "++|"
}
Line {
SrcBlock "S-function"
SrcPort 1
Points [-15, 0; 0, -60]
Branch {
Points [0, -20]
DstBlock "Plant"
DstPort 1
}
Branch {
DstBlock "Control"
DstPort 1
}
}
Line {
SrcBlock "Mux1"
SrcPort 1
DstBlock "S-function"
DstPort 1
}
Line {
SrcBlock "Reference"
SrcPort 1
Points [-20, 0]
Branch {
DstBlock "Mux1"
DstPort 1
}
Branch {
Points [0, -50]
DstBlock "Mux"
DstPort 2
}
}
Line {
SrcBlock "Mux"
SrcPort 1
DstBlock "Output and\nset-point"
DstPort 1
}
Line {
SrcBlock "Plant"
SrcPort 1
DstBlock "Sum"
DstPort 2
}
Line {
SrcBlock "Sum"
SrcPort 1
Points [25, 0]
Branch {
DstBlock "Mux"
DstPort 1
}
Branch {
Points [0, 85]
DstBlock "Mux1"
DstPort 2
}
}
Line {
SrcBlock "Bias"
SrcPort 1
Points [80, 0]
DstBlock "Sum"
DstPort 1
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -