Accuracy in calculating distance from Android Device using double integral? [closed]

Using TYPE_LINEAR_ACCELERATION suppose I found out that the device is moving at 4 m/s².

a(t)=s"(t)=+4
v(t)=∫4tdt
s(t)=2/3t³
s(3)=18m

How much accurate it would be?

1

There are two sources of errors here: (a) numerical inaccuracies stemming from floating-point representations, and (b) general measurement errors, which in turn are either (b.1) calibration errors (your accelerometer has a skewed or drifting scale) or (b.2) statistical uncertainty.

Errors from (a) are difficult, but possible to quantify exactly. However, they are likely small when compared with (b).

Errors from (b.1) can be compensated by calibrating the accelerometer with other devices. In the general case, this involves transforming the data along a calibration curve. Note that this can amplify errors from (b.2).

Errors from (b.2) cannot be corrected, but we can use them to say how exact our end result is. First, the uncertainty has to be quantified by measuring the acceleration in an experiment (e.g. dropping the device, and wirelessly collecting acceleration data) which is repeated as often as possible. From the data set, we can calculate the mean μa, and the standard deviation σa for the acceleration. Because your average Android device has varying air resistance depending on the orientation, the measurements will be probably spread over a large interval.

We now wish to estimate the standard deviation of the displacement s in dependency of the acceleration a. First, they are related via:

s(t) = ½ a · t²

because a = d²/dt² s ⇔ s = ∫∫ a dt² ⇔ ∫ a·t dt.

Now, σs can be calculated as:

σs = ( ∂/∂a s(t) )² · σa²

which is terribly convenient, because then

σs = (½ · t²)² · σa² = ¼ · t4 · σa²

Note that the uncertainty depends on the time t.

Example

Let the acceleration be a = 4 m·s-2 with σa = 0.3 m·s-2, and the duration be t = 3 s. We then get:

s(t) = 18 m
σa = 1.8225 m

so that the relative error σ/s is 10.1%.

If we change t = 0.7 s, then we would get

s(t) = 0.98 m
σa = 5.402E-3 m

so that σ/s = 0.6%.

What does this mean? For short durations/distances, even large errors make for fairly accurate results. You might just as well ignore them. However, the error grows in O(t4), which is quite fast. So over a longer distance/duration, you tend to get very uncertain results (which may still be useful, depending on the problem domain).

We can calculate the distances or times where the σ/a -ratio stays within a certain value p:

p ≥ (¼ · t4 · σa²) / (½ a · t²) = ½ · σa²/a · t²
t ≤ √( 2 · p · aa² )

So with the previous values for acceleration and deviation, and a limit for p at 5%, we now know that any extrapolations longer than t = √4.44 s = 2.11 s (equivalent to a distance of 8.89 m) are too uncertain.


For further reading, you should look at Propagation of Uncertaincy at Wikipedia.

Accuracy of the measurement will be specific to the device you are using and the chips used to create the sensor.

Accuracy (precision) of the calculation will be dependent upon the variable types (int, float, double, etc…) that you use.

Accuracy of the integration you are suggesting to calculate distance will depend upon how many samples you are able to gather, the frequency of those samples, and the accuracy of the samples themselves.

Your question is a minor example of the compounding error problem. You are most likely limited by the sensor reading. All of the subsequent operations upon that reading / those readings will compound that error.

Your best bet is to take a lot of readings and see how close they match your expectations for what you need it to do.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật