Optimization: principles and algorithms, by Michel Bierlaire
runKalman.m
Go to the documentation of this file.
1 %> \file
2 %> Run to illustrate the Kalman filter algorithm 14.2 (Table 14.3)
3 %>
4 %> @note Calls \ref kalmanFilter
5 %>
6 %> @ingroup Running
7 %> @ingroup chap14
8 %> @author Michel Bierlaire
9 %> @date Sat Mar 21 18:14:17 2015
10 
11 A1 = [ 77005.0 1.0 ;
12 76315.0 1.0 ;
13 70891.0 1.0 ;
14 67667.0 1.0 ;
15 64643.0 1.0 ;
16 61770.0 1.0 ;
17 61593.0 1.0 ;
18 63227.0 1.0 ;
19 63684.0 1.0 ;
20 66914.0 1.0 ;
21 72407.0 1.0 ;
22 82413.0 1.0 ];
23 
24 b1 = [ 57312.0 ;
25 56839.0 ;
26 55501.0 ;
27 55491.0 ;
28 54217.0 ;
29 53098.0 ;
30 54701.0 ;
31 56596.0 ;
32 56663.0 ;
33 58622.0 ;
34 59660.0 ;
35 59896.0 ];
36 
37 A2 = [86515.0 1.0 ] ;
38 b2 = [ 61643.0 ] ;
39 
40 A3 = [84896.0 1.0 ] ;
41 b3 = [ 61105.0 ] ;
42 
43 A4 = [79660.0 1.0 ] ;
44 b4 = [ 59333.0 ] ;
45 
46 A5 = [75827.0 1.0 ] ;
47 b5 = [ 60024.0 ] ;
48 
49 A6 = [72606.0 1.0 ] ;
50 b6 = [ 58684.0 ] ;
51 
52 A7 = [69423.0 1.0 ] ;
53 b7 = [ 57075.0 ] ;
54 
55 A8 = [69690.0 1.0 ] ;
56 b8 = [ 58826.0 ] ;
57 
58 A9 = [69744.0 1.0 ] ;
59 b9 = [ 60212.0 ] ;
60 
61 A10 = [70418.0 1.0 ] ;
62 b10 = [ 60654.0 ] ;
63 
64 A11 = [71998.0 1.0 ] ;
65 b11 = [ 61445.0 ] ;
66 
67 A12 = [77268.0 1.0 ] ;
68 b12 = [ 61805.0 ] ;
69 
70 A13 = [87299.0 1.0 ] ;
71 b13 = [ 62138.0 ] ;
72 
73 x = zeros(2,1) ;
74 H = zeros(2,2) ;
75 
76 [x,H] = kalmanFilter(x,H,A1,b1) ;
77 printf("1 \t %.6g \t %.6g \n",x(1),x(2)) ;
78 [x,H] = kalmanFilter(x,H,A2,b2) ;
79 printf("2 \t %.6g \t %.6g \n",x(1),x(2)) ;
80 [x,H] = kalmanFilter(x,H,A3,b3) ;
81 printf("3 \t %.6g \t %.6g \n",x(1),x(2)) ;
82 [x,H] = kalmanFilter(x,H,A4,b4) ;
83 printf("4 \t %.6g \t %.6g \n",x(1),x(2)) ;
84 [x,H] = kalmanFilter(x,H,A5,b5) ;
85 printf("5 \t %.6g \t %.6g \n",x(1),x(2)) ;
86 [x,H] = kalmanFilter(x,H,A6,b6) ;
87 printf("6 \t %.6g \t %.6g \n",x(1),x(2)) ;
88 [x,H] = kalmanFilter(x,H,A7,b7) ;
89 printf("7 \t %.6g \t %.6g \n",x(1),x(2)) ;
90 [x,H] = kalmanFilter(x,H,A8,b8) ;
91 printf("8 \t %.6g \t %.6g \n",x(1),x(2)) ;
92 [x,H] = kalmanFilter(x,H,A9,b9) ;
93 printf("9 \t %.6g \t %.6g \n",x(1),x(2)) ;
94 [x,H] = kalmanFilter(x,H,A10,b10) ;
95 printf("10 \t %.6g \t %.6g \n",x(1),x(2)) ;
96 [x,H] = kalmanFilter(x,H,A11,b11) ;
97 printf("11 \t %.6g \t %.6g \n",x(1),x(2)) ;
98 [x,H] = kalmanFilter(x,H,A12,b12) ;
99 printf("12 \t %.6g \t %.6g \n",x(1),x(2)) ;
100 [x,H] = kalmanFilter(x,H,A13,b13) ;
101 printf("13 \t %.6g \t %.6g \n",x(1),x(2)) ;
function kalmanFilter(in x, in H, in A, in b, in lambda)
Applies one update of the Kalman filter algorithm.
Copyright 2015-2016 Michel Bierlaire