%% Wiener identification : thsing small
%% signal analysis. a fear function with svm.
% Then we will construct a closed loop system where at the feedback the
% inverse model of the nonlinearity is present. And we may add a controller
% such that the control design spesifications are satisfied.
%% This file is pretty much similar to WienerAsAHammerstein . Here the
%% example of valve control is examined as examined in a paper.
u=.25*normrnd(0,1,1,700) ; %.1111;
% A white gaussian input sequence u with
%700 0 mean and standard deviation 2
A white gaussian with zero mean and standart de
% viation .2 with length 700. it is error term
e = zeros(1,700);
this is added after all. actually it should have
ic = i;
= [1 -1.4138 0.6065]
b = [0 0.1044 0.0883] ;
% bi s
% the roots below will be used for the closed loop system below. A
% controller is added to the roots: rts.
rts_c = [1 .98*exp(ic) .98*exp(-ic) .98*exp(1.6*ic) .98*exp(-1.6*ic) .
% now we will get the input output data of the original Wiener system
% ,small signals are used.
[h,tt] = impz(b,[a]);
%filter impulse response
v = conv(h,u);
v2 = .95*u; y2 = conv(h,v2);
y = v./(sqrt(0.1 + 0.9*v.^2));
%3*(-.5 + 1./(1 + exp(-.5*v)) );%
figure(1);subplot(4,1,1) ; plot(u(1:700)); title('input to the system');
subplot(4,1,2) ; plot(v(1:700)); title('output of the filter: before
subplot(4,1,3) ; plot(y(1:700)); title('output of the whole system');hold off
subplot(4,1,4) ; plot(y2(1:700));title('output of the whole system;v2 = .95*u
m=2;n= sum(size(a))-2;r=n+1; sg = 1;
solve linear equation
% construct Kernel matrix . The last two hundred data points will be used.
xtrain = u(201:400);
% K is omega matrix
K(i,j) = exp(-((u(1,i+200)-u(1,j+200))^2)*1);
% Construct Yf. Again the last two hundred data points will be used .
Yf = y(1,200+r:200+N);
%it is okei
% Construct Yp:n*N-r+1.
Again the last two hundred data points will be used.
Yp(i,1:N-r+1) = y(1,200+r-i:N+200-i);
% Construct Ko. Ko:194*4 (expected) it is okei.
for p = 1:N-r+1
for q = 1:m
sumk = 0;
for t = 1:N
sumk = sumk + K(t,r+p-q-1); % -1 is added compared to the original case