Answered step by step
Verified Expert Solution
Question
1 Approved Answer
CS101-2020 > HW 13 > Linear data fitting O solutions submitted (max: Unlimited) As a preliminary investigation for the release of a top-secret project, your
CS101-2020 > HW 13 > Linear data fitting O solutions submitted (max: Unlimited) As a preliminary investigation for the release of a top-secret project, your company has asked you to determine the spring constants for a collection of reference springs. Fortunately, the measurements have already been carried out and you have only to interpret them. Recall that spring displacement is governed by Hooke's law, F = -K X where x is the observed displacement and F is the corresponding required force. It is experimentally convenient to use mass (m) to generate the required force (F) using gravity (g). These variables are related by: F = m/1000 *g where mis mass in grams and g is acceleration due to gravity. Thus the spring constant k may be determined from the experimental data as the slope of the line fitting displacement and force data. The data are recorded in the format [mx]; that is, the mass (m) in the first column and the displacement (x) observed in the second. Compose a function 'fit_spring which accepts an array of data in this format and returns the corresponding spring constant k. Use g=9.81. ***NOTE: We assumed that the intercept is 0 but it might not. If you want an accurate answer with an intercept at 0, you will need to use other matlab functions (like fit or nlinfit or others). For our purpose, polyfit is sufficient
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started