0005 1098/87 $300+000 Pergamon Journals Ltd © 1987 International Federation of Automatic Control
Autoraatwa Vol 23 No 4 pp 491 496 1987 Printed in Great Britain
A Prediction-error-method for Recursive Identification of Nonlinear Systems* W JAKOBY'~ and M PANDIT:~
A new algorithm for ~dent~ficat~on of nonhnear systems performs parallel est~matton of parameters and state using a predwtton error gradwnt and shows good convergence properttes Key Words--Bins reduction, ~dent~ficatmn, nonhnear systems, nonhnear filtering, parameter estimation, state estimation
(wtth unknown, nonmeasurable states or unknown characteristics of the norse) but on the other hand can be implemented with moderate effort A compartson shows that linear systems are tdenttfied m a simple way by the combmatlon of parameter estimation and state esttmatlon Thts tdea of separately estlmatmg parameters and states and mutually exchanging the estimates after each recurs~on can also be apphed to nonhnear systems, with certam addmonal considerations After a short description of the extended Kalman filter (EKF) for combmed parameter and state estlmatton, which is taken as a reference for judging the quahty of the estimates and the computation time, a new algorithm is presented for identifying t~me-varymg nonhnear systems This ~s a combination ofa parameter-EKF and a state-EKF and uses an improved gradient calculation for achlevmg sattsfactory results It is shown that th~s ~mprovement ~s effected by taking the total derivative of the prediction error The superior characteristics of the estimator m comparison to the EKF, le the reduced computation time and the improved quality of the estimates, are demonstrated finally by applymg it to an automatic fillmg system
Ahstraet--Nonhnear systems can be identified w~th nonhnear filters by combmed estimation of parameters and state Often these methods are very complex or have convergence problems, as for example the Extended Kalman Fdter In this paper a new algorithm for recurslve nonhnear system identification ~s presented Convergence problems are ehmmated by an ~mproved calculation of the gra&ent as the total derivative of the pre&ct~on error By separately estimating parameters and states, computatmn t~me ~s reduced The efficacy of the new ~dent~ficat~on algorithm ~s tllustrated by studying ~ts performance m a grawmetric fiihng system I INTRODUCTION NONLINEAR TIME-VARYING SYSTEMS c a n
be ~dent~fied by parameter and state esttmatlon using measured inputs and outputs ff the structure of the model is known The problem of recurstve nonhnear parameter estlmaUon is seldom attacked in the hterature Two classes of methods are known One of them consists of gra&ent methods m the wide sense (Bard, 1970) These methods can be apphed for systems where the states and the noise character~sttcs are known parameters ff a forgetting factor is used The second class of methods consists of nonhnear filters (Semfeld, 1970) which are sutted for system ~dentlficatton ff parameters and states are s~multaneously estimated In pnnc~ple any nonhnear system w~th constant or t~me-vanable parameters can be identified by nonhnear filters However, the computational effort of implementing the filters strongly restricts thetr apphcabdtty Especmlly m on-hne schemes e g in adaptwe systems, one needs recurswe algorithms which on the one hand are apphcable m many practical sltuat~ons
2 COMBINED ESTIMATION OF PARAMETERS AND STATES
If the parameters and states of a system are unknown, they can be combined to form a vector of unknown variables and esttmated by a nonhnear filter, as is done for hnear systems m Ljung (1979), Bonse (1981) and Yoshlmura et al (1981) The possibility of also doing this for nonhnear systems was mentioned several years ago (Cox, 1964), but apphcattons are rare (Krebs, 1976) Because of tts slmphclty--the nonhnear system is hneanzed and the Kalman Filter is apphed to the hneanzed system--and the relatively small effort necessary for implementation, the extended Kalman Filter (EKF) is the nonhnear filter usually employed
*Recewed 18 April 1986, rewsed 27 January 1987 The ongmal versmn of this paper was not presented at any IFAC meeting This paper was recommended for pubhcatmn m revised form by Assooate Editor P J Gawthrop under the &rectlon of EdRor P C Parks 1"Autromc GmbH, Barbarastr 12, 6605 Fnednehsthal, F R G ~/Umversltat Kalserslautern, Postfach 3049, 6750 Kmserslautern, F R G Author to whom all correspondence should be addressed 491
492
~Pmeterm~ oo r
W JAKOBY and M PANDIT
Therefore it is taken here as a reference for judging the performance of the new estimators The authors set out from a nonhnear system with a single input u k and a single output Yk and variable parameters O described by
estl
Uk Yk
eshmmtoI r
(1)
Yk = h(Ok, X~, Uk) + nk
FIG 1 Parallel est~matmn of parameters and state xk + ~ = f(0~, x~, u~) + w~
(2)
Ok + 1 = g(0k, Xk, Uk) + Vk,
(3)
whereby Xk iS the state and nk, Wk and Vk represent zero-mean whzte noise processes w~th covanances
Gok =
,I}
ek = Yk -- J)k h(Ok/k- 1, f~k/k- 1, Uk)
and the ..... denoting estimated values, the E K F for combined estimation of parameters and states has the form
+
Qk+
RkJ
i
Qkr
o.lr,..1
LH~kJ trek2
Rk
LQ *T
R*+,J
kG~k
ek
(4)
R*J
[I-10 ] + LHxkJ
Q.+r
a-~2
[H°\H'~k]
(5)
Fxk
[;,: Qk,,It o., LG.k
+ [WVkk]
(6)
Fxkd
',+i,,] [-g(a,,,,
1
~k/1/k-~ = Lf(/Ik/k, ~k/~,uk)l
(7)
where
H0k = d~k
Ok = Ok/k -1 Xk ~ ~ktk - 1
and
Ok = Ok/k Xk m Zk/k
0k=Ok/~
Gxk = ~
0k=0k~k Xk ~ ~k~k
The E K F ~s a first order local approximation and therefore the most simple nonlinear filter In spite of this, a large number of computations have to be done to solve (4)-(9) dunng each samphng interval
W~th the prediction error
" i~k/k -
~X k
Xk I ~k/k
w, = e{.,
:~k/kJ
Fxk = t~fT
Xk I ~k/k
t3g T
v, = E(,,
-
Ok= bkjk
(9)
0"nk
= Yk
t~fr F ok = -~k
--l'l"~k =
Oh ~
O/t = Ok/k -1 Xk ~ Ikfk - l
(8)
3 SEPARATE ESTIMATION OF PARAMETERS AND STATES Because of the high requirements m computation capacity and computation rime, combined estimation of parameters and states in nonlinear filters are unstated for practical cases For hnear system ldentificatmn, simpler estimators which assume constant or slow varying parameters have found widespread apphcatlon There Is a large number of estimators which are stated for different linear model structures and which have been derived setting out from a variety of prmczples All these methods have the common feature that during one samphng interval, parameters and states are separately estimated and then the estimates are mutually exchanged between the estimators (Fig 1) In contrast to the combined estimation, computatmns are simplified because of the smaller size of the matrices involved in the estimators Often the states are estimated by a Kalman Fdter (KF) whde the parameters are estimated by stochastic approxlmatmns (Ljung, 1978. El-Fattah, 1983), pseudohnear regressions (Ljung, 1978, Graupe, 1976, p 228, Andersen and Moore, 1979,p 279), predlctmn error methods (Goodwin and Stun, 1984, p 366), correlation methods (Mehra, 1971) or. m case of variable parameters, by a Kalman Filter (Nelson and Stear, 1976) Such combinations are often referred to as adaptwe estimatmn, filtering or observatmn of states The idea of separate estimation and mutual exchange of the estimates can also be apphed to nonhnear systems to reduce computatmn reqmrements In the nonhnear system (1)-(3), a nonlinear filter is needed for the estimation of the parameters
PE-method for nonlinear systems as for the states The E K F can be used for both One has a state-EKF
~k/k = ~k/k-1 + RkHxkO'~28k
(10)
T -k2 R [ 1 = R * - x + HxkHxkOn
(11)
493
point defined by the set of parameter estimates at the previous samphng Instant In the case of constant parameters, the total d~fferentmtlon is performed without any problems
Hok = dPk/k-do 1 o=~h -- dh(O,dotklk_ 1) o=~k-, R~'+ 1 = FxkRkFxk T + Wk
(12)
tk + Ilk = f(lIk/k, tk/k, Uk)
(13)
Oh dh d~k/k- 10=~k-, - dO + d~k/k-~ dO
(19)
and a parameter-EKF Ok/k = ~k/k-1 + PkHoktr~28k
(14)
p [ 1 = p , - 1 + HokHTko~2
(15)
Pk+l = Go~kPkGok+ Vk
(16)
dk+ 1/k = g(#k/k, ~k/k, Uk),
(17)
In the case of t~me-varylng parameters one can formally write
Hok
whereby the derivatives are still computed by (8) and (9) For the purpose of ~dentlfiCatlon, one is not always interested m the state estimates directly, these are however needed as auxiliary vanables for parameter estimation If the estimation error of the states does not radically influence the parameter estimates, then the state estimator can be slmphfied to a state filter ~k + l/k = f(~k/k, ~k/k - 1, Uk),
d3~k/k-x ok =
dOk
_ dh(0k, ~k/k- 1) 0k
= i%- 1
~
= ~k/k-
Oh Oh d~k/k- 1 Ok=~k/k-, -- OOk + O~k/k-------~ dog
(20)
Equations (10)-(13) for the state estimator and also (18) for the state filter show, however, that ~k/k-t does not depend on 0 at all The corresponding dlfferentml would vanish in (20) and consequently the total and partial differential quotient would be ~dent~cal At this juncture one has to consider that the parameters vary, but however, their variation ~s slow m companson to that of the state As a result, the d~fferentlal quotients
(18)
while the parameter E K F remains the same In some cases the combination
d~k/k- ~ and dOk
d~k/k- 1 dOk- t
are approximately equal and one can write parameter-EKF
and
state-EKF
can give satisfactory results for nonlinear system identification Th~s estimator fails ff the direct influence of the parameters on the measured signal Yk IS only weak, or does not exist at all, as Is the case in many state models, because the denvatlve H0k vanishes This problem can be solved by a modified calculation of the gradient, which takes into account the indirect influence of the parameters that exist via the state estimates It will now be shown that prediction error methods offer a means for improved gradient calculation 4 IMPROVEMENT OF THE GRADIENT COMPUTATION BY TOTAL DIFFERENTIATION OF THE PREDICTION ERROR
Prediction error estimators operate by first estimating the output .~k/k-1 (which depends on the state), assuming the parameters to be known The gradient is then derived as the total differential of this predicted output w r t the parameters at the
d.Pk/k - a Oh d___..~h d~tk/k_ 1 dOk "~ -~k + OItk/k- 1 dOk- x
(21)
Thus the slow parameter variation property is the main factor which allows the prediction error methods to be denved for the parameter estimation This also explains why prediction error methods are inherently unsuitable for state estimation and have found no application in that direction The prediction error (PE) versions of the gradients can now be derived for the combinations of parameter-EKF with state-EKF and parameterE K F with state filter which were presented as PLR (Pseudohnear regression) versions in the previous section For the combination parameter-EKF with state EKF, (1), (10), (13) and (21) y~eld Ho~ = d ~ k - t e~=~,/k_'
(22)
494
W JAKOBY and M PANDIT
t~h
d~k/k- 1 _
dOk
t~h
+ - -
OOk
dxk+ 1/k
Of
dOk
OOk
~f dJ~k/k
+ --
--
O~k/kdO~
1 + dRk. d~k/g = -dXk/kdO k
dfq/k-
O~k/k- 1 dOk- 1
(23)
(24)
Dn
dPk/kdOk
D ,~dR~'- 1 + 2 dHxk Hxk~ k
dRk
dRt+( _ d0 k
(25)
(26)
dV~
R~'+? {2 ~
RkFxk
T dRk ] , a + Fxk ~-~-kFxkJ~Rkfl
(27)
Th~s set of recurswe equations must be solved at every samphng instant to obtam the gra&ent H0k As the pre&cUon error methods employ besides the partml denvatwes further terms for the gradient calculation, it ~s apparent that they offer results which are better than those from the PLR methods, ff the addmonal terms are not neghglble The use and advantages of the PE-method will now be illustrated w~th an example 5 APPLICATION IN A FILLING SYSTEM
In many branches of processing industries, the final stage is one of filhng and packaging One has then the task of designing a fast and accurate controller for the materml filhng Typically the material filhng system consists of an actuator valve, a dewce for determining the mass (in grawmetnc systems this is simply a set of scales) and a control umt This system includes a time-varying parameter (the mass of the material m the contamer), an unknown parameter (the matenal density) which can vary gradually or m steps and stochastically varying parameters (the reactmn Ume of the actuator) For fast and accurate control, it ~s expe&ent to have an adaptive control scheme The plant consisting of the actuator valve and the container can be modelled by a parametric nonhnear model The stream of material re(t) leaving the actuator valve depends on the input function u(t)
re(t) = A p u(t)
(too + m(t))x(t) + dx(t) + cx(t) = F(t)
(29)
The force F(t) consists of an mtegral and a proportlonal component
dHxk
d0k_l ~ n x ~ + R~ ~ -- ~t'tk~t'xk
container of mass mo can be modelled as a second order oscillatory system with damping d and spring constant c
(28)
where A ~s a measurable constant of the actuator and p is the unknown density of the material The
(30)
F(t) = kpm(t) + k, f m(z)dr
where kp, k, are known constants Because the mass re(t) appears both as a coefficient m the 1 h s and as the exc~tatmn on the r h s of (29), the system Is nonhnear The theoretical model yields equations with three states and the two unknown parameters, wz mass and density For identification, the continuous equations are transformed into their discrete counterparts and the control system is excited w~th the input function,
u(t) =
1
01~
1 - 5 ( t - l)
10~
0
t~<01,
(31)
12~
The measured weight signal is the system output and is indicated in Figs 2a-2c by continuous hnes, whde the dashed hnes are the pre&cted output s~gnals for each estimator The performance of the E K F (Fig 2a) and that of the PE-parameter E K F with state E K F (Fig 2b) is seen to be satisfactory For an adaptwe control, the parameters estimates, especially the estimate of the weight, is of primary importance Figures 3a-3b show the relatwe estimation error for the weight (continuous line) and the density (dashed hne) The mmal error of the density esUmate was 25% The E K F for combined parameter and state estlmat~on y~elds a short setthng Ume, however, the esUmat~on error does not converge to zero As has been often pointed out m connection w~th hnear systems, the E K F can also yield biased esUmates for nonhnear systems The estimates with PE-parameter E K F with E K F (Fig 3b) m&cate an equally fast transient as with E K F Furthermore, the run of the estimation error ~s smoother and exhibits better convergence properties Besides the estimation accuracy, the computatmnal reqmrements are relevant for practical apphcatlons The E K F has the largest computatmnal reqmrement and ~s used as a reference with a computational reqmrement of 100% In the case of the PE-parameter E K F w~th state E K F the reqmrement is reduced to 85% (the matrices have
495
PE-method for nonhnear systems --y
m
m-~ m
(a)
(a)
?
I'/,
I
I
I
1
I
2
I
1
t (s]
I
2
t [sl
--y -
-Y
(b)
(b)
1,~l -
1
2
t [s]
FIG 2 Measured ( ) and estimated ( ) weight signal (a) EKF for combined parameter and state estimation,(b)PEparameter-EKF and state-EKF lower dimensions and for the computation of the gradient (26) and (27) were neghglbleV) 6 CONCLUSIONS
A new method of parameter estlmauon has been presented m this paper Using the example of a filling system it has been shown that simple Pseudolinear regressmn estimators are unsatisfactory The Prediction-Error-estimator is shown to perform well, m comparison with a nonhnear Extended Kalman Filter Convergence difficulties encountered with the Extended Kalman Filter have been avoided by taking the Prediction-Errorgradient and computational effort has been reduced through separate esttmatmn of parameters and states Thus even with nonlinear systems it is possible to obtam nonhnear parameter estimators which are simpler than nonlinear filters Imminent questions concerning stabdlty, convergence, statable choice of parameters, imtial estimates and exciting functions, etc which are difficult to deal with even m linear systems reqmre extensive further work Computer simulations show that the proposed estimators yield properties which resemble those known for linear systems Two directions are open for generahzmg the results obtained First, the introduction of a Pre-
I
I
1
I
I
2
t|$]
FIG 3 Relative estimation error for mass ( ) and density ( ) (a)EKF for combined parameter and state estlmatmn, (b) PE-parameter-EKF and state-EKF
diction-Error-gradient ~s also possible for certain classes of nonlinear filters as, for instance, the Extended Kalman Filter Thereby the well-known problems of stabdity and bins can possibly be avoided along the lines similar to those proven by Ljung (1979) for linear systems Secondly, a further simphficatton of nonhnear parameter esUmatton is possible if, instead of the state model, nonhnear input-output models (Leontantls and Bilhngs, 1985) are used This ts the subject of the authors' present research REFERENCES Anderson, B D O and J B Moore (1979) Opwnal Fdtermg Prentice-Hall, Englewood ChiTs, NJ Bard, Y (1970) Companson ofgradlent methods for the solution ofnonhnear parameter estimation problems SIAM J Numer Anal, 7, 157-186 Bonse, B (1981) Zustands- und Parametertdentlfizlerung be~ hnearen stochasmchen Abtastsystemen Dissertation, Paderborn, F R G Cox, H (1964) On the estlmaUon of state variables and parameters for noisy dynamic systems IEEE Trans Aut Control, AC-9, 5-12 EI-Fattah, Y M (1983) Recurslve self-tuning algonthm for adaptive Kalman-filtenng IEE Proc D, 130, 341-344 Goodwm, G C and K S Sm (1984) Adaptwe Faltering, Predlctwn and Control Prentice-Hall, Englewood Cliffs, NJ Graupe, D (1976) Identzficatlon of Systems Robert E Krleger, Huntington, New York Krebs, V (1976) Zur Erkennung mchthnearer stochasuscher Systeme Dissertation, Darmstadt, F R G
496
W JAKOBY and M PANDIT
LeontarltlS, I J and S A Billings (1985) Input-output parametric models for non-linear systems Part I determlmst~c non-hnear systems Int J Control, 41, 303-328 Part II stochastic non-hnear systems Int J Control, 41,329-344 Ljun8, L (1978) Convergence of an adaptwe filter algorithm Int J Control, 27, 673-693 Ljung, L (1979) Asymptotic behavlour of the extended Kalman filter as a parameter estimator for linear system IEEE Trans Aut Control, AC-24, 36-50 Mehra, R K (1971) On-hne identification of hnear dynamic
systems with apphcatlons to Kalman filtering ILEIz Trans Aut Control, AC-16, 12-21 Nelson, L W and E Stear (1976) The simultaneous on-hne estimation of parameters and states in linear systems IEEE Trans Aut Control, AC-21, 94-98 SeJnfeld, J H (1970) Nonhnear estimation theory Ind Engng Chem, 62, 32-42 Yoshlmura, T, K Konlshl and T Soeda (1981) A mo&fied extended Kalman flter for linear discrete time systems with unknown parameters Automatzca, 17, 657-660