Write a computer program to fit a straight line y = ax + b to tabulated (x,

Question:

Write a computer program to fit a straight line y = ax + b to tabulated (x, y) data, assuming that no more than 100 data points will be taken in any one run. Your program should read in and store the data, evaluate the slope a and intercept b of the best line through the data using Equations A.1-3 through A. 1-5 in Appendix A, then print out the measured values of x and y and calculated values of y (= ax + b) for each tabulated value of x. Test your program by fitting a line to the data in the following table:

image

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Elementary Principles of Chemical Processes

ISBN: 978-0471720638

3rd Edition

Authors: Richard M. Felder, Ronald W. Rousseau

Question Posted: