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, 04.07.2019 08:10
Which of the following is an easy way to remember the modified “x” tire rotation? a. nondrive wheels straight, cross the drive wheels b. drive wheels straight, cross the nondrive wheels c. drive wheels crossed, nondrive wheels straight d. drive wheels crossed, nondrive wheels crossed
Answers: 1
question
Engineering, 04.07.2019 19:20
Determine the time of the day and month of the year at which the peak sensible cooling load occurs for a top floor, north-eastern corner room of an office building in durban for the following conditions: floor area: 8 x 8 x 3 m east and north walls: 115 mm face brick (outside), 20 mm air space, 115 mm ordinary brick (inside) with 15 mm plaster roof construction: suspended plasterboard ceiling, 450 mm air space, 150 mm concrete, 75mm screed, waterproofing no heat transfer across other surfaces window area 3x 1,5 m high in north wall only. ordinary glass with venetian blinds. lights and occupants : from 07: 00 to 18: 00 average light density: 25 w/m2 number of occupants : 5 seated, light office work room temperature 24°c
Answers: 3
question
Engineering, 06.07.2019 03:20
What is the maximum height from which a mass of 30 kg can fall on to a flange on the lower end of a vertical rod of length 1.0 m and diameter 20 mm, the upper end being rigidly fixed, if the stress in the rod is not to exceed 80 mpa? the tensile modulus of the rod is 200 gpa.
Answers: 3
question
Engineering, 06.07.2019 03:20
Major ingredients of traditional ceramics (a) silica (b) clay (c) feldspar (d) all
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
Physics, 12.04.2021 03:40
question
English, 12.04.2021 03:40
question
Health, 12.04.2021 03:50
question
Mathematics, 12.04.2021 03:50
Questions on the website: 13722362