.x2 _.ri Output Input Problem Create a function file that calculates the linearl
ID: 3757837 • Letter: #
Question
.x2 _.ri Output Input Problem Create a function file that calculates the linearly interpolated y-value (output) provided an x-value (input). The function should linearly interpolate to find y given any x using the air velocity and thermal resistance data below. Steps 1) This problem could be solved using array operations; but, for practice you are required to use a for- loop: Use a for loop inside this function file that loops through the rows of the data to determines which two rows of the data an input falls between. The row that is the lower bound will become the x1 and y values; the row that is the upper bound will become x2 and y2 2) Calculate y given x, X1, y1, x2, and y2. 3) Test the code by calling this user-defined function inside the for loop of a script for values from 0 to 1700 (air velocity) and plotting the results. 250 Air Thermal Velocity Resistance 200 200 400 600 800 1000 1200 1400 1600 156.1 113.6 93.1 81.5 73.7 67.2 62.4 58.3 55.0 E 150 interpolated value Tabulated values 100 50 Example: 1800 x 480 500 1000 1500 2000 Air Velocity IFPM
Explanation / Answer
CODE :
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.