function trace = Kalman_2D_driver(max_time,delx,v1,v2,v3)
%
%t = Kalman_2D_driver(80,0.1,0.001,0.1,0.001);
%clf
%plot(t(:,1),t(:,2),'k');
%hold on
%plot(t(:,3),t(:,4),'r');
%plot(t(:,5),t(:,6),'g');

A = [1 0; 0 1];
B = [1 0; 0 1];
C = [1 0; 0 1];
R = v1*[1 0; 0 .1];  % motion prediction covariance
Q = v2*[1 0; 0 .1];  % sensor covariance
sigma = v3*[1 0; 0 .1];
mu = [1; 0];
x = [1; 0];
u = delx*[-x(2); x(1)];
trace = [x',x',mu',sigma(:)'];

for t = 0:max_time
    z = C*x + [normal_1D(0,Q(1,1));normal_1D(0,Q(2,2))];
    [mu,sigma] = Kalman_1D(mu,sigma,u,z,A,B,R,C,Q);
    trace = [trace; x',z',mu',sigma(:)'];
    x = x + u;
    u = delx*[-x(2); x(1)];
end