Question: Please answer this question using matlab. Thank you. Problem 3: Development of numerical algorithms and construction of functions in numerical computations The speed of a
Please answer this question using matlab. Thank you.
Problem 3: Development of numerical algorithms and construction of functions in numerical computations The speed of a train during the first 90 seconds has been recorded as follows: 1 | t (sec) v (m/s) 0 0 15 6 30 20 45 | 60 | 75 | 90 33 394345 From the v-t graph, approximating the curve as straight-line segments between the given data points, determine the total distance travelled using the relation v= ds = fods = { vdt = s(t)= Svat JS=0 dt Note that integration can be viewed as the area underneath the curve. a) By hand calculations (with the aid of a calculator, if needed). b) By applying an user-defined MATLAB function which needs to first determine the number of data points and then execute the numerical integration algorithm. A suggested structure is: function output = name (x,y) % x = independent variable % y = dependent variable % output = the approximate value of the integral if length(x) ~= length(y), error(...), end n = length (x) % execute an algorithm for the numerical integration c) Describe the differences in the numerical algorithms and their applications between this problem and the Reimann sum in Problem 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
