{"id":1011,"date":"2019-11-12T23:04:51","date_gmt":"2019-11-13T07:04:51","guid":{"rendered":""},"modified":"2023-06-27T17:14:20","modified_gmt":"2023-06-28T00:14:20","slug":"1011","status":"publish","type":"post","link":"https:\/\/www.vernier.com\/til\/1011","title":{"rendered":"How do Logger <i>Pro<\/i>, Graphical Analysis, LabQuest app, and Vernier Video Analysis calculate velocity and acceleration?"},"content":{"rendered":"<p class=\"wp-block-paragraph\">Logger <i>Pro<\/i>, Graphical Analysis, LabQuest App, and Vernier Video Analysis all determine velocity and acceleration from position values using a numerical derivative calculation. <\/p>\n<p class=\"wp-block-paragraph\">Data used for derivatives commonly come from a Motion Detector, Sensor Cart, Encoder Cart, Rotary Motion sensors, or video analysis. <a href=\"http:\/\/vnr.st\/til\/1141\">Photogate data often use a different calculation to account for time offsets. <\/a>Numerical derivatives are also used in some chemistry experiments to locate the maximum rate of change of pH, for example. The mathematics is the same.<\/p>\n<p class=\"wp-block-paragraph\">The derivative and second derivative functions use an odd number of points to estimate the slope of a tangent line centered at the current time. The software does not ever find slopes by successive differences of only two points.<\/p>\n<p class=\"wp-block-paragraph\">You can set the number of points used for derivatives in software by changing it in the settings for that file. See <a href=\"\/til\/2331\/\">How do I adjust the number of points used in derivative calculations?<\/a>, which gives instructions for how to do this in each of our software titles. <\/p>\n<p class=\"wp-block-paragraph\">The number of points used for finding derivatives has a major impact on the appearance of velocity graphs, which are created based on position and time data from a sensor. Using more points will smooth out irregular features, but will also smear out useful detail if taken too far. The first several points and last several points in a velocity graph are calculated with a reduced number of points since the not all points are available.<\/p>\n<p class=\"wp-block-paragraph\">If the target is a person, it is helpful to use many (11 to 15) points for derivatives; in contrast, that many points for a ball toss experiment will result in misleading smeared out velocity and acceleration graphs.<\/p>\n<p class=\"wp-block-paragraph\">The slope itself is calculated as a weighted average of slopes from points on either side of the target point. For example, suppose we have a portion of a data table of (t, x) pairs, and we want the derivative at row i:<\/p>\n<p class=\"wp-block-paragraph\">t(i\u22122)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x(i\u22122)<br \/>t(i\u22121)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x(i\u22121)<br \/>t(i)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x(i)<br \/>t(i+1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x(i+1)<br \/>t(i+2)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x(i+2)<\/p>\n<p class=\"wp-block-paragraph\">For n=3, the derivative at row i is<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"alignleft is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"\/files\/til\/images\/1011-slope_equation_1.png\" alt=\"1011-slope_equation_1.png\" width=\"168\" height=\"49\"\/><\/figure>\n<\/div>\n<p class=\"wp-block-paragraph\">That is, the change in x divided by the change <br \/>in time, using the rows on either side of row i.<\/p>\n<p class=\"wp-block-paragraph\">\n<p class=\"wp-block-paragraph\">For n=5, the additional i+2 and i\u22122 rows are used:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"alignleft size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.vernier.com\/til\/wp-content\/uploads\/sites\/2\/2021\/07\/image-2-1024x210.png\" alt=\"\" class=\"wp-image-12573\" width=\"301\" height=\"61\" srcset=\"https:\/\/www.vernier.com\/til\/wp-content\/uploads\/sites\/2\/2021\/07\/image-2-1024x210.png 1024w, https:\/\/www.vernier.com\/til\/wp-content\/uploads\/sites\/2\/2021\/07\/image-2-600x123.png 600w, https:\/\/www.vernier.com\/til\/wp-content\/uploads\/sites\/2\/2021\/07\/image-2-768x157.png 768w, https:\/\/www.vernier.com\/til\/wp-content\/uploads\/sites\/2\/2021\/07\/image-2-1536x315.png 1536w, https:\/\/www.vernier.com\/til\/wp-content\/uploads\/sites\/2\/2021\/07\/image-2-2048x420.png 2048w\" sizes=\"auto, (max-width: 301px) 100vw, 301px\" \/><\/figure>\n<\/div>\n<p class=\"wp-block-paragraph\">\n<p class=\"wp-block-paragraph\">That is, the derivative using five rows is the weighted average of the slopes found from the rows just before and after row i, two rows before and after, etc.<br \/>For n=5, the weights are 2 and 1. For n=7, the weights are 3, 2, and 1.<\/p>\n<p class=\"wp-block-paragraph\">The second derivative is the same algorithm applied twice.<\/p>\n<p class=\"wp-block-paragraph\">See also:<br \/><a href=\"\/til\/1141\/\">How does Logger <i>Pro<\/i> calculate velocity and acceleration from photogate data?<\/a><br \/><a href=\"http:\/\/en.wikipedia.org\/wiki\/Savitzky\u2013Golay_smoothing_filter\">Savitzky\u2013Golay smoothing filter<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>Logger Pro, Graphical Analysis, LabQuest App, and Vernier Video Analysis all determine velocity and acceleration from position values using a numerical derivative calculation. Data used&#8230;<\/p>\n","protected":false},"author":43901,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[],"tags":[835,837,834,838,83,8,836],"class_list":["post-1011","post","type-post","status-publish","format-standard","hentry","tag-acceleration","tag-algorithm","tag-derivative-slope","tag-logger-pro-3","tag-lp","tag-md-btd","tag-velocity"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.vernier.com\/til\/wp-json\/wp\/v2\/posts\/1011","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vernier.com\/til\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vernier.com\/til\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vernier.com\/til\/wp-json\/wp\/v2\/users\/43901"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vernier.com\/til\/wp-json\/wp\/v2\/comments?post=1011"}],"version-history":[{"count":0,"href":"https:\/\/www.vernier.com\/til\/wp-json\/wp\/v2\/posts\/1011\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.vernier.com\/til\/wp-json\/wp\/v2\/media?parent=1011"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vernier.com\/til\/wp-json\/wp\/v2\/categories?post=1011"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vernier.com\/til\/wp-json\/wp\/v2\/tags?post=1011"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}