Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Car.mat speed is included as the table of time(t) values and velocity(v) values. Please solve thank you Problem 4: MATLAB programming (50 points) The so-called

image text in transcribed
image text in transcribed Car.mat speed is included as the table of time(t) values and velocity(v) values. Please solve thank you
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 T-Square 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 vector 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

Database Design Using Entity Relationship Diagrams

Authors: Sikha Saha Bagui, Richard Walsh Earp

3rd Edition

103201718X, 978-1032017181

More Books

Students also viewed these Databases questions