1 1 2 73% + LA O Project 6.3.1. (Regression Analysis) A researcher needs to compute resistence of coper wire under extre
Posted: Sat May 14, 2022 4:07 pm
here it is again
1 1 2 73% + LA O Project 6.3.1. (Regression Analysis) A researcher needs to compute resistence of coper wire under extremely low temperature conditions. Resistence y and the temperature x are expected to y be related by a linear equation of the form y = mx + b (whose graph is a straight line), where the constants m and b depend on the material, and they are unknown for coper. To determine these constants, the researcher measured the resistances of coper at various temperatures and obtained the following data: Temperature x (°C) Resistance y (Ohms) 20.0 761 31.5 817 35.5 805 874 71.8 917 81.1 910 91.3 1018 93.5 1025 50.0 When plotted, these pairs of numbers do not fall on a perfect straight line due to errors in the data. Therefore, he decided to find the straight line that best fits the data by using the "Least Squares Method" (in which m and b are determined so that the sum of the squares of the deviations of the observed y values from the predicted y values is minimized). It can be mathematically proved that the m and b for the best fitting straight line found by applying “Least Squares Method" are given by (Σxy)-(Σx)Υ slope m= (Σx2)-(Σx)X y-intercept b = Y-mX where Exy is, for example, the sum of the multiples of all the x and y values, The X and the Y are the averages of the x values and the y values respectively. The researcher needs to find the resistance of the coper wire at every integer temperature from 10°C down to -5°C. Write a program that computes the best fitting straight line for the data and uses it to compute the resistances at the required temperatures. Conform your program to the following guidelines: (1) Use C++ statements to obtain the data from the user one pair at a time, and to store them in two different arrays. Program must be written to work for any number of data up to 15. In other words, assume that the number of data is unknown, but there will never be more than 15 pairs of data. Use some sentinel to identify the end of data. Make sure to let the user know what the sentinel is. (2) There must be a comment block that explains what the program finds and displays your name as the programmer's name.
(3)Output must show the linear equation that fits the data and the resistances at the temperatures 10°C, 9°C,8°C,...,-5°C as a two column report. (4) There must be a title for each column of the output. (5) Your program must be as efficient as possible (that is, the amount of computer work must be at minimum). When the program works, run it and enter the data given above. Turn in a screenshot of your program and the output together. Additional Explanation In case you didn't know, the symbol 2 means “Sum of". So, Ex is sum of all the temperatures. Symbol X represents average of all the temperatures. Symbol Y represents the average of the resistances. After getting and storing the data (values of x's and y's) in two arrays, you need to find all the necessary sums. Then use the formula for m to find it's value. This is the slope of the best fitting line through all the points (x, y) on the coordinate plane. The y-intercept of the line is = Y-mX, where X and Y are the averages described above. Once you have computed the slope m and the y intercept b of the best fitting line, you have the equation of that line: y = mx + b. Using this equation, we can find the resistances of the copper at the temperatures we desire by plugging them in for x in the equation y = mx +b and computing y. For this part, use a for loop that varies x from 10,9, 8.....,-5, and computes y by using the formula y = mx + b and writes it.
(3)Output must show the linear equation that fits the data and the resistances at the temperatures 10°C, 9°C,8°C,...,-5°C as a two column report. (4) There must be a title for each column of the output. (5) Your program must be as efficient as possible (that is, the amount of computer work must be at minimum). When the program works, run it and enter the data given above. Turn in a screenshot of your program and the output together. Additional Explanation In case you didn't know, the symbol means “Sum of". So, Xx is sum of all the temperatures. Symbol X represents average of all the temperatures. Symbol Y represents the average of the resistances. After getting and storing the data (values of x's and y's) in two arrays, you need to find all the necessary sums. Then use the formula for m to find it's value. This is the slope of the best fitting line through all the points (x, y) on the coordinate plane. The y-intercept of the line is = Y-mX, where X and Y are the averages described above. Once you have computed the slope m and the y intercept b of the best fitting line, you have the equation of that line: y = mx + b. Using this equation, we can find the resistances of the copper at the temperatures we desire by plugging them in for x in the equation y = mx + b and computing y. For this part, use a for loop that varies x from 10,9,8....,-5, and computes y by using the formula y = mx + b and writes it.
1 1 2 73% + LA O Project 6.3.1. (Regression Analysis) A researcher needs to compute resistence of coper wire under extremely low temperature conditions. Resistence y and the temperature x are expected to y be related by a linear equation of the form y = mx + b (whose graph is a straight line), where the constants m and b depend on the material, and they are unknown for coper. To determine these constants, the researcher measured the resistances of coper at various temperatures and obtained the following data: Temperature x (°C) Resistance y (Ohms) 20.0 761 31.5 817 35.5 805 874 71.8 917 81.1 910 91.3 1018 93.5 1025 50.0 When plotted, these pairs of numbers do not fall on a perfect straight line due to errors in the data. Therefore, he decided to find the straight line that best fits the data by using the "Least Squares Method" (in which m and b are determined so that the sum of the squares of the deviations of the observed y values from the predicted y values is minimized). It can be mathematically proved that the m and b for the best fitting straight line found by applying “Least Squares Method" are given by (Σxy)-(Σx)Υ slope m= (Σx2)-(Σx)X y-intercept b = Y-mX where Exy is, for example, the sum of the multiples of all the x and y values, The X and the Y are the averages of the x values and the y values respectively. The researcher needs to find the resistance of the coper wire at every integer temperature from 10°C down to -5°C. Write a program that computes the best fitting straight line for the data and uses it to compute the resistances at the required temperatures. Conform your program to the following guidelines: (1) Use C++ statements to obtain the data from the user one pair at a time, and to store them in two different arrays. Program must be written to work for any number of data up to 15. In other words, assume that the number of data is unknown, but there will never be more than 15 pairs of data. Use some sentinel to identify the end of data. Make sure to let the user know what the sentinel is. (2) There must be a comment block that explains what the program finds and displays your name as the programmer's name.
(3)Output must show the linear equation that fits the data and the resistances at the temperatures 10°C, 9°C,8°C,...,-5°C as a two column report. (4) There must be a title for each column of the output. (5) Your program must be as efficient as possible (that is, the amount of computer work must be at minimum). When the program works, run it and enter the data given above. Turn in a screenshot of your program and the output together. Additional Explanation In case you didn't know, the symbol 2 means “Sum of". So, Ex is sum of all the temperatures. Symbol X represents average of all the temperatures. Symbol Y represents the average of the resistances. After getting and storing the data (values of x's and y's) in two arrays, you need to find all the necessary sums. Then use the formula for m to find it's value. This is the slope of the best fitting line through all the points (x, y) on the coordinate plane. The y-intercept of the line is = Y-mX, where X and Y are the averages described above. Once you have computed the slope m and the y intercept b of the best fitting line, you have the equation of that line: y = mx + b. Using this equation, we can find the resistances of the copper at the temperatures we desire by plugging them in for x in the equation y = mx +b and computing y. For this part, use a for loop that varies x from 10,9, 8.....,-5, and computes y by using the formula y = mx + b and writes it.
(3)Output must show the linear equation that fits the data and the resistances at the temperatures 10°C, 9°C,8°C,...,-5°C as a two column report. (4) There must be a title for each column of the output. (5) Your program must be as efficient as possible (that is, the amount of computer work must be at minimum). When the program works, run it and enter the data given above. Turn in a screenshot of your program and the output together. Additional Explanation In case you didn't know, the symbol means “Sum of". So, Xx is sum of all the temperatures. Symbol X represents average of all the temperatures. Symbol Y represents the average of the resistances. After getting and storing the data (values of x's and y's) in two arrays, you need to find all the necessary sums. Then use the formula for m to find it's value. This is the slope of the best fitting line through all the points (x, y) on the coordinate plane. The y-intercept of the line is = Y-mX, where X and Y are the averages described above. Once you have computed the slope m and the y intercept b of the best fitting line, you have the equation of that line: y = mx + b. Using this equation, we can find the resistances of the copper at the temperatures we desire by plugging them in for x in the equation y = mx + b and computing y. For this part, use a for loop that varies x from 10,9,8....,-5, and computes y by using the formula y = mx + b and writes it.