0% found this document useful (0 votes)
10 views

Assignment 3

Uploaded by

anurag.saha
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Assignment 3

Uploaded by

anurag.saha
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Introduction: A type of iterative procedure called the Kalman filter is used to

estimate values and data that cannot be measured directly. For instance, heat makes it
impossible to place a temperature sensor inside a rocket thrust chamber to determine
the temperature within. The detector may be

broken, melted, or otherwise malfunctioned. As a result, we must position the sensor


where the temperature is reasonably appropriate. However, this prevents us from
knowing the chamber's real temperature. We can build a mathematical model that can
compute the precise value in order to obtain the actual temperature. However, this
ignores the variables that could alter the chamber's temperature.To determine the
estimated true value, the Kalman filter works in tandem with the mathematical model
and sensor data. A feedback loop that feeds the input of the mathematical model with a
gain of K measures the error between the estimated value and the sensor value. in
order for the predicted value to swiftly converge to the true value. Following a car
through a tunnel when there is very little GPS reception is another example. It is
technically possible to determine the position if we know the velocity. However, we are
neglecting other aspects. The GPS position data and the computed data can be
combined with the Kalman filter to approximate a true value.
When it is difficult to measure a value precisely, the Kalman filter estimates the true
value is not possible

In three steps, the Kalman filter operates. The first iteration involves measuring the
Kalman gain, K. After that, we utilize this to determine the current estimate, and the
inaccuracy in the current estimate has been quantified. The following iterations have
used all of these data to estimate new data.
Objective: In this Case Study, we will forecast the quantity of vehicles that will
traverse a specific road in relation to time using the Kalman Filter. We have gathered a
sizable sample of the quantity of vehicles that pass in front of BRAC University's main
campus. In order to forecast and demonstrate whether the traffic pattern repeats itself at
a specific hour on a specific day of the week, we employed the Kalman Filter.
We will use a 5-minute frame to use the Kalman filter to predict the data.

Methodology:

Three steps are required to put the system into operation. They are as follows:
1. Calculation of the Kalman gain.
2. Current estimate calculation
3. Determination of the error in the current estimate.

These actions are taken sequentially and are all calculated iteratively. First, we use
historical data to calculate the Kalman gain. Next, we apply it to the computation of the
current estimate. After completing both of these, the iteration ends and the Kalman
filtering calculates the amount of error in the new predicted value. The next iteration
then begins with all of the previous estimated data and the calculation of the new data
inputs, and so on, until the desired prediction is obtained based on the actual value of
the data.
Kalman Gain:

To find the Kalman gain, we need to know the measurement error and the estimation
error.
The discrepancy between the road track and the sensor value yields the measurement
error. Following the measurement of the sensor value's inaccuracy, the sensor value is
used for the calculated error. These two presumptions create the Kalman Gain
equation.
Error in Estimation:
Error and Percentage

Estimated Data Using Kalman filter:


To estimate the Kalman predicted car count, we have used this MATLAB code.

Estimating KPCC -
clc;
clear all;
close all;
ACC = [161 159 115 179 171 155; 163 152 145 145 155 176; 183 152 134 152 202
158; 195
158 141 148 105 180; 163 164 215 183 164 187; 135 122 190 181 187 179; 184 146
176 193
199 220; 185 163 182 176 132 154; 200 159 186 163 174 193; 175 135 128 149 141
140; 178
148 161 173 182 211; 185 156 154 169 165 240];
a = sum(ACC,2);
X = a'./6;
[b, c] = size(ACC);
P = 3;
R = 4;
KPCC = [];
for i = 1:b
for j = 1:c
K = P/(P+R);
r(j) = X(j) + K * (ACC(i,j) - X(j));
KPCC = [KPCC; r(j)];
X(j) = r(j);
p = (1-K)*P;
P = p;
R = abs(ACC(i,j)-X(i));
end
end
disp(KPCC)
Data Table:

Estimating Error:
clc;
clear all;
close all;
ACC = [161 159 115 179 171 155; 163 152 145 145 155 176; 183 152 134 152 202
158; 195
158 141 148 105 180; 163 164 215 183 164 187; 135 122 190 181 187 179; 184 146
176 193
199 220; 185 163 182 176 132 154; 200 159 186 163 174 193; 175 135 128 149 141
140; 178
148 161 173 182 211; 185 156 154 169 165 240];
KPCC = [158.5238 158.7186 124.5040 125.7382 125.9203 126.0579; 156.0512
155.9314
155.3883 155.1966 155.1930 165.4648; 163.6748 163.6180 163.3804 163.3444
163.6584
163.6449; 155.1491 155.1555 154.7202 154.6776 154.0392 154.0845; 179.2795
179.1998
179.3987 179.4073 179.0542 179.0974; 165.3522 165.2367 165.2829 165.3341
165.4447
165.4948; 186.3196 184.9878 184.9702 185.0380 185.1697 185.3579; 165.3757
165.3667
165.8727 165.9177 165.6783 165.6537; 179.2929 179.2239 179.2474 179.0804
179.0586
179.2465; 144.8163 144.7943 144.6790 144.6963 144.6397 144.5572; 175.5350
174.8399
174.8079 174.7998 175.0389 175.3449; 178.1780 177.9874 177.9236 177.9018
177.8178
178.0977];
error = ACC-KPCC
error_percent = ((ACC - KPCC)./ACC)*100
Error Graph:

FUTURE WORK:

The Kalman filter is an excellent tool for estimating values that are difficult for us to
measure. It has the name of Rudolf E. Kálmán, an émigré. The navigation system made
use of this algorithm. The Kalman filter is now utilized for a number of purposes, such
as data estimation, value prediction, and error reduction between predicted and true
values.
Utilizing sensor data may result in some noise in the data. This noise could be a sign of
several different system states. The purpose of the standard Kalman filter is to generate
an ideal estimate of the state by integrating and processing all available data regarding
a linear dynamic system, including its measurements and dynamics model.
Assuming that the system's measurement errors are Gaussian and zero-mean, this
state estimate is ideal in that it minimizes variance.
This approach estimates the desired data by collaborating data from two states using a
covariance matrix.
Assume two states, X and Y. In this case, X and Y may include position and velocity
data from two distinct states.
Conclusion:

In summary, the Kalman filter is a helpful idea for putting several technical solutions into
practice. When direct measurement is not possible, the Kalman filter can estimate and
measure the value.not feasible; instead, we must estimate and compute the value. It
uses almost flawless data and is a recursive procedure. In our instance, a smart traffic
system could be developed if the installation is effective.Research of this kind is crucial
to lessening traffic-related problems. Countries all around the world spend a lot of
money trying to lower it each year, but this research demonstrates that the Kalman filter
technique may be used to solve traffic issues in a relatively straightforward manner. The
Kalman filter is one of the finest options for figuring out how to plan roads depending on
how many vehicles utilize them and how to organize this because of its recursive
prediction capabilities. We may alternatively argue that we can simply control the
mistakes and obtain the intended outcomes by varying the gain of the Kalman filter.

Reference:
▪ https://www.intechopen.com/chapters/63164

▪ S. Karim, N. Sa-Adat, S. Shadman, M. Hasnaen and A.K.M. Azad, Traffic Condition


Awareness using Kalman Filter Technique with the aid of Arduino and Matlab
Embedded
System.

You might also like