Question: Write a computer program to fit a straight line y = ax + b to tabulated (x, y) data, assuming that no more than 100

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:

1.0 1.5 y 2.35 5.53 * 2.0 2.5 8.92 12.15 3.0 15.38

1.0 1.5 y 2.35 5.53 * 2.0 2.5 8.92 12.15 3.0 15.38

Step by Step Solution

3.45 Rating (177 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

C DIMENSION X100 Y100 READ 5 1 N N NUMBER OF DATA POINTS 1FORMAT 110 READ ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Document Format (2 attachments)

PDF file Icon

13-E-C-E-C-P (44).pdf

180 KBs PDF File

Word file Icon

13-E-C-E-C-P (44).docx

120 KBs Word File

Students Have Also Explored These Related Chemical Engineering Questions!