subject
Engineering, 19.11.2019 00:31 lorelaistudent

You should 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. 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 Engineering

question
Engineering, 03.07.2019 14:10
Explain the difference laminar and turbulent flow. explain it with the shear stress and the velocity profiles.
Answers: 1
question
Engineering, 03.07.2019 19:30
When using the ohmmeter function of a digital multimeter, the leads are placed in what position relative to the component being tested? a. parallel b. control c. series d. line
Answers: 3
question
Engineering, 04.07.2019 18:10
Ajournal bearing has a journal diameter of 3.250 in with a unilateral tolerance of 20.003 in. the bushing bore has a diameter of 3.256 in and a unilateral tolerance of 0.004 in. the bushing is 2.8 in long and supports a 700-lbf load. the journal speed is 900 rev/min. find the minimum oil film thickness and the maximum film pressure for both sae 20 and sae 20w-30 lubricants, for the tightest assembly if the operating film temperature is 160°f. a computer code is appropriate for solving this problem.
Answers: 3
question
Engineering, 04.07.2019 18:10
Slip occurs via two partial dislocations because of (a) the shorter path of the partial dislocation lines; (b) the lower energy state through partial dislocations; (c) the charge balance.
Answers: 1
You know the right answer?
You should create a function that will perform linear interpolation from a set of measured data. the...
Questions
question
Mathematics, 14.01.2021 21:10
question
Mathematics, 14.01.2021 21:10
Questions on the website: 13722362