%
% Example 12.5 (12.3 plus noise)
%
global k;
close all;
fs = 24;
%
randn('state',0);
k = [ 0; 0 ];
[ t, x ] = euler( 'Spring_and_Damper2', [ 0 10 ], [ 0 5 0 0 ] );
%
figure;
randn('state',0);
plot( t, x(:,1)+randn(size(x(:,1))) );
set( gca, 'fontsize', fs );
xlabel( 'Time in seconds' );
ylabel( 'True Position' );
%
k = [ 3; 3 ];
[ t, x ] = euler( 'Spring_and_Damper2', [ 0 10 ], [ 0 5 0 0 ] );
figure;
plot( t, x(:,2), t, x(:,4) );
set( gca, 'fontsize', fs );
xlabel( 'Time in seconds' );
ylabel( 'Velocity' );
%
k = [ 6; 15 ];
[ t, x ] = euler( 'Spring_and_Damper2', [ 0 10 ], [ 0 5 0 0 ] );
figure;
plot( t, x(:,2), t, x(:,4) );
set( gca, 'fontsize', fs );
xlabel( 'Time in seconds' );
ylabel( 'Velocity' );
%
print -f1 -deps2 fig12measpos.eps
print -f2 -deps2 fig12kalm2a.eps
print -f3 -deps2 fig12kalm2b.eps
%

