PNLSS 1.0 A polynomial nonlinear state-space Matlab toolbox Koen Tiels Vrije Universiteit Brussel
Applications 2/28
Wiener-Hammerstein benchmark 3/28
Goal: Capture nonlinear dynamic system behavior Error signal Input Output + System + – Modeled output Model 4/28
Goal: Capture nonlinear dynamic system behavior Error signal Input Output + System + – Modeled output Model 5/28
Goal: Capture nonlinear dynamic system behavior Error signal Input Output + System + – Modeled output Model 6/28
Goal: Capture nonlinear dynamic system behavior Load Terminal Error profile voltage signal u ( t ) y meas ( t ) ǫ ( t ) + System + – Modeled terminal voltage y ( t ) Model 7/28
Goal: Capture nonlinear dynamic system behavior Load Terminal Error profile voltage signal u ( t ) y meas ( t ) ǫ ( t ) + System + – Modeled terminal voltage y ( t ) PNLSS model 8/28
Polynomial nonlinear state-space model (PNLSS) = x ( t + 1) x ( t ) + u ( t ) + ζ ( x ( t ) , u ( t )) A B E = y ( t ) x ( t ) + u ( t ) + η ( x ( t ) , u ( t )) C D F linear state-space model polynomials in x and u 9/28
Polynomial nonlinear state-space model (PNLSS) = x ( t + 1) x ( t ) + u ( t ) + ζ ( x ( t ) , u ( t )) A B E = y ( t ) x ( t ) + u ( t ) + η ( x ( t ) , u ( t )) C D F linear state-space model polynomials in x and u x 2 1 x 1 x 2 x 1 u . . with e.g. ζ ( x , u ) = . x 2 2 u u 3 . . . 10/28
Identification of a PNLSS model = x ( t + 1) x ( t ) + u ( t ) + ζ ( x ( t ) , u ( t )) A B E = y ( t ) x ( t ) + u ( t ) + η ( x ( t ) , u ( t )) C D F linear state-space model polynomials in x and u vec( A ) ǫ ( k , θ ) = Y ( k , θ ) − Y meas ( k ) vec( B ) N F vec( C ) � ǫ H ( k , θ ) W ( k ) ǫ ( k , θ ) V WLS ( θ ) = θ = vec( D ) k =1 vec( E ) ˆ θ = arg min V WLS vec( F ) θ 11/28
Problem is nonlinear in the parameters Nonlinear optimization Starting values? V WLS ( θ ) θ 12/28
Starting value: best linear approximation (BLA) = x ( t + 1) A BLA x ( t ) + B BLA u ( t ) + ζ ( x ( t ) , u ( t )) E = 0 y ( t ) = C BLA x ( t ) + D BLA u ( t ) + η ( x ( t ) , u ( t )) F = 0 Nonlinear optimization x ( t + 1) = x ( t ) + u ( t ) + ζ ( x ( t ) , u ( t )) A B E y ( t ) = x ( t ) u ( t ) η ( x ( t ) , u ( t )) + + C D F 13/28
Collect data load(’WH EstimationExample.mat’) % Multisine data 4 40 : |U(k)| 2 0 u(t) (dB) (rad) 0 0 -40 -2 - : -80 -4 0 2 4 6 8 0 2 4 6 8 0 0.05 0.1 Freq. (Hz) # 10 4 Freq. (Hz) # 10 4 Time (s) 14/28
Best linear approximation and distortion levels N = 4096; % Number of samples P = 2; % Number of periods R = 9; % Number of realizations m = 1; % Number of inputs p = 1; % Number of outputs lines = 2:787; % Excited frequency lines . . . % Reshape data U = fft(u); % N x m x R x P Y = fft(y); % N x p x R x P U = U(lines,:,:,:); % Input spectrum at excited frequencies Y = Y(lines,:,:,:); % Output spectrum at excited frequencies % BLA, total distortion, and noise distortion [G, covGtotal, covGnoise] = fCovarFrf(U,Y); 15/28
Best linear approximation and distortion levels 0 BLA Total distortion -20 Noise distortion Amplitude (dB) -40 -60 -80 -100 -120 0 5000 10000 15000 Frequency (Hz) 16/28
Linear state-space model nAll = 2:8; % Model orders maxr = 10; % Subspace dimensioning parameter maxIter = 100; % Max. nbr. of Levenberg-Marquardt iterations fs = 78125; % Sampling frequency freq = (lines-1)*fs/N; % Frequency vector forcestability = true; % Force stable model showfigs = true; % Show overview and best model for each order % Frequency domain subspace + nonlinear optimization % McKelvey et al., 1996; Pintelon, 2002 models = fLoopSubSpace(freq,G,covGtotal,nAll,maxr,. . . maxIter,forcestability,showfigs,fs); . . . % Select best model on last period of validation data [A,B,C,D] = models { 6 }{ : } ; % Select 6th-order model [A,B,C] = dbalreal(A,B,C); % Balanced realization 17/28
6th-order linear state-space model G 11 0 BLA (parametric) BLA (nonpar) -20 residual standard deviation Amplitude [dB] -40 -60 -80 -100 -120 0 5 10 15 Frequency [kHz] 18/28
Starting value: best linear approximation (BLA) = x ( t + 1) A BLA x ( t ) + B BLA u ( t ) + ζ ( x ( t ) , u ( t )) E = 0 y ( t ) = C BLA x ( t ) + D BLA u ( t ) + η ( x ( t ) , u ( t )) F = 0 Nonlinear optimization x ( t + 1) = x ( t ) + u ( t ) + ζ ( x ( t ) , u ( t )) A B E y ( t ) = x ( t ) u ( t ) η ( x ( t ) , u ( t )) + + C D F 19/28
Transient settings % Concatenate all data u = u(:); % N*P*R x m y = y(:); % N*P*R x p % Transient settings NTrans = N; % Add a period before each realization startReal = [1 4097 . . . 32769]; % Starting indices realizations T1 = [NTrans startReal]; % Transient setting periodic data T2 = 0; % No nonperiodic transient handling 20/28
Linear model in PNLSS form = x ( t + 1) A BLA x ( t ) + B BLA u ( t ) + ζ ( x ( t ) , u ( t )) E = 0 y ( t ) = C BLA x ( t ) + D BLA u ( t ) + η ( x ( t ) , u ( t )) F = 0 % Settings nonlinear terms nx = [2 3]; % Nonlinear degrees in ζ ny = [2 3]; % Nonlinear degrees in η % Linear model in PNLSS form model init = fCreateNLSSmodel(A,B,C,D,nx,ny,T1,T2,0); % Set all monomials free for optimization model init.xactive = fSelectActive(’full’,n,m,n,nx); model init.yactive = fSelectActive(’full’,n,m,p,ny); 21/28
Poor man’s stabilization method % Simulate validation data during estimation model init.u val = uval(:); % Set bound on modeled validation output model init.max out = 1000*max(abs(yval(:))); 22/28
Nonlinear optimization % Settings Levenberg-Marquardt (LM) optimization nIter = 50; % Number of iterations W = []; % No (frequency) weighting lambda = 100; % Starting value LM damping factor % Nonlinear optimization [model,y mod,models] = fLMnlssWeighted(u,y,model init,. . . nIter,W,lambda); % Select the best model on the validation data . . . model = models(min i); 23/28
Results on test data % Change transient setting model pnlss test = model; model pnlss test.T1 = [16384 1]; % Compute rms error on multisine test data e = rms(ytest - fFilterNLSS(model pnlss test,utest)); multisine swept sine linear 0.03817 0.02319 PNLSS 0.03817 0.02258 24/28
Pros and cons of a PNLSS model = x ( t + 1) x ( t ) + u ( t ) + ζ ( x ( t ) , u ( t )) A B E = y ( t ) x ( t ) + u ( t ) + η ( x ( t ) , u ( t )) C D F linear state-space model polynomials in x and u � Flexibility X Number of parameters � Multiple input X Stability X multiple output Interpretability � X Initial estimates Extrapolation � X Software available Process noise 25/28
What to expect in PNLSS 2.0? Object-oriented Modular components (initialization, cost, Jacobian, optimization) Beyond polynomials Structure specification/retrieval 26/28
Success story: battery cell Lithium Ion Polymer Battery (EIG-ePLB-C020, Li(NiCoMn)) 3 . 65 V , 20 A h , AC impedance ( 1 kHz < 3 m Ω) Nonparametric distortion analysis 27/28 modified by courtesy of Rishi Relan
Success story: battery cell 4 states up to third-degree nonlinearities Time domain Frequency domain 28/28 modified by courtesy of Rishi Relan
Recommend
More recommend