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

answer
Answers: 3

Other questions on the subject: Engineering

image
Engineering, 03.07.2019 14:10, makaylashrout77
Amass of 1.5 kg of air at 120 kpa and 24°c is contained in a gas-tight, frictionless piston-cylinder device. the air is now compressed to a final pressure of 720 kpa. during the process, heat is transferred from the air such that the temperature inside the cylinder remains constant. calculate the boundary work input during this process.
Answers: 2
image
Engineering, 04.07.2019 18:10, heidiburgos1own6c0
Fluids at rest possess no flow energy. a)- true b)- false
Answers: 3
image
Engineering, 04.07.2019 18:10, meganwintergirl
Afour cylinder four-stroke in-line engine has a stroke of 160mm, connecting rod length of 150mm, a reciprocating mass of 3kg and its firing order is 1-3-4-2. the spacing between cylinders is 100mm. i. show that the engine is in balance with regard to the primary inertia forces and primary 3. a and secondary inertia couples. li determine the out of balance secondary inertia force ii. propose ways of balancing this out of balance force and discuss the challenges that will arise
Answers: 3
image
Engineering, 04.07.2019 18:10, lillygrl100
For the closed feedwater heater below, feedwater enters state 3 at a pressure of 2000 psia and temperature of 420 °f at a rate of ix10 ibhr. the feedwat extracted steam enters state 1 at a pressure of 1000 psia and enthalpy of 1500 btu/lbm. the extracted er leaves at an enthalpy of 528.7 btu/lbm steam leaves as a saturated liquid. (16) a) determine the mass flow rate of the extraction steam used to heat the feedwater (10) b) determine the terminal temperature difference of the closed feedwater heater
Answers: 3
Do you know the correct answer?
You should create a function that will perform linear interpolation from a set of measured data. the...

Questions in other subjects:

Konu
Mathematics, 12.04.2020 18:52
Konu
History, 12.04.2020 18:54
Konu
Mathematics, 12.04.2020 18:54