SLIDE 1
PNLSS 1.0 A polynomial nonlinear state-space Matlab toolbox Koen - - PowerPoint PPT Presentation
PNLSS 1.0 A polynomial nonlinear state-space Matlab toolbox Koen - - PowerPoint PPT Presentation
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 +
SLIDE 2
SLIDE 3
Wiener-Hammerstein benchmark
3/28
SLIDE 4
Goal: Capture nonlinear dynamic system behavior
System Model + Input Output Modeled
- utput
Error signal
+ –
4/28
SLIDE 5
Goal: Capture nonlinear dynamic system behavior
System Model + Input Output Modeled
- utput
Error signal
+ –
5/28
SLIDE 6
Goal: Capture nonlinear dynamic system behavior
System Model + Input Output Modeled
- utput
Error signal
+ –
6/28
SLIDE 7
Goal: Capture nonlinear dynamic system behavior
System Model + Load profile u(t) Terminal voltage ymeas(t) Modeled terminal voltage y(t) Error signal ǫ(t)
+ –
7/28
SLIDE 8
Goal: Capture nonlinear dynamic system behavior
System PNLSS model + Load profile u(t) Terminal voltage ymeas(t) Modeled terminal voltage y(t) Error signal ǫ(t)
+ –
8/28
SLIDE 9
Polynomial nonlinear state-space model (PNLSS)
9/28 x(t + 1) = A x(t) + B u(t) + E ζ(x(t), u(t)) y(t) = C x(t) + D u(t) + F η(x(t), u(t)) linear state-space model polynomials in x and u
SLIDE 10
Polynomial nonlinear state-space model (PNLSS)
10/28 x(t + 1) = A x(t) + B u(t) + E ζ(x(t), u(t)) y(t) = C x(t) + D u(t) + F η(x(t), u(t)) linear state-space model polynomials in x and u
with e.g. ζ(x, u) = x2
1
x1x2 x1u . . . x2
2u
u3 . . .
SLIDE 11
Identification of a PNLSS model
11/28 x(t + 1) = A x(t) + B u(t) + E ζ(x(t), u(t)) y(t) = C x(t) + D u(t) + F η(x(t), u(t)) linear state-space model polynomials in x and u
θ = vec(A) vec(B) vec(C) vec(D) vec(E) vec(F) ǫ(k, θ) = Y (k, θ) − Ymeas(k) VWLS(θ) =
NF
- k=1
ǫH(k, θ)W (k)ǫ(k, θ) ˆ θ = arg min
θ
VWLS
SLIDE 12
Problem is nonlinear in the parameters
12/28
Nonlinear optimization Starting values?
VWLS(θ) θ
SLIDE 13
Starting value: best linear approximation (BLA)
13/28
x(t + 1) = ABLA x(t) + BBLA u(t) + E = 0 ζ(x(t), u(t)) y(t) = CBLA x(t) + DBLA u(t) + F = 0 η(x(t), u(t))
Nonlinear optimization
x(t + 1) = A x(t) + B u(t) + E ζ(x(t), u(t)) y(t) = C x(t) + D u(t) + F η(x(t), u(t))
SLIDE 14
Collect data
load(’WH EstimationExample.mat’) % Multisine data
Time (s) 0.05 0.1 u(t)
- 4
- 2
2 4
- Freq. (Hz) #104
2 4 6 8 |U(k)| (dB)
- 80
- 40
40
- Freq. (Hz) #104
2 4 6 8 (rad) 0 :
- :
14/28
SLIDE 15
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
SLIDE 16
Best linear approximation and distortion levels
16/28
Frequency (Hz)
5000 10000 15000
Amplitude (dB)
- 120
- 100
- 80
- 60
- 40
- 20
BLA Total distortion Noise distortion
SLIDE 17
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
SLIDE 18
6th-order linear state-space model
18/28 Frequency [kHz] 5 10 15 Amplitude [dB]
- 120
- 100
- 80
- 60
- 40
- 20
G11
BLA (parametric) BLA (nonpar) residual standard deviation
SLIDE 19
Starting value: best linear approximation (BLA)
19/28
x(t + 1) = ABLA x(t) + BBLA u(t) + E = 0 ζ(x(t), u(t)) y(t) = CBLA x(t) + DBLA u(t) + F = 0 η(x(t), u(t))
Nonlinear optimization
x(t + 1) = A x(t) + B u(t) + E ζ(x(t), u(t)) y(t) = C x(t) + D u(t) + F η(x(t), u(t))
SLIDE 20
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
SLIDE 21
Linear model in PNLSS form
x(t + 1) = ABLA x(t) + BBLA u(t) + E = 0 ζ(x(t), u(t)) y(t) = CBLA x(t) + DBLA u(t) + F = 0 η(x(t), u(t))
% 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
SLIDE 22
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
SLIDE 23
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
SLIDE 24
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
SLIDE 25
Pros and cons of a PNLSS model
x(t + 1) = A x(t) + B u(t) + E ζ(x(t), u(t)) y(t) = C x(t) + D u(t) + F η(x(t), u(t)) linear state-space model polynomials in x and u
- Flexibility
X
Number of parameters
- Multiple input
X
Stability multiple output
X
Interpretability
- Initial estimates
X
Extrapolation
- Software available
X
Process noise
25/28
SLIDE 26
What to expect in PNLSS 2.0?
Object-oriented Modular components (initialization, cost, Jacobian, optimization) Beyond polynomials Structure specification/retrieval
26/28
SLIDE 27
Success story: battery cell
27/28 Lithium Ion Polymer Battery (EIG-ePLB-C020, Li(NiCoMn)) 3.65 V, 20 A h, AC impedance (1 kHz < 3 mΩ)
Nonparametric distortion analysis
modified by courtesy of Rishi Relan
SLIDE 28