Commit 060d6790 authored by Prima Aditya's avatar Prima Aditya
Browse files

Gitlab Runner Update from cstd-aux-files/master:Merge branch...

Gitlab Runner Update from cstd-aux-files/master:Merge branch 'Changes_according_to_new_script' into 'master'
parent 9c9500a1

Too many changes to show.

To preserve performance only 289 of 289+ files are displayed.
%% Controller design for process evaporator
% This skript uses a model of the system, obtained with the identification
% toolbox. The model should be named mod1
Ts = 0.05; % sampling time
[Ad,Bd,Cd,Dd] = ssdata(mod1);
SysD = ss(Ad,Bd,Cd,Dd, Ts); % discrete model
% This re-definition is needed, because of the special idss-form of mod1
n = size(Ad,1) % order of the model
[no, ni] = size(Dd) % number of inputs and outputs
%% Define the continuous time model
SysCns=d2c(SysD,'zoh');
%introduce scaling here if required
umax=[1 1 1]; % See Control objective 2.c
ymax=[.1 2 2]; % See Control objective 2.a [0.1 2 2];
scale_inc =diag(umax);
scale_outc=diag(1./ymax);
SysC = scale_outc * SysCns * scale_inc; % scaled continuous time model
[A,B,C,D] = ssdata(SysC);
%% Design a state-feedback and obsever
% FIXME FIXME FIXME FIXME
% This is already implemented in
controllerdesign2
% but as a self-test try writing by yourself the files for controller and
% observer design
% The script should return
% f0, fI, Aobs, Bobs
%% Obtain model of the closed-loop system with the linear model
Tmax = 75; % max simulation time (in minutes)
[Acllqg,Bcllqg,Ccllqg,Dcllqg] = linmod('evaplinmod');
Scllqg = ss(Acllqg,Bcllqg,Ccllqg,Dcllqg);
%% Simultate the closed-loop system
T1 = (0:Ts:Tmax)';
[Yr1q,T1]=step(Scllqg(:,1),T1);
[Yr2q,T1]=step(Scllqg(:,2),T1);
[Yr3q,T1]=step(Scllqg(:,3),T1);
%% Calculate initial states for the non-linear model
% The non-linear model should always start from a stationary point
% calculate steady state for observer
xobs0 = -inv(Aobs)*Bobs*[inv(scale_inc)*u0; scale_outc*y0];
% xobs0 = -inv(Aobs)*Bobs*[u0; y0];
% steady state for integrator
xint0 = inv(fI)*(inv(scale_inc)*u0 - f0*xobs0);
%% Simulate the non-linear model and plot the outputs and control inputs of
%% both the non-linear and the linear model
% step_time = 1; % step after ... minutes
%
% comp_input = 'level'; % Compensate level
% simandplot
%
%
% comp_input = 'pressure';
% simandplot
% %
% comp_input = 'temp';
% simandplot
%
step_time = 20;
comp_input = 'dist';
simandplot
% get range of movement for inputs and outputs % outputs: 1:3, inputs 4:6
rangevec = range(outputdat)
stdvec = std(outputdat(end-200:end,:)) % standard deviation outputs/inputs
%% simple function, finding the index of the settling time moment
settime = @(vec,dev) find(abs(vec-vec(1))>(0.05+2*dev), 1, 'last');
stvec_level = T1( settime(outputdat(:,1),1*stdvec(1)) ) - step_time
stvec_press = T1( settime(outputdat(:,2),1*stdvec(2)) ) - step_time
stvec_temp = T1( settime(outputdat(:,3),1*stdvec(3)) ) - step_time
# $Revision: 1.2 $
Model {
Name "controller"
Version 7.4
MdlSubVersion 0
GraphicalInterface {
NumRootInports 6
Inport {
Name "sp 1"
}
Inport {
Name "sp 2"
}
Inport {
Name "sp 3"
}
Inport {
Name "y1"
}
Inport {
Name "y2"
}
Inport {
Name "y3"
}
NumRootOutports 1
Outport {
BusObject ""
BusOutputAsStruct "off"
Name "u"
}
ParameterArgumentNames ""
ComputedModelVersion "1.86"
NumModelReferences 0
NumTestPointedSignals 0
}
SavedCharacterEncoding "windows-1252"
SaveDefaultBlockParams on
ScopeRefreshTime 0.035000
OverrideScopeRefreshTime on
DisableAllScopes off
DataTypeOverride "UseLocalSettings"
MinMaxOverflowLogging "UseLocalSettings"
MinMaxOverflowArchiveMode "Overwrite"
MaxMDLFileLineLength 120
Created "Thu Apr 15 08:21:54 1999"
Creator "jwu"
UpdateHistory "UpdateHistoryNever"
ModifiedByFormat "%<Auto>"
LastModifiedBy "tutor"
ModifiedDateFormat "%<Auto>"
LastModifiedDate "Thu Jan 24 13:34:00 2013"
RTWModifiedTimeStamp 280934841
ModelVersionFormat "1.%<AutoIncrement:86>"
ConfigurationManager "none"
SampleTimeColors on
SampleTimeAnnotations off
LibraryLinkDisplay "none"
WideLines on
ShowLineDimensions on
ShowPortDataTypes off
ShowLoopsOnError on
IgnoreBidirectionalLines off
ShowStorageClass off
ShowTestPointIcons on
ShowSignalResolutionIcons on
ShowViewerIcons on
SortedOrder off
ExecutionContextIcon off
ShowLinearizationAnnotations on
BlockNameDataTip off
BlockParametersDataTip on
BlockDescriptionStringDataTip off
ToolBar on
StatusBar on
BrowserShowLibraryLinks off
BrowserLookUnderMasks off
SimulationMode "normal"
LinearizationMsg "none"
Profile off
ParamWorkspaceSource "MATLABWorkspace"
AccelSystemTargetFile "accel.tlc"
AccelTemplateMakefile "accel_default_tmf"
AccelMakeCommand "make_rtw"
TryForcingSFcnDF off
RecordCoverage off
CovPath "/"
CovSaveName "covdata"
CovMetricSettings "dw"
CovNameIncrementing off
CovHtmlReporting on
CovForceBlockReductionOff on
covSaveCumulativeToWorkspaceVar on
CovSaveSingleToWorkspaceVar on
CovCumulativeVarName "covCumulativeData"
CovCumulativeReport off
CovReportOnPause on
CovModelRefEnable "Off"
CovExternalEMLEnable off
ExtModeBatchMode off
ExtModeEnableFloating on
ExtModeTrigType "manual"
ExtModeTrigMode "oneshot"
ExtModeTrigPort "1"
ExtModeTrigElement "any"
ExtModeTrigDuration 1000
ExtModeTrigDurationFloating "auto"
ExtModeTrigHoldOff 0
ExtModeTrigDelay 0
ExtModeTrigDirection "rising"
ExtModeTrigLevel 0
ExtModeArchiveMode "off"
ExtModeAutoIncOneShot off
ExtModeIncDirWhenArm off
ExtModeAddSuffixToVar off
ExtModeWriteAllDataToWs off
ExtModeArmWhenConnect off
ExtModeSkipDownloadWhenConnect off
ExtModeLogAll on
ExtModeAutoUpdateStatusClock off
BufferReuse on
ShowModelReferenceBlockVersion off
ShowModelReferenceBlockIO off
Array {
Type "Handle"
Dimension 1
Simulink.ConfigSet {
$ObjectID 1
Version "1.6.0"
Array {
Type "Handle"
Dimension 8
Simulink.SolverCC {
$ObjectID 2
Version "1.6.0"
StartTime "0.0"
StopTime "Tmax"
AbsTol "1e-6"
FixedStep ".01"
InitialStep "auto"
MaxNumMinSteps "-1"
MaxOrder 5
ZcThreshold "auto"
ConsecutiveZCsStepRelTol "10*128*eps"
MaxConsecutiveZCs "1000"
ExtrapolationOrder 4
NumberNewtonIterations 1
MaxStep "0.01"
MinStep "auto"
MaxConsecutiveMinStep "1"
RelTol "1e-3"
SolverMode "SingleTasking"
Solver "ode45"
SolverName "ode45"
ShapePreserveControl "DisableAll"
ZeroCrossControl "UseLocalSettings"
ZeroCrossAlgorithm "Nonadaptive"
AlgebraicLoopSolver "TrustRegion"
SolverResetMethod "Fast"
PositivePriorityOrder off
AutoInsertRateTranBlk off
SampleTimeConstraint "Unconstrained"
InsertRTBMode "Whenever possible"
}
Simulink.DataIOCC {
$ObjectID 3
Version "1.6.0"
Decimation "1"
ExternalInput "[u t]"
FinalStateName "xFinal"
InitialState "[]"
LimitDataPoints off
MaxDataPoints "1000"
LoadExternalInput off
LoadInitialState off
SaveFinalState off
SaveCompleteFinalSimState off
SaveFormat "Array"
SaveOutput on
SaveState off
SignalLogging on
InspectSignalLogs off
SaveTime on
ReturnWorkspaceOutputs off
StateSaveName "xout"
TimeSaveName "tout"
OutputSaveName "outputdat"
SignalLoggingName "sigsOut"
OutputOption "RefineOutputTimes"
OutputTimes "t"
ReturnWorkspaceOutputsName "out"
Refine "1"
}
Simulink.OptimizationCC {
$ObjectID 4
Version "1.6.0"
Array {
Type "Cell"
Dimension 4
Cell "ZeroExternalMemoryAtStartup"
Cell "ZeroInternalMemoryAtStartup"
Cell "NoFixptDivByZeroProtection"
Cell "OptimizeModelRefInitCode"
PropName "DisabledProps"
}
BlockReduction on
BooleanDataType off
ConditionallyExecuteInputs on
InlineParams off
UseIntDivNetSlope off
InlineInvariantSignals on
OptimizeBlockIOStorage on
BufferReuse on
EnhancedBackFolding off
StrengthReduction off
EnforceIntegerDowncast on
ExpressionFolding on
BooleansAsBitfields off
EnableMemcpy on
MemcpyThreshold 64
PassReuseOutputArgsAs "Structure reference"
ExpressionDepthLimit 2147483647
FoldNonRolledExpr on
LocalBlockOutputs on
RollThreshold 5
SystemCodeInlineAuto off
StateBitsets off
DataBitsets off
UseTempVars off
ZeroExternalMemoryAtStartup on
ZeroInternalMemoryAtStartup on
InitFltsAndDblsToZero on
NoFixptDivByZeroProtection off
EfficientFloat2IntCast off
EfficientMapNaN2IntZero on
OptimizeModelRefInitCode off
LifeSpan "inf"
BufferReusableBoundary on
SimCompilerOptimization "Off"
AccelVerboseBuild off
}
Simulink.DebuggingCC {
$ObjectID 5
Version "1.6.0"
RTPrefix "error"
ConsistencyChecking "none"
ArrayBoundsChecking "none"
SignalInfNanChecking "none"
SignalRangeChecking "none"
ReadBeforeWriteMsg "UseLocalSettings"
WriteAfterWriteMsg "UseLocalSettings"
WriteAfterReadMsg "UseLocalSettings"
AlgebraicLoopMsg "warning"
ArtificialAlgebraicLoopMsg "warning"
SaveWithDisabledLinksMsg "warning"
SaveWithParameterizedLinksMsg "none"
CheckSSInitialOutputMsg on
UnderspecifiedInitializationDetection "Classic"
MergeDetectMultiDrivingBlocksExec "none"
CheckExecutionContextPreStartOutputMsg off
CheckExecutionContextRuntimeOutputMsg off
SignalResolutionControl "TryResolveAllWithWarning"
BlockPriorityViolationMsg "warning"
MinStepSizeMsg "warning"
TimeAdjustmentMsg "none"
MaxConsecutiveZCsMsg "error"
SolverPrmCheckMsg "none"
InheritedTsInSrcMsg "none"
DiscreteInheritContinuousMsg "warning"
MultiTaskDSMMsg "warning"
MultiTaskCondExecSysMsg "none"
MultiTaskRateTransMsg "error"
SingleTaskRateTransMsg "none"
TasksWithSamePriorityMsg "warning"
SigSpecEnsureSampleTimeMsg "warning"
CheckMatrixSingularityMsg "none"
IntegerOverflowMsg "warning"
Int32ToFloatConvMsg "warning"
ParameterDowncastMsg "error"
ParameterOverflowMsg "error"
ParameterUnderflowMsg "none"
ParameterPrecisionLossMsg "warning"
ParameterTunabilityLossMsg "warning"
FixptConstUnderflowMsg "none"
FixptConstOverflowMsg "none"
FixptConstPrecisionLossMsg "none"
UnderSpecifiedDataTypeMsg "none"
UnnecessaryDatatypeConvMsg "none"
VectorMatrixConversionMsg "none"
InvalidFcnCallConnMsg "error"
FcnCallInpInsideContextMsg "Use local settings"
SignalLabelMismatchMsg "none"
UnconnectedInputMsg "warning"
UnconnectedOutputMsg "warning"
UnconnectedLineMsg "warning"
SFcnCompatibilityMsg "none"
UniqueDataStoreMsg "none"
BusObjectLabelMismatch "warning"
RootOutportRequireBusObject "warning"
AssertControl "UseLocalSettings"
EnableOverflowDetection off
ModelReferenceIOMsg "none"
ModelReferenceVersionMismatchMessage "none"
ModelReferenceIOMismatchMessage "none"
ModelReferenceCSMismatchMessage "none"
UnknownTsInhSupMsg "warning"
ModelReferenceDataLoggingMessage "warning"
ModelReferenceSymbolNameMessage "warning"
ModelReferenceExtraNoncontSigs "error"
StateNameClashWarn "warning"
SimStateInterfaceChecksumMismatchMsg "warning"
StrictBusMsg "Warning"
LoggingUnavailableSignals "error"
BlockIODiagnostic "none"
}
Simulink.HardwareCC {
$ObjectID 6
Version "1.6.0"
ProdBitPerChar 8
ProdBitPerShort 16
ProdBitPerInt 32
ProdBitPerLong 32
ProdIntDivRoundTo "Undefined"
ProdEndianess "Unspecified"
ProdWordSize 32
ProdShiftRightIntArith on
ProdHWDeviceType "32-bit Generic"
TargetBitPerChar 8
TargetBitPerShort 16
TargetBitPerInt 32
TargetBitPerLong 32
TargetShiftRightIntArith on
TargetIntDivRoundTo "Undefined"
TargetEndianess "Unspecified"
TargetWordSize 32
TargetTypeEmulationWarnSuppressLevel 0
TargetPreprocMaxBitsSint 32
TargetPreprocMaxBitsUint 32
TargetHWDeviceType "Specified"
TargetUnknown on
ProdEqTarget on
}
Simulink.ModelReferenceCC {
$ObjectID 7
Version "1.6.0"
UpdateModelReferenceTargets "IfOutOfDateOrStructuralChange"
CheckModelReferenceTargetMessage "error"
ModelReferenceNumInstancesAllowed "Multi"
ModelReferencePassRootInputsByReference on
ModelReferenceMinAlgLoopOccurrences off
}
Simulink.SFSimCC {
$ObjectID 8
Version "1.6.0"
SFSimEnableDebug on
SFSimOverflowDetection on
SFSimEcho on
SimBlas on
SimCtrlC on
SimExtrinsic on
SimIntegrity on
SimUseLocalCustomCode off
SimBuildMode "sf_incremental_build"
}
Simulink.RTWCC {
$BackupClass "Simulink.RTWCC"
$ObjectID 9
Version "1.6.0"
Array {
Type "Cell"
Dimension 1
Cell "IncludeHyperlinkInReport"
PropName "DisabledProps"
}
SystemTargetFile "grt.tlc"
GenCodeOnly off
MakeCommand "make_rtw"
GenerateMakefile on
TemplateMakefile "grt_default_tmf"
Description "Generic Real-Time Target"
GenerateReport off
SaveLog off
RTWVerbose on
RetainRTWFile off
ProfileTLC off
TLCDebug off
TLCCoverage off
TLCAssert off
ProcessScriptMode "Default"
ConfigurationMode "Optimized"
ConfigAtBuild off
RTWUseLocalCustomCode off
RTWUseSimCustomCode off
IncludeHyperlinkInReport off
LaunchReport off
TargetLang "C"
IncludeBusHierarchyInRTWFileBlockHierarchyMap off
IncludeERTFirstTime on
GenerateTraceInfo off
GenerateTraceReport off
GenerateTraceReportSl off
GenerateTraceReportSf off
GenerateTraceReportEml off
GenerateCodeInfo off
RTWCompilerOptimization "Off"
CheckMdlBeforeBuild "Off"
Array {
Type "Handle"
Dimension 2
Simulink.CodeAppCC {
$ObjectID 10
Version "1.6.0"
Array {
Type "Cell"
Dimension 9
Cell "IgnoreCustomStorageClasses"
Cell "InsertBlockDesc"
Cell "SFDataObjDesc"
Cell "SimulinkDataObjDesc"
Cell "DefineNamingRule"
Cell "SignalNamingRule"
Cell "ParamNamingRule"
Cell "InlinedPrmAccess"
Cell "CustomSymbolStr"
PropName "DisabledProps"
}
ForceParamTrailComments off
GenerateComments on
IgnoreCustomStorageClasses on
IgnoreTestpoints off
IncHierarchyInIds off
MaxIdLength 31
PreserveName off
PreserveNameWithParent off
ShowEliminatedStatement off
IncAutoGenComments off
SimulinkDataObjDesc off
SFDataObjDesc off
IncDataTypeInIds off
MangleLength 1
CustomSymbolStrGlobalVar "$R$N$M"
CustomSymbolStrType "$N$R$M"
CustomSymbolStrField "$N$M"
CustomSymbolStrFcn "$R$N$M$F"
CustomSymbolStrFcnArg "rt$I$N$M"
CustomSymbolStrBlkIO "rtb_$N$M"
CustomSymbolStrTmpVar "$N$M"
CustomSymbolStrMacro "$R$N$M"
DefineNamingRule "None"
ParamNamingRule "None"
SignalNamingRule "None"
InsertBlockDesc off
SimulinkBlockComments on
EnableCustomComments off
InlinedPrmAccess "Literals"
ReqsInCode off
UseSimReservedNames off
}
Simulink.GRTTargetCC {
$BackupClass "Simulink.TargetCC"
$ObjectID 11
Version "1.6.0"
Array {
Type "Cell"
Dimension 12
Cell "IncludeMdlTerminateFcn"
Cell "CombineOutputUpdateFcns"
Cell "SuppressErrorStatus"
Cell "ERTCustomFileBanners"
Cell "GenerateSampleERTMain"
Cell "MultiInstanceERTCode"
Cell "PurelyIntegerCode"
Cell "SupportNonFinite"
Cell "SupportComplex"
Cell "SupportAbsoluteTime"
Cell "SupportContinuousTime"
Cell "SupportNonInlinedSFcns"
PropName "DisabledProps"
}
TargetFcnLib "ansi_tfl_tmw.mat"
TargetLibSuffix ""
TargetPreCompLibLocation ""
TargetFunctionLibrary "ANSI_C"
UtilityFuncGeneration "Auto"
ERTMultiwordTypeDef "System defined"
ERTMultiwordLength 256
MultiwordLength 2048
GenerateFullHeader on
GenerateSampleERTMain off
GenerateTestInterfaces off
IsPILTarget off
ModelReferenceCompliant on
ParMdlRefBuildCompliant on
CompOptLevelCompliant on
IncludeMdlTerminateFcn on
GeneratePreprocessorConditionals "Disable all"
CombineOutputUpdateFcns off
SuppressErrorStatus off
ERTFirstTimeCompliant off
IncludeFileDelimiter "Auto"
ERTCustomFileBanners off
SupportAbsoluteTime on
LogVarNameModifier "rt_"
MatFileLogging on
MultiInstanceERTCode off
SupportNonFinite on