subject
Mathematics, 14.11.2019 05:31 salgadoj6933

We have encountered the process of interpolation a few times in this course – most recently in lab 9. you may wish to refer back to your team’s work on prior assignments when doing this one, and may reuse code from them if you wish. you will create 2 versions of an interpolation program, and should save these as 2 different files, labeled 2a and 2b.

your team is to create a function that will perform linear interpolation from a set of measured data. the function should take as input a list of values at which samples were taken, and then another list giving the measurements (you can assume each measurement is a single value) at those values. it should also take in a query value, and should give the best estimate it can of the value at that query. be sure to handle values that are outside of the range, by extrapolating.

you should write a program that allows you to test your function by reading the lists from a file where each line of the file is a pair of numbers separated by spaces: the value where the sample was taken, and the measurement at that value. your program should ask the user for the name of the file and for a query value.

important: the two lists will correspond to each other: i. e. for the i-th value in the first list, the measurement will be the i-th element of the second list (these are called parallel lists or arrays). but, you should not assume that the input values are in increasing/decreasing order. that is, the values in the first list can be in any random ordering, not necessarily from smallest to largest or largest to smallest. you will have to account for this in your program, and there is more than one way to do so. as a team, you should discuss what options you can think of to handle the data arriving in any order like that, and decide what you think the best option for handling it is.

extend your program from part (a) so that it will handle not just single values but vector data.

your program should ask a user for a file name, and the number of dimensions, n, of the vector data. it should then read from the file, assuming the values at which measurements are taken are the first entry per line, and then there will be n entries, all space-separated. you may find it easier to store your vector data in numpy arrays.

your interpolation function should return the vector data either using tuples or using arrays from the numpy module.

ansver
Answers: 3

Another question on Mathematics

question
Mathematics, 21.06.2019 14:50
What is f(3) for the quadratic functionf(x)=2x2 + x – 12? f -3g 3h 6i. 9
Answers: 1
question
Mathematics, 21.06.2019 19:00
Use the quadratic formula to solve the equation. if necessary, round to the nearest hundredth. x^2 - 20 = x a. 5, 4 b. -5, -4 c. -5, 4 d. 5, -4
Answers: 2
question
Mathematics, 21.06.2019 19:00
Explain why the factor 1.5 is broke. into two numbers in the model.
Answers: 3
question
Mathematics, 21.06.2019 21:30
On traditional maps, earth is represented in a flat plane, or by euclidean geometry. however, a globe is a more accurate model that comes from elliptical geometry.how does a globe represent the fact that there are no parallel lines in elliptical geometry? the equator is not parallel to any other latitudinal lines. the north and south poles are never connected by a geodesic. the geodesics connecting the north and south poles never intersect. the geodesics connecting the north and south poles intersect at both of the poles.
Answers: 3
You know the right answer?
We have encountered the process of interpolation a few times in this course – most recently in lab 9...
Questions
Questions on the website: 13722363