Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
There will be two questions in the second labtest - one from each of the two sections shown below. A few more questions might be added to this list. Section 1 1. Let x be a vector with values ranging from 0 to 2π radians, in 100 equal intervals. Let y1 , y2 and y3 be functions defined as follows: y1 = 150 sin(x) y2 = 2x3 − 4x + 23 y3 = 3x + 2 Plot the three functions y1 , y2 and y3 against x, on the same graph. Give the graph an appropriate title and labels for the x and y axes. Add a boxed legend at the top middle portion of the plot. [3 marks] What is the minimum value of y1 and at what value of x does this occur? For full marks, find this value from the data. [1 mark] Save this script in a file called pq1.m. 2. Let x be a vector with values ranging from 0 to 2π radians, in 100 equal intervals. Let y1 , y2 and y3 be functions defined as follows: y1 = 70 cos(x) y2 = 4x2 + 2x + 5 y3 = 2x + 9 Plot the three functions y1 , y2 and y3 against x, on the same graph. Give the graph an appropriate title and labels for the x and y axes. Add a boxed legend at the top left corner. [3 marks] What is the minimum value of y1 and at what value of x does this occur? For full marks, find this value from the data. [1 mark] Save this script in a file called pq2.m. 3. Let x be a vector with values ranging from 0 to 360 degrees, in increments of 0.5 degrees. Let y1 , y2 and y3 be functions defined as follows: y1 = 50 sin(x) y2 = 40 cos(x)2 + 1 y3 = 60 ∗ 3sin(x) + 2 Plot the three functions y1 , y2 and y3 against x, on the same graph. Give the graph an appropriate title and labels for the x and y axes. Add a boxed legend at the top right portion of the plot. [3 marks] What is the minimum value of y3 and at what value of x does this occur? For full marks, find this value from the data. [1 mark] Save this script in a file named pq4.m. 1 4. The range of a projectile shot from a cannon at an angle θ with respect to the x-axis and an initial velocity of v is given by: R= v2 sin(2θ) g Assuming that g = 9.8m/s2 , and the initial velocity is 100m/s, plot the range of the projectile for values of theta from 0≤θ≤ π 2 in increments of 0.05. Repeat your calculations with an initial velocity of 50m/s. Plot both sets of results on a single graph. Give the graph an appropriate title and labels for the x and y axes. Add a boxed legend at the top right portion of the plot. [3 marks] For the initial velocity of 100m/s, what is the maximum range achieved and at what angle is this achieved? For full marks, find this value from the data. [1 mark] Save this script in a file called pq5.m. 5. The distance traveled by a projectile fired at an angle θ can be broken up into horizontal and vertical distances, as per the following equations: horizontal = vcos(θ)t 1 vertical = vsin(θ)t − gt2 2 where v is the initial velocity, t is the time and g = 9.8m/s2 . Assuming that the initial velocity is 100m/s and the launch angle is 45 degrees, plot the horizonal and vertical distance traveled for times from 0 to 20 seconds, with a spacing of 0.1 second. Plot both sets of results on a single graph. Give the graph an appropriate title and labels for the x and y axes. Add a boxed legend at the top left portion of the plot. [3 marks] What is the maximum vertical distance traveled and at what time did this occur? For full marks, find this value from the data. [1 mark] Save this script in a file called pq6.m. 6. Let x be a vector with values ranging from −π to π radians, in 180 equal intervals. Let y1 , y2 and y3 be functions defined as follows: y1 = 50 sin(x) y2 = 5x2 − x − 50 y3 = 3 tan(x) + 20 Plot the three functions y1 , y2 and y3 against x, on the same graph. Give the graph an appropriate title and labels for the x and y axes. Add an unboxed legend at the bottom right portion of the plot. [3 marks] What is the maximum value of y3 and at what value of x does this occur? For full marks, find this value from the data. [1 mark] Save this script in a file called pq7.m. 2 7. Let x be a vector with values ranging from −π/2 to π radians, in increments of 0.2. Let y1 , y2 and y3 be functions defined as follows: y1 = 60 cos(x) + 30 sin(x) y2 = 12x2 + 2x − 5 y3 = 5x − 15 Plot the three functions y1 , y2 and y3 against x, on the same graph. Give the graph an appropriate title and labels for the x and y axes. Add an unboxed legend at the top left corner. [3 marks] What is the minimum value of y2 and at what value of x does this occur? For full marks, find this value from the data. [1 mark] Save this script in a file called pq8.m. Section 2 1. You are given the following data, which represents the height of the water in a culvert and the flow. You can see that the flow increases with an increase in the height of the water in the culvert. Water Height,f t Flow,f t3 /s 0 1.7 1.95 2.60 2.92 4.04 5.24 0 2.6 3.6 4.03 6.45 11.22 30.61 Compute linear, quadratic and cubic fit for the data using regression techniques and plot them on three different graphs, all on the same figure. Assume that the first column corresponds to the independent variable. Use an appropriate finer interval to create your plots. Mark the original data with green circles. Give appropriate titles and labels for the graph. [4 marks] Which model best represents the data and why? [0.5 marks] Now, use this model to find the value of the flow when the water height is 4.6ft. Print this value of the flow. [1.5 marks] Save this file as a script called nq1.m. 2. You are given the following data for a car trip from Canberra to Melbourne. 3 Time,hrs Distance,kms 0 0.7 1.5 2.0 2.8 3.6 4.0 4.6 5.3 6.1 6.5 0 75 145 225 300 380 430 510 580 635 700 Assume that the first column corresponds to the independent variable. Compute a cubic fit for the data using interpolation techniques - assume an appropriate finer interval for this purpose. Also, find the speed for each segment of the trip. Plot all three on the same graph against time, with the original data being plotted as red circles. Give appropriate titles and labels for the graph. Include a boxed legend. [3.5 marks] Was the speed limit of 110kmph exceeded in any of the segments? If so, which ones and what was the speed? Find this and print the starting distance and speed, for each such segment. [2.5 marks] Save this file as a script called nq3.m. 3. You are given the following data, which is part of the data collected from a three-stage model rocket launch: Time,sec Altitude,m 0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 0 107.37 210.00 307.63 400.00 484.60 550.00 583.97 580.00 549.53 570.00 699.18 850.00 Assume that the first column corresponds to the independent variable. Compute a cubic fit for the data using interpolation techniques - assume an appropriate finer interval for this pupose. Also, find the velocity and acceleration for each interval of the launch. Plot all four on the same graph against time, with the original data being plotted as red circles. Give appropriate titles and labels for the graph. Include a boxed legend. [4 marks] Using the data, estimate the velocity and acceleration at a time of 6.5sec. Display these values. Getting the values directly from the graph will only fetch you half the marks. [2 marks] 4 Save this file as a script called nq4.m. 4. You are given the following data, which represents the resistance and the current in a circuit. Resistance,ohms Current,amps 10 15 25 40 65 100 11.11 8.04 6.03 2.77 1.97 1.51 Compute linear, quadratic and cubic fit for the data using regression techniques and plot them on three different graphs, all on the same figure. Assume that the first column corresponds to the independent variable. Use an appropriate finer interval to create your plots. Mark the original data with magenta circles. Give appropriate titles and labels for the graph. [4 marks] Which model best represents the data and why? [0.5 marks] Now, use this model to find the value of the current when the resistance is 25.63 ohms. Print this value. [1.5 mark] Save this file as a script called nq5.m. 5. You are given the following data, which represents the number of bacteria NB measured at different times t. t(hr) NB 1 2 4 5 7 9 2000 4500 7500 15000 31000 64000 Assume that the first column corresponds to the independent variable. Compute a cubic fit for the data using interpolation techniques. Assume an appropriate finer interval for this purpose. Also, find the rate of growth of the bacteria for each time interval. Plot all three on the same graph against time, with the original data being plotted as red circles. Give appropriate titles and labels for the graph. Include a boxed legend. [3.5 marks] Use this fit to estimate the number of bacteria after 6 hours. Print this value. [1 mark] What was the maximum growth rate and during which time interval was this achieved? Print these values. [1.5 marks] Save this file as a script called nq6.m. 6. The U.S. population between the years 1815 and 1965 is listed below. the current in a circuit. 5 Year Population (millions) 1815 1845 1875 1905 1935 1965 8.3 19.7 44.4 83.2 127.1 190.9 Compute linear, quadratic and cubic fit for the data using regression techniques and plot them on three different graphs, all on the same figure. Assume that the first column corresponds to the independent variable. Use an appropriate finer interval to create your plots. Mark the original data with blue circles. Give appropriate titles and labels for the graph. [4 marks] Which model best represents the data and why? Now, use this model to estimate the population in the year 1915. Print this value. Save this file as a script called nq7.m. 6 [0.5 marks] [1.5 mark]