18.08.2013 Views

UNIVERSITA' DEGLI STUDI DI PAVIA - Robotica

UNIVERSITA' DEGLI STUDI DI PAVIA - Robotica

UNIVERSITA' DEGLI STUDI DI PAVIA - Robotica

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

% Usato per eliminare il doppione alla frontiera dei due insiemi<br />

low_part = logspace(-10, 2, 39);<br />

rho = [low_part(1, 1:38) logspace(2, 12, 82)];<br />

nrho = max(size(rho));<br />

outfile = fopen(fname, 'w');<br />

fprintf(outfile, '%d\n', nA);<br />

fprintf(outfile, '%d\n', nrho);<br />

tic<br />

for i = 1:nrho,<br />

% Imposta il parametro che controlla il predittore<br />

Q = 1;<br />

R = rho(i);<br />

% Calcola la soluzione dell'equazione di Riccati con metodo<br />

% iterativo<br />

P0 = eye(size(A));<br />

[P, eps, nout] = riccati(P0, A, B, C, Q, R, -inf, 100);<br />

norm(-P + A * P * A' - A * P * C' * inv(C * P * C' + R) * C *<br />

P * A' + B * Q * B');<br />

% Calcola il guadagno del filtro di Kalman<br />

K = A * P * C' * inv(C * P * C' + R);<br />

fprintf(outfile, '%f ', rho(i));<br />

fprintf(outfile, '%f ', K);<br />

fprintf(outfile, '\n');<br />

end<br />

fprintf(outfile, '\n');<br />

toc<br />

fclose(outfile);<br />

213

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!