Identification

85
1 Dynamic and Time Series Modeling for Process Control Sachin C. Patwardhan Dept. of Chemical Engineering IIT Bombay 1/9/2007 System Identification 2 Automation Lab IIT Bombay Why Mathematical Modeling? Process Synthesis and Design (offline) Operation scheduling and planning Process Control - Soft sensing / Inferential measurement - Optimal control (batch operation) - On-line optimization (continuous operation) - On-line control (Single loop / multivariable) Online performance monitoring Fault diagnosis / fault prognosis Key Component of All Advanced Monitoring, Control and Optimization Schemes

description

h

Transcript of Identification

1Dynamic and Time Series Modeling for Process ControlSachin C. PatwardhanDept. of Chemical EngineeringIIT Bombay 1/9/2007 System Identification 2Automation LabIIT BombayWhy Mathematical Modeling? Process Synthesis and Design (offline) Operation scheduling and planning Process Control - Soft sensing / Inferential measurement - Optimal control (batch operation)- On-line optimization (continuous operation)- On-line control (Single loop / multivariable) Online performance monitoring Fault diagnosis / fault prognosisKey Component of All Advanced Monitoring,Control and Optimization Schemes21/9/2007 System Identification 3Automation LabIIT BombayLong Term Scheduling and Planning On-line Optimizing ControlModel Predictive ControlPID & Operating constraint ControlPlantPlant-ModelMismatchMarketDemands /Raw materialavailabilitySetpointsSetpointsMVLoad DisturbancesPVPVPVPlant Wide Control FrameworkLayer 4Layer 3Layer 2Layer 11/9/2007 System Identification 4Automation LabIIT BombayModels for Plant-wide ControlAggregate Production Rate ModelsSteady State / Dynamic First Principles ModelsDynamic Multivariable Time Series ModelsSISO Time Series Models, ANN/PLS/Kalman Filters (Soft Sensing) Layer 4Layer 3Layer 2Layer 131/9/2007 System Identification 5Automation LabIIT BombayMathematical ModelsQualitativeQualitative Differential Equation Qualitative signed and directed graphs Expert Systems QuantitativeDifferential Algebraic systems Mixed Logical and Dynamical Systems Linear and Nonlinear time series modelsStatistical correlation based (PCA/PLS) MixedFuzzy Logic based models1/9/2007 System Identification 6Automation LabIIT BombayWhite Box Models First Principles / Phenomenological/ Mechanistic Based on energy and material balances physical laws, constitutive relationships Kinetic and thermodynamic models heat and mass transfermodels Valid over wide operating range Provide insight in the internal working of systems Development and validation process: difficult and time consuming 41/9/2007 System Identification 7Automation LabIIT BombayExample: Quadruple Tank System2 12 1242 2444 4131 1333 3222 2424222 2111 1313111 1h and h : Outputs Measuredv and v : Inputs d Manipulate) 1 (2) 1 (22 22 2vAkghAadtdhvAkghAadtdhvAkghAaghAadtdhvAkghAaghAadtdh+ =+ =+ + =+ + =Pump 2V2Pump1V1Tank3Tank 2Tank 1Tank 41/9/2007 System Identification 8Automation LabIIT BombayExample: Non-isothermal CSTR ) () / (Jacket Cooling to Tranfer Heat) / exp( ) () (Balance Enery) / exp( ) (Balance Material: Reactioncinpc cbcbcA rxnp pA A AAT TC aF FaFQC RT E Vk HQ T T F CdtdTc VC RT E Vk C C FdtdCVB A+= + = = + 21000 051/9/2007 System Identification 9Automation LabIIT BombayExample: Fed-Batch Fermenter) , ( 7 . 117 ) , ( ; 05 . 1 / ) , ( ) , (0303 . 0 0 . 2086 . 0) , (Volume) Reactor : (Conc.) Product : ( ) , () (Conc.) 2 - Substrate : ( ) , () (Conc.) Biomass : ( ) , () (2 1311 . 02 1 2 1 2 1 221 12 12 122 12 2 1 2 2 222 12S S e S S S S S SS SS SS SV FdtdVP kPV XV S SdtPV dS XV S S S FdtV S dX XV S SdtXV dSF = =+ +== = ==1/9/2007 System Identification 10Automation LabIIT Bombay Material Balances (Distributed Parameter System) Energy Balances1 rE /RT A Al 10 AC Cv k e Ct z = 1 r 2 rE /RT E /RT B Bl 10 A 20 BC Cv k e C k e Ct z = + ( )( )( )1 r2 rr1 E /RT r rl 10 Am pmr2 E /RT w20 B j rm pm m pm rH T Tv k e Ct z CH U k e C T TC C V = + + + ( )j j wjr jmj pmj jT T Uu T Tt z C V = + ..Reactant A..Product B..Reactor Temp...Jacket Temp.Fixed Bed Reactor 61/9/2007 System Identification 11Automation LabIIT BombayGrey Box ModelsSemi-PhenomenologicalPart of model developed from the first principles and part developed from data Example: dynamic model for reactor model using energy and material balance and Reaction kinetics modeled using neural network Better choice than complete black box models1/9/2007 System Identification 12Automation LabIIT BombayHeater CoilLTTT-1Cold Water FlowCold Water FlowCV-2ThyristerControl UnitTT-3CV-14-20 mAInput Signal4-20 mAInputExperimental Setup: Schematic DiagramTT-2Example: Stirred Tank Heater-Mixer71/9/2007 System Identification 13Automation LabIIT BombayExample: Stirred Tank Heater-Mixer[ ]) ( ; / 5 . 1390093 . 0 71 . 0 27 9 . 3 ) (0073 . 0 989 . 0 979 . 7 ) () () ( ) (1) (1) () (2023222 2 2 23121 1 122 2 2 2 1 12 222 2 122111 111 1h h k h F Ks m J UI I I I FI I I I QCT T UAT T F T T FA h dtdTF I F FA dtdhC VI QT TVFdtdTpatmipi = =+ + = + = + = + =+ =valve control to input current % : Icontroller power thyrister to input current % :21I1/9/2007 System Identification 14Automation LabIIT Bombay0 10 20 30 40 500500100015002000250030003500400045005000Heat Input to Tank 1% Current input to the power moduleHeat supplied to water in tank oneprocesspredictedExample: Stirred Tank Heater-Mixer0 20 40 60 80 1000500100015002000250030003500400045005000% valve openingflow rate in ml/minCharecteraisation of Control Valve CV-2data 1 cubicControl Valve CharacterizationThyrister Power ControllerCharacterization81/9/2007 System Identification 15Automation LabIIT BombayModel Validation: Input Excitations 0 200 400 600 800 10001012141618Sampling instantHeater input(mA)Input Perturbations0 200 400 600 800 100012141618Sampling instantValve two input(mA)1/9/2007 System Identification 16Automation LabIIT BombayModel Validation: Level Variations0 200 400 600 800 100020253035404550556065Sampling instantHeight(cm)Simulation Validation dataModel PredictionsMeasured Output91/9/2007 System Identification 17Automation LabIIT Bombay Model Validation: Temperature Profiles 0 2 0 0 4 0 0 6 0 0 8 0 0 1 0 0 03 1 53 2 03 2 53 3 03 3 53 4 03 4 5S a m p l i n g I n s t a n tTank 1 Temp(K)S i m u l a t i o nV a l i d a t i o n d a t aM o d e l P r e d i c t i o n sM e a s u r e d O u t p u t0 2 0 0 4 0 0 6 0 0 8 0 0 1 0 0 03 0 83 1 03 1 23 1 43 1 63 1 8S a m p l i n g i n s t a tTank 2 temp(K)M o d e l P r e d i c t i o n sM e a s u r e d O u t p u t1/9/2007 System Identification 18Automation LabIIT BombayDynamic Models for Control Linear perturbation models: Regulatory operation around fixed operating point of mildly nonlinear processes operated continuously. Developed using Local linearization of white/gray box models Identification from input output data Why use approximate Linear Models? Linear control theory for controller synthesis and closed loop analysis is very well Developed For small perturbations near operating point, processes exhibit linear dynamics Nonlinear dynamic models: strongly nonlinear systems, operation over wide operating range, batch / semi-batch processes101/9/2007 System Identification 19Automation LabIIT BombayLocal Linearization ; D - D(t) d(t) ; U - U(t) u(t); Y - Y(t) y(t) ; X - X(t) x(t)variables on Perturbatixmodel on perturbati linear develop to) , , ( around expansion series Taylor apply we), , , ( point operating state steady and) ( ; ) , , ( dX/dtmodel parameter lumped a Given= == == + + == =C y ; Hd Bu Ax dx/dtD U XD U XX G Y D U X F1/9/2007 System Identification 20Automation LabIIT BombayLocal Linearization[ ] [ ][ ] [ ]) , , ( at computed/ ; /; / ; /whereD U XX G C D F HU F B X F A = = = =Transfer Function Matrix:Can be obtained by taking Laplace transform together with assumption (i.e. initial state of the process corresponds to operating steady state)[ ] [ ] H A sI C s G B A sI C s Gs d s G s u s G s yd ud p1 1) ( ; ) () ( ) ( ) ( ) ( ) ( = =+ =0 0 = ) ( x111/9/2007 System Identification 21Automation LabIIT Bombay) , , , , , () , , , , , (0 20 1cin A c Acin A c AAT C F F T C fdtdTT C F F T C fdtdC==[ ] [ ][ ][ ]cin mATcTAT DCF F UT Y T C X ) ( es Disturbanc Measured) (D es Disturbanc Unmeasured] [ ) ( Inputs d Manipulate) ( Output Measured ) ( Statesu 0Consider non-isothermal CSTR dynamicsfeed flow ratecoolant flow rateFeed conc.Cooling waterTemp.Perturbation Model for CSTR1/9/2007 System Identification 22Automation LabIIT BombayCSTR: Model Parameters and Steady state Operating PointK8330.1 = R E/ ; . ; min / 10 x 1.678 = a ;cal/kmol 10 x 130 = reaction) of (Heat H -; g/m 10 = ) density Coolent ( ; g/m 10 = density) liquid (Reacting; K) /(g cal 1 = ) coolent of heat (spacific C; 92 = ) e Temperatur Inlet (Coolent Tcin; K) cal/(g 1 = mixture) reacting of heat Specific ( C; /min m 15 = flow) (Coolant F ; C 50 = e) temperatur (Inlet T; kmol/m 2.0 = A) of ion concentrat Inlet ( C; /min m 1 = flow) (Inlet F; m 1 = ) volume Reactor ( V 66rnx3 6c3 6pc0p3 003A03 35 0 =b calC C T0121 = e) Temperatur Reactor (kmol/m 0.265 = A) of tion (Concentra C3AOperating SteadyState121/9/2007 System Identification 23Automation LabIIT BombayDiscrete Dynamic Models Computer control relevant discrete models........! 2) exp(Definition) exp( ; ) exp() ( ) () ( ) ( ) 1 (220+ + + = = = = = + = +TT I ATd B A ATk Cx k yk u k x k xT Note: Assumption of piece-wise constant inputs holds only for manipulated inputs and NOTfor the disturbances or any other input 1/9/2007 System Identification 24Automation LabIIT BombayTransfer Function Matrix [ ][ ][ ] Function Transfer Pulse : ) () ( - zI ) ( ) () ( - zI x(z)0 x(0) When) ( ) ( ) 0 ( ) (equation difference of sides bothe on transform - z taking ely, Alternativ111 = = = == + = zI C z Gz u z Cx z yz uz u z x x z zxp[ ]1) - f(k {f(k)} q ; 1) f(k q{f(k)}Operator Shift :) () ( ) ( ) (1 -1= + = ==qqI C q Gk u q G k yppq-Transfer Function Matrix: Can be obtained by taking q-transform together with assumption0 0 = ) ( x131/9/2007 System Identification 25Automation LabIIT BombayComputation of System MatricesB1 -T01 -1 -)d exp(T) exp(columns as A of rs eigenvecto with matrix :diagonal maion on appearing s eigenvalue withmatrix diagonal is where A Let: 1 Method n Compouatio = = = [ ] ( ) [ ][ ] [ ] B A I B A I ATB AsI L T sII t AdtdAt tT t1 1T01 1 1) exp( matrix invertible is When)d exp() ( (s) (s) A (0) - (s) sTransform Laplace Taking) 0 ( ; ) (IVP - ODE of solution is ) exp( ) (: 2 Method n Compouatio = = = = = = = = == 1/9/2007 System Identification 26Automation LabIIT BombayCSTR: Continuous Perturbation Model[ ] ) ( ) () (70.95 - 6.07 -1.735) (5.77 852.720.09 - 7.56 -/;) () () ( ;) () () (t x t yt u t x dt dxF t FF t Ft uT t TC t Ct xc cA A1 00=+===Continuous linear state space modelLaplace Transfer Function 35.83 + s 1.79 + s943.5 + s 70.95 -35.8 + s 1.79 + s45.9 - s 6.07-) (2 2= s Gp141/9/2007 System Identification 27Automation LabIIT BombayModels for Computer Control ProcessAnalog To Digital ConverterDigital To Analog ConverterManipulated Inputs From Control ComputerMeasuredOutputs ToControl ComputerControl Computer /DCSComputer controlled system / Distributed Digital Control system 1/9/2007 System Identification 28Automation LabIIT BombayDigital Control: Measured Outputs 0 5 10 15 201.822.22.42.62.833.2Sampling InstantMeasured Output0 5 10 15 201.822.22.42.62.833.2Sampling InstantMeasured OutputADCContinuous Measurement from processSampled measurement sequence to computerOutput measurements are available onlyat discrete sampling instant Where T represents sampling interval { } ,.... , , : 2 1 0 = = k kT tk151/9/2007 System Identification 29Automation LabIIT BombayDigital Control: Manipulated Inputs In computer controlled (digital) systems Manipulated inputs implemented through DACare piecewise constant 0 2 4 6 8 10 12 14 16 18 2022.12.22.32.42.52.62.72.82.9Sampling Instant Manipulated Input0 2 4 6 8 10 12 14 16 18 2022.12.22.32.42.52.62.72.82.9Sampling InstantManipulated Input SequenceDACInput Sequence Generated by computerContinuous input profile generated by DAC1 + =k k kt t t for k u t u t u ) ( ) ( ) (1/9/2007 System Identification 30Automation LabIIT BombayCSTR: Discrete Perturbation Model[ ] ) ( ) () (1.797 - 0.7335 -0.134 0.0026) (1.333 73.4920.008 - 0.185) (k x k yk u k x k x1 01=+= +Discrete linear state space modelSampling Time (T) = 0.1 min Discrete q-transfer function model==2 - 1 -2 - 1 -2 - 1 -2 - 1 -2 235.83q + q 1.79 + 1943.5q + q 70.95 -35.83q + q 1.79 + 145.9q - q 6.07-) (35.83 + q 1.79 + q943.5 + q 70.95 -35.83 + q 1.79 + q45.9 - q 6.07-) (1q Gq Gpp161/9/2007 System Identification 31Automation LabIIT BombayBlack Box ModelsData Driven / Black Box ModelsStatic maps (correlations)/ dynamic models (difference equations) developed directly fromhistorical input-output dataValid over limited operating range Provide no insight into internal working of systems Development process: much less time consuming and comparatively easy 1/9/2007 System Identification 32Automation LabIIT BombayBlack Box Models Dynamic Models: Given observed data[ ][ ] ) ( ... ) ( ) ( : Outputs Measured) ( ... ) ( ) ( : Inputs past of Set) () (k y y y Yk u u u Ukk2 12 1==we are looking for relationship( ) ) ( , , ) () 1 ( ) 1 (k e Y U kk k+ = ysuch that noise (residuals) e(k) are as small as possiblevector parameter representsdR 171/9/2007 System Identification 33Automation LabIIT BombayTools for Black Box ModelingLinear Difference equation (time series) models Principle component analysis (PCA) / Projection Of latent structures (PLS) /Statistical models based on linear correlation analysis of historical dataArtificial Neural Networks/Wavelet NetworksExcellent for capturing arbitrary nonlinear mapsFuzzy Rule Based Models Quantification of qualitative process knowledge 1/9/2007 System Identification 34Automation LabIIT BombaySteps in Model Development Selection of model structure Planning of experiments for estimation of unknown model parameters Design of input perturbation sequences Open loop / closed loop experimentation Estimation of model parameters from experimental data using optimization techniques Model validation Prediction capabilities Steady state behavior 181/9/2007 System Identification 35Automation LabIIT BombayModel Structure Selection Issues in Model Selection Process application (batch / continuous) Time scale of operation Type of application (scheduling/optimization/MPC/Fault Diagnosis) Availability of physical knowledge /historical data Development time and efforts Model granularity decides how well we can make control / planning moves or diagnose / analyze process behavior 1/9/2007 System Identification 36Automation LabIIT BombayData Driven ModelsDevelopment of linear state space/transfermodels starting from first principles/gray box models is impractical proposition.Practical Approach Conduct experiments by perturbing process around operating point Collect input-output data Fit a differential equation or difference equation modelDifficulties Measurements are inaccurate Process is influenced by unknown disturbances Models are approximate 191/9/2007 System Identification 37Automation LabIIT BombayDiscrete Model Development0 2 4 6 8 10 12 14 16 18 2022.12.22.32.42.52.62.72.82.9Sampling Instant Manipulated InputExcite plant around the desired operating point by injecting input perturbations Process0 5 10 15 201.822.22.42.62.833.2Sampling InstantMeasured OutputInput excitation for model identification Unmeasured Disturbances Measured output responseMeasurement Noise1/9/2007 System Identification 38Automation LabIIT BombayCSTR: Input Excitation 0 5 10 15 201314151617Sampling InstantCoolentFlowManipulated Input Excitation0 5 10 15 200.850.90.9511.051.1Sampling InstantReactant InflowPRBS: Pseudo Random Binary Signal 201/9/2007 System Identification 39Automation LabIIT BombayCSTR: Identification Experiments Dotted Line: Data without noise Continuous Line: Data with noise0 5 10 15 200.81Sampling InstantInlet Conc.(mod/m3)Effect of Inlet Concentration Fluctuations On Reactor Temperature0 5 10 15 20390400Sampling InstantMeasured Temperature (K)1/9/2007 System Identification 40Automation LabIIT BombayCSTR: Noise Component0 50 100 150 200-4-3-2-10123Unmeasured Disturbance Component in Measured OutputsSampling Instant v(k)= y(k) -G(q) u(k), (Deg K)211/9/2007 System Identification 41Automation LabIIT BombayTwo Non-Interacting Tanks SetupTank2Tank1Non Interacting Tank Level Control setupSumpPump1Pump2CV1 CV2LTSISO System Output: Level in tank 2Manipulated Input : Valve Position CV-2Disturbance: Valve Position CV-1 1/9/2007 System Identification 42Automation LabIIT BombayInput Output Data 0 50 100 150 200 2504.555.566.5 Output (mA)Raw Input and output signals0 50 100 150 200 250101214TimeInput (mA)221/9/2007 System Identification 43Automation LabIIT BombayPerturbation Data for Identification0 50 100 150 200 250-101 OutputInput and output signals0 50 100 150 200 250-202TimeInputMean values removed from Input and Output data 1/9/2007 System Identification 44Automation LabIIT BombayImpulse Response Model [ ] [ ]= = =+ + = ==jTT jjjTjTTTTd g gj k u j g j k u d g k yT k u d g T k u d g kT y) 1 (1 1020) ( : ts Coefficien Response Impulse) ( ) ( ) ( ) ( ) (... ) 2 ( ) ( ) 1 ( ) ( ) (inputs constant wise - piece For [ ] == ==01 -impulse) ( ) ( ) ( : Integral n Convolutio) ( L g(t) (t) yinput impulse with ) () () (T.F. Consider d t u g t ys gs gs us y231/9/2007 System Identification 45Automation LabIIT BombayImpulse Response Model ) ( ) ( ) (operator transfer Defining) ( ) ( ) (Model Response Impulse11 1k u q G k yq g G(q)k u q g j k u g k yjjjjjjjj=== = ===Current output y(k) is viewed as weighted sum of all past inputs moves. Impulse response coefficients determine weighting of each past move G(q) is open loop BIBO stable if