Chapter 3: Problem 15
Compute velocity and acceleration from position data; one dimension. Let \(x(t)\) be the position of an object moving along the \(x\) axis. The velocity \(v(t)\) and acceleration \(a(t)\) can be approximately computed by the formulas $$ v(t) \approx \frac{x(t+\Delta t)-x(t-\Delta t)}{2 \Delta t}, \quad a(t) \approx \frac{x(t+\Delta t)-2 x(t)+x(t-\Delta t)}{\Delta t^{2}} $$ where \(\Delta t\) is a small time interval. As \(\Delta t \rightarrow 0\), the above formulas approach the first and second derivative of \(x(t)\), which coincide with the well-known definitions of velocity and acceleration. Write a function kinematics \((x, t, d t=1 E-4)\) for computing \(x, v\), and \(a\) time \(t\), using the above formulas for \(v\) and \(a\) with \(\Delta t\) corresponding to dt. Let the function return \(x, v\), and \(a\). Test the function with the position function \(x(t)=e^{-(t-4)^{2}}\) and the time point \(t=5\) (use \(\left.\Delta t=10^{-5}\right)\). Name of program: kinematics 1.py.
Short Answer
Step by step solution
Key Concepts
These are the key concepts you need to understand to accurately answer the question.