Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 4: MATLAB programming (50 points) The so-called coast-down test is used to measure the loss-inducing forces affecting a car. The test simply consists in

image text in transcribed

Problem 4: MATLAB programming (50 points) The so-called "coast-down test" is used to measure the loss-inducing forces affecting a car. The test simply consists in measuring the decrease in the speed v as a function of time t when the car is coasting in neutral. The deceleration can be modeled as where the coefficients c1, c2 and c3 represent the combined effects of aerodynamic drag, rolling resistance and drivetrain frictions The file car_speed.mat (available on Canvas under HW4) contains the results of such a test, in the form of a time vector t (in seconds) and a speed vector v (in miles per hour). 1) Write a completely generic MATLAB function that implements the quadratic polynomial regression technique. The function should have the form function [a,Syx,r] -quad_regression(x,y), where x and y are the data vectors, a is a vector that contains the quadratic polynomial coefficients, Syx is the standard error of the estimate and r is the correlation coefficient. To compute the polynomial coefficients, the function should solve the normal equations in matrix form using the left matrix divide; a loop should NOT be used. The function should plot the data (individual points not connected by lines) as well as the parabola fit (continuous line with at least 100 points over the data range) on the same plot. 2) Write a script called HW4.m that does the following loads the data file car_speed.mat and plot the speed vs. time in Figure 1. Include a title and labels. converts the speed to m/s. uses the centered difference approximation to estimate the deceleration-dv/dt at times t- t(2), t(3),..,(n-1), where n is the number of data points; only vectoir manipulations are allowed and a loop should NOT be used creates 2 vectors of equal length: deceleration and the corresponding velocity calls quad_regression to fit the data and to compute the c coefficients. The function should print the data and the fit together in Figure 2; include a title, labels and a legend prints the c values, the standard error and the correlation coefficient in the command window in a nicely formatted way. * * *

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Demystifying Databases A Hands On Guide For Database Management

Authors: Shiva Sukula

1st Edition

8170005345, 978-8170005346

More Books

Students also viewed these Databases questions

Question

Why We Listen?

Answered: 1 week ago