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 15:10
What is 20+(5 x 2/5 )+ 3 show your work
Answers: 2
question
Mathematics, 21.06.2019 19:30
Zoey made 5 1/2 cups of trail mix for a camping trip. she wants to divide the trail mix into 3/4 cup servings. a. ten people are going on the trip. can zoey make enough 3/4 cup servings so that each person gets one serving? b. what size would the servings need to be for everyone to have a serving?
Answers: 1
question
Mathematics, 21.06.2019 20:00
Elizabeth is using a sample to study american alligators. she plots the lengths of their tails against their total lengths to find the relationship between the two attributes. which point is an outlier in this data set?
Answers: 1
question
Mathematics, 21.06.2019 21:00
Finding tbe values of the variables in each kite
Answers: 1
You know the right answer?
We have encountered the process of interpolation a few times in this course – most recently in lab 9...
Questions
question
Mathematics, 22.10.2020 01:01
question
Mathematics, 22.10.2020 01:01
question
English, 22.10.2020 01:01
question
Physics, 22.10.2020 01:01
Questions on the website: 13722359