Chapter 8: Problem 44
Compute velocity and acceleration. In a laboratory experiment waves are generated through the impact of a model slide into a wave tank. (The intention of the experiment is to model a future tsunami event in a fjord, generated by loose rocks that fall into the fjord.) At a certain location, the elevation of the surface, denoted by \(\eta\), is measured at discrete points in time using an ultra-sound wave gauge. The result is a time series of vertical positions of the water surface elevations in meter: \(\eta\left(t_{0}\right), \eta\left(t_{1}\right), \eta\left(t_{2}\right), \ldots, \eta\left(t_{n}\right)\). There are 300 observations per second, meaning that the time difference between to neighboring measurement values \(\eta\left(t_{i}\right)\) and \(\eta\left(t_{i+1}\right)\) is \(h=1 / 300\) second. Write a Python program that accomplishes the following tasks: 1\. Read \(h\) from the command line. 2\. Read the \(\eta\) values in the file src/random/gauge. dat into an array eta. 3\. Plot eta versus the time values. 4\. Compute the velocity \(v\) of the surface by the formula $$ v_{i} \approx \frac{\eta_{i+1}-\eta_{i-1}}{2 h}, \quad i=1, \ldots, n-1 $$ Plot \(v\) versus time values in a separate plot. 5\. Compute the acceleration \(a\) of the surface by the formula $$ a_{i} \approx \frac{\eta_{i+1}-2 \eta_{i}+\eta_{i-1}}{h^{2}}, \quad i=1, \ldots, n-1 $$ Plot \(a\) versus the time values in a separate plot.
Short Answer
Step by step solution
Key Concepts
These are the key concepts you need to understand to accurately answer the question.