'XNH8QLYHUVLW\ (GPXQG73UDWW-U6FKRRORI(QJLQHHULQJ. EGR 53L Fall Test III. Rebecca A. Simmons & Michael R. Gustafson II

Similar documents
'XNH8QLYHUVLW\ (GPXQG73UDWW-U6FKRRORI(QJLQHHULQJ. EGR 103L Fall Test 2. Michael R. Gustafson II

'XNH8QLYHUVLW\ (GPXQG73UDWW-U6FKRRORI(QJLQHHULQJ. EGR 103L Fall Test 2 Solutions. Michael R. Gustafson II

'XNH8QLYHUVLW\ (GPXQG73UDWW-U6FKRRORI(QJLQHHULQJ. EGR 53L Fall Test I. Rebecca A. Simmons & Michael R. Gustafson II

'XNH8QLYHUVLW\ (GPXQG73UDWW-U6FKRRORI(QJLQHHULQJ. EGR 224 Spring Test II. Michael R. Gustafson II

'XNH8QLYHUVLW\ (GPXQG73UDWW-U6FKRRORI(QJLQHHULQJ. ECE 110 Fall Test II. Michael R. Gustafson II

'XNH8QLYHUVLW\ (GPXQG73UDWW-U6FKRRORI(QJLQHHULQJ. EGR 224 Spring Test II. Michael R. Gustafson II

Test II Michael R. Gustafson II

Test 2 Solutions - Python Edition

'XNH8QLYHUVLW\ (GPXQG73UDWW-U6FKRRORI(QJLQHHULQJ. ECE 110 Fall Test I. Michael R. Gustafson II

Test 2 - Python Edition

Lynch 2017 Page 1 of 5. Math 150, Fall 2017 Exam 1 Form A Multiple Choice

Without fully opening the exam, check that you have pages 1 through 11.

STUDENT NAME: STUDENT SIGNATURE: STUDENT ID NUMBER: SECTION NUMBER RECITATION INSTRUCTOR:

MAT 107 College Algebra Fall 2013 Name. Final Exam, Version X

STUDENT NAME: STUDENT SIGNATURE: STUDENT ID NUMBER: SECTION NUMBER AND RECITATION INSTRUCTOR:

Student s Printed Name:

Without fully opening the exam, check that you have pages 1 through 11.

MA Final Exam - Version 01 Fall 2015 VERSION 01

MA EXAM 1 INSTRUCTIONS VERSION 01 September 13, Section # and recitation time

MTH 234 Exam 1 February 20th, Without fully opening the exam, check that you have pages 1 through 11.

Practice A Exam 3. November 14, 2018

Least squares regression

Without fully opening the exam, check that you have pages 1 through 11.

Student s Printed Name: KEY_&_Grading Guidelines_CUID:

ENGR Spring Exam 2

MA 262, Fall 2017, Final Version 01(Green)

Curve Fitting and Interpolation

Please print the following information in case your scan sheet is misplaced:

MA FINAL EXAM Green May 5, You must use a #2 pencil on the mark sense sheet (answer sheet).

MA EXAM 2 INSTRUCTIONS VERSION 01 March 9, Section # and recitation time

Companion. Jeffrey E. Jones

Student s Printed Name: _Key

Chapter 7 Statistics, Probability, and Interpolation

Without fully opening the exam, check that you have pages 1 through 11.

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. C) x 8. C) y = x + 3 2

Hour Exam #2 Math 3 Oct. 31, 2012

Lab 13: Ordinary Differential Equations

Lynch, October 2016 Page 1 of 5. Math 150, Fall 2016 Exam 2 Form A Multiple Choice Sections 3A-5A

Math 1310 Final Exam

Student s Printed Name: _Key_& Grading Guidelines CUID:

MA EXAM 2 INSTRUCTIONS VERSION 01 March 10, Section # and recitation time

Math 101 Fall 2006 Exam 1 Solutions Instructor: S. Cautis/M. Simpson/R. Stong Thursday, October 5, 2006

MAT300/500 Programming Project Spring 2019

Course: Math 111 Pre-Calculus Summer 2016

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. B) 6x + 4

Version B QP1-14,18-24, Calc ,App B-D

INSTRUCTIONS USEFUL FORMULAS

MTH 133 Exam 2 November 16th, Without fully opening the exam, check that you have pages 1 through 12.

MA FINAL EXAM Form A MAY 1, 2017

Without fully opening the exam, check that you have pages 1 through 12.

MthSc 107 Test 1 Spring 2013 Version A Student s Printed Name: CUID:

Page Points Score Total: 100

I have read and understood the instructions regarding academic dishonesty:

MISSOURI SOUTHERN STATE UNIVERSITY COURSE SYLLABUS

Test 2 - Answer Key Version A

Exam 2. Average: 85.6 Median: 87.0 Maximum: Minimum: 55.0 Standard Deviation: Numerical Methods Fall 2011 Lecture 20

Without fully opening the exam, check that you have pages 1 through 10.

STUDENT NAME: STUDENT SIGNATURE: STUDENT ID NUMBER: SECTION NUMBER RECITATION INSTRUCTOR:

Section 2.5 from Precalculus was developed by OpenStax College, licensed by Rice University, and is available on the Connexions website.

Mark Howell Gonzaga High School, Washington, D.C.

MA EXAM 1 Form A February 4, You must use a #2 pencil on the mark sense sheet (answer sheet).

MTH 132 Solutions to Exam 2 November 21st, Without fully opening the exam, check that you have pages 1 through 11.

STUDENT NAME: STUDENT SIGNATURE: STUDENT ID NUMBER: SECTION NUMBER AND RECITATION INSTRUCTOR:

11 /2 12 /2 13 /6 14 /14 15 /8 16 /8 17 /25 18 /2 19 /4 20 /8

MATH 251 Final Examination December 16, 2015 FORM A. Name: Student Number: Section:


COURSE OUTLINE CHAFFEY COLLEGE

MA FINAL EXAM Green December 16, You must use a #2 pencil on the mark sense sheet (answer sheet).

THE USE OF CALCULATORS, BOOKS, NOTES ETC. DURING THIS EXAMINATION IS PROHIBITED. Do not write in the blanks below. 1. (5) 7. (12) 2. (5) 8.

Outline. 1 The Role of Functions. 2 Polynomial Functions. 3 Power Functions. 4 Rational Functions. 5 Exponential & Logarithmic Functions

Math 365 Homework 5 Due April 6, 2018 Grady Wright

MATH COURSE TITLE: College Algebra

MTH 234 Exam 2 November 21st, Without fully opening the exam, check that you have pages 1 through 12.

MTH 133 Solutions to Exam 2 April 19, Without fully opening the exam, check that you have pages 1 through 12.

Without fully opening the exam, check that you have pages 1 through 11.

MTH 132 Exam 2 November 21st, Without fully opening the exam, check that you have pages 1 through 11.

College Physics 201 Graphing Review and Analysis

MA Exam 1 Fall 2015 VERSION 01

Math 125 Final Examination Spring 2015

Project 2: Using linear systems for numerical solution of boundary value problems

MAT 171. August 22, S1.4 Equations of Lines and Modeling. Section 1.4 Equations of Lines and Modeling

University of British Columbia Math 307, Final

Chapter 3 Prerequisite Skills. Chapter 3 Prerequisite Skills Question 1 Page 148. a) Let f (x) = x 3 + 2x 2 + 2x +1. b) Let f (z) = z 3 6z 4.

Math 42: Fall 2015 Midterm 2 November 3, 2015

Lynch 2017 Page 1 of 5. Math 150, Fall 2017 Exam 2 Form A Multiple Choice

Math 227 Sample Final Examination 1. Name (print) Name (sign) Bing ID number

MA162 EXAM III SPRING 2017 APRIL 11, 2017 TEST NUMBER 01 INSTRUCTIONS:

Test 3 - Answer Key Version B

Test 2 Version B. On my honor, I have neither given nor received inappropriate or unauthorized information at any time before or during this test.

Final Exam Practice Problems Part II: Sequences and Series Math 1C: Calculus III

Without fully opening the exam, check that you have pages 1 through 13.

Test 2 - Answer Key Version A

Exponential Growth And Decay Word Problems Answers

Problem Weight Total 100

POLYNOMIAL FUNCTIONS. Chapter 5

MAT 114 Fall 2015 Print Name: Departmental Final Exam - Version X

Review questions for Math 111 final. Please SHOW your WORK to receive full credit Final Test is based on 150 points

Sample Questions PREPARING FOR THE AP (AB) CALCULUS EXAMINATION. tangent line, a+h. a+h

Student s Printed Name:

Version A QP1-14,18-24, Calc ,App B-D

Transcription:

'XNH8QLYHUVLW\ (GPXQG73UDWW-U6FKRRORI(QJLQHHULQJ EGR 53L Fall 2008 Test III Rebecca A. Simmons & Michael R. Gustafson II Name (please print) In keeping with the Community Standard, I have neither provided nor received any assistance on this test. I understand if it is later determined that I gave or received assistance, I will be brought before the Undergraduate Judicial Board and, if found responsible for academic dishonesty or academic contempt, fail the class. I also understand that I am not allowed to speak to anyone except the instructor about any aspect of this test until the instructor announces it is allowed. I understand if it is later determined that I did speak to another person about the test before the instructor said it was allowed, I will be brought before the Undergraduate Judicial Board and, if found responsible for academic dishonesty or academic contempt, fail the class. Signature: Problem I: [15 pts.] Basic Derivatives and Integrals Assume you have taken a set of eight data points: x x 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 y y 1 y 2 y 3 y 4 y 5 y 6 y 7 y 8 Using the method specified (or, if unspecified, the most precise method discussed in class), (Note - if evenly spaced, x = x i+1 x i for any i) (a) Assuming the points are evenly spaced, show the equation to calculate dy (b) Assuming the points are evenly spaced, show the equation to calculate dy y 6 y 4 dx 2 x x=x5 y 6 4y 7+3y 8 dx 2 x x=x8 (c) Assuming the points are evenly spaced, y show the equation to calculate d2 y x=x1 3 2y 2+y 1 dx 2 ( x) 2 (d) Assuming the points are evenly spaced, y show the equation to calculate d2 y x=x6 7 2y 6+y 5 dx 2 ( x) 2 (e) Assuming the points are evenly spaced, show the equation to calculate x 8 x 1 y(χ) dχ (f) Show the equation to calculate dy dx x=x4 using two-point forward differences (g) Show the equation to calculate dy using two-point backward differences dx x=x4 x 3 (y 1 + 4y 2 + 2y 3 + 4y 4 + y 5 ) + 3 x 8 (y 5 + 3y 6 + 3y 7 + y 8 ) y 5 y 4 x 5 x 4 y 4 y 3 x 4 x 3

Name (please print): Community Standard (print ACPUB ID): Problem II: [20 pts.] An Engineering Career In Modeling Gerald Recktenwald s book Numerical Methods with MATLAB: Implementation and Application has a problem with data from a book by Eckert and Drake (Analysis of Heat and Mass Transfer) that relates the surface tension of water (σ) to the temperature of the water (T). A part of this table is shown below: T ( C) 0 10 20 30 40 50 σ (mn/m) 78.2 74.8 73.4 71.6 70.2 68.5 Your job is to use MATLAB with three different models to estimate the surface tension when T is 25 C by determining the best set of coefficients for each model then calculating the estimate with those coefficients. The models to be considered are: quadratic: σ = f + gt + ht 2 (1) exponential: σ = me nt (2) bi-exponential: σ = qe (T/30) + re (T/50) + s (3) Write the entire MATLAB code that you could use to determine the coefficients f, g, h, m, n, q, r, and s as well as the estimate for σ(t) when T=25 C for each model. When your code is done, there must be variables that are clearly named as each of the different coefficients (i.e. a variable named f, a variable named g, etc) as well as three estimates with variable names that clearly indicate which model was used to calculate the estimate. For the exponential, you must use the method that gives you the highest coefficient of determination. For the bi-exponential, you must use linear algebra. %% Initial work clear; format short e T = [ 0 10 20 30 40 50 ] sigma = [78.2 74.8 73.4 71.6 70.2 68.5] ; %% Get coefficients and estimates for each model % Quadratic QCoefs = polyfit(t, sigma, 2) f = QCoefs(3), g = QCoefs(2), h = QCoefs(1) QEst = polyval(qcoefs, 25) % Exponential - use nonlinear to get highest r^2 ExpEqn = @(coefs, T) coefs(1)*exp(coefs(2)*t) fssr = @(coefs, T, sigma) sum((sigma - ExpEqn(coefs, T)).^2) ExpCoefs = fminsearch(@(coefs) fssr(coefs, T, sigma), [80, -1]) m = ExpCoefs(1), n = ExpCoefs(2) ExpEst = ExpEqn(ExpCoefs, 25) % Bi-exponential BiEqn = @(coefs, T) coefs(1)*exp(-t/30) + coefs(2)*exp(-t/50) + coefs(3)*t.^0 A = [exp(-t/30) exp(-t/50) T.^0] BiCoefs = A\sigma q = BiCoefs(1), r = BiCoefs(2), s = BiCoefs(3) BiEst = BiEqn(BiCoefs, 25)

Name (please print): Community Standard (print ACPUB ID): Problem III: [20 pts.] Hot Or Not? In Chapter 7 of the Palm book, a problem has a data table of the temperature of water flowing out of a faucet after the hot tap has been turned on. The data below shows the change in temperature from time 0: By hand: t (sec) 0 1 2 3 4 5 6 7 8 9 10 T ( F) 0 5.6 13.9 19.8 38.1 39.0 36.8 37.7 38.0 37.4 37.7 (1) Use nearest-neighbor interpolation to estimate the temperature difference when t=5.25 seconds. T 5.25 T 5 = 39.0 (2) Use piecewise-linear interpolation to estimate the temperature difference when t=7.8 seconds. T 7.8 T 7 + T 8 T 7 8 7 38 37.7 (t 7) = 37.7 + (7.8 7) = 37.94 8 7 (3) Determine a quadratic interpolating equation that gives the temperature change T as a function of the time t for times between 8 sec and 10 sec. Use it to estimate the temperature difference when t=9.5 seconds. ˆT(t) = T 8 + T T10 T9 9 T 8 8 t 10 9 8 (t 8) + 10 8 10 9 T9 T8 9 8 (t 8)(t 9) 37.7 37.4 1 37.4 38.0 37.4 38.0 1 ˆT(t) = 38.0 + (t 8) + (t 8)(t 9) 1 2 ˆT(t) = 38.0 + ( 0.6)(t 8) + (0.45)(t 8)(t 9) = 0.45t 2 8.25t + 75.2 ˆT(9.5) = 37.438

Using MATLAB: (a) Determine the coefficients of a quadratic interpolating polynomial that gives the temperature change T as a function of the time t for times between 0 sec and 2 sec. Call this coefficient matrix Coefs02quad. Use these coefficients to estimate the temperature difference when t=1.8 seconds and call this TempAt1p8 (b) Also, use this interpolation to find the time at which the temperature difference is 10 F. Call this time10. (c) Since the temperature difference starts at 0 and grows asymptotically towards a constant, a saturationgrowth model might be an accurate model for the temperature difference: ˆT(t) = T max t k + t Write the MATLAB code you would use to find T max and k using linear regression with a transformation of variables. %% Initial work clear; format short e t = [0 1 2 3 4 5 6 7 8 9 10] ; T = [0.0 5.6 13.9 19.8 38.1 39.0 36.8 37.7 38.0 37.4 37.7] ; %% (a) Coefs02quad = polyfit(t(1:3), T(1:3), 2) TempAt1p8 = polyval(coefs02quad, 1.8) %% (b) time10 = fzero(@(td) polyval(coefs02quad, td)-10, [0 2]) %% (c) P = polyfit(1./t(2:end), 1./T(2:end), 1) Tmax = 1/P(2) k = P(1)/P(2)

Name (please print): Community Standard (print ACPUB ID): Problem IV: [25 pts.] How Many Points Must An Integral Use Before We Increase The Span? In order to save money, researchers working on signal processing want to see how fast they have to sample data in order to get accurate integrals using the Trapezoidal Rule. To do this, they model the signal they are measuring as: f(t) = cos(100t) + cos(200t) + cos(400t) The function of the integral, taken as the integration from time 0 to time t, is therefore: F(t) = t They want you to write a program that does the following: 0 f(τ) dτ = 1 100 sin(100t) + 1 200 sin(200t) + 1 400 sin(400t) (a) Asks the user for a starting number of data points to consider. This number must be an integer 2 or greater. Your program should make sure it is both an integer and 2 or greater; should either test fail, your program must keep asking until a valid number is entered. (b) Asks the user for a maximum possible number of points to consider. This number must be an integer larger than the number entered above. Should either test fail, your program must keep asking until a valid number is entered. (c) Your program should then use the smallest number of points specified above and create a time base using that many points over the span of one second. It should then calculate the analytical value of the integral at each of those points using the function above as well as the estimated values of the integral at those same points using the Trapezoidal Rule. It should calculate a coefficient of determination to see how well the estimates match the actual values at those points. (d) If the coefficient of determination is above 0.99, the program should state that it successfully calculated the required number of points, print out that number and the value of the coefficient of determination, and end. Otherwise, it should increase the number of points and try again. It should continue this until it has found a number of points that produces the required coefficient of determination or it exceeds the maximum number of points specified by the user. In the latter case, the program should print a message stating Required accuracy not reached and then end. Here are some sample runs of the program: Positive integer: -2 Integer greater than 1, PLEASE: 10 Larger positive integer: 8 Integer greater than previous integer, PLEASE: -2 Integer greater than previous integer, PLEASE: 20 Required accuracy not reached Positive integer: 100 Larger positive integer: 500 Accuracy reached! Coefficient of determination is 0.990068 when using 190 points

%% (a) Nlow = input( Positive integer: ); while Nlow<2 (floor(nlow)~=nlow) Nlow = input( Integer greater than 1, PLEASE: ); end %% (b) Nhi = input( Larger positive integer: ); while Nhi<Nlow (floor(nhi)~=nhi) Nhi = input( Integer greater than previous integer, PLEASE: ); end %% (c) and (d) N = Nlow; r2 = 0; while N<(Nhi+1) & r2<0.99 t = linspace(0, 1, N); f = cos(100*t)+cos(200*t)+cos(400*t); Festimate = cumtrapz(t, f); Factual = 1/100*sin(100*t)+1/200*sin(200*t)+1/400*sin(400*t); St = sum((factual - mean(factual)).^2); Sr = sum((factual - Festimate).^2); r2 = (St - Sr) / St; N = N + 1; end if r2>0.99 fprintf( Accuracy reached!\n ) fprintf( Coefficient of determination is %f when using %d points\n, r2, N-1) else fprintf( Required accuracy not reached\n ) end

Name (please print): Community Standard (print ACPUB ID): Problem V: [20 pts.] Déjà Vu Again A couple researchers take data of fluid flow in a concrete pipe given various pipe diameters and slopes and come up with the following data 1 Diameter (D, m) 0.3 0.6 0.9 0.3 0.6 0.9 0.3 0.6 0.9 Slope (S, m/m) 0.001 0.001 0.001 0.010 0.010 0.010 0.050 0.050 0.050 Flow (Q, m 3 /s) 0.04 0.24 0.69 0.13 0.82 2.38 0.31 1.95 5.66 One of their graduate students comes up with the following model for...wait...wrong test. Instead: (a) Show the MATLAB code you would use to make an interpolated surface plot, with contours, of the flow as a function of the diameter and the slope. You should have 20 points in the D direction and 30 points in the S direction. Use piecewise cubic Hermite spline 2 interpolation to generate the values for the surface. You should also have axis labels, but do not need a title. (b) The more accurate model from Test II, using powers, can be generalized to Q = ad b S c This is a nonlinear fit, but could be linearized using natural logs: ln(q) = ln(a) + b ln(d) + c ln(s) Show all the MATLAB code you would use to determine a, b, and c. (c) Show the MATLAB code to determine the coefficient of determination for this model given those coefficients. (d) Finally, using MATLAB, you might determine that: Was this model any good? Here is a start to the codes from above: S r = 3.6037e 03 S t = 2.6231e + 01 clear; format short e D = [0.300, 0.600, 0.900; 0.300, 0.600, 0.900; 0.300, 0.600, 0.900] S = [0.001, 0.001, 0.001; 0.010, 0.010, 0.010; 0.050, 0.050, 0.050] Q = [0.040, 0.240, 0.690; 0.130, 0.820, 2.380; 0.310, 1.950, 5.660] 1 Applied Numerical Methods with MATLAB, p. 233. Steven Chapra. McGraw-Hill, 2005 2 turns out that pchip is not a valid option for interp2; credit will give given on the test, of course

%% (a) [Dm, Sm] = meshgrid(linspace(min(d(:)), max(d(:)), 20),... linspace(min(s(:)), max(s(:)), 30)); Qm = interp2(d, S, Q, Dm, Sm, spline ); surfc(dm, Sm, Qm) xlabel( D ), ylabel( S ), zlabel( Q ) %% (b) %%% Nonlinear version: Qeqn = @(coefs, D, S) coefs(1).*(d.^coefs(2)).*(s.^(coefs(3))); fssr = @(coefs, D, S, Q) sum(sum((q-qeqn(coefs, D, S)).^2)) NonlinCoefs = fminsearch(@(coefs) fssr(coefs, D, S, Q), [1, 1, 1]) a = NonlinCoefs(1), b = NonlinCoefs(2), c = NonlinCoefs(3) %%% Linear version: Qeqn = @(coefs, D, S) coefs(1).*(d.^coefs(2)).*(s.^(coefs(3))); A = [D(:).^0 log(d(:)) log(s(:))] LinCoefs = A\log(Q(:)) a = exp(lincoefs(1)), b = LinCoefs(2), c = LinCoefs(3) %% (c) Depends on method used Qhat = Qeqn([a b c], D, S) % Can be NonlinCoefs instead of [a b c] St = sum((q(:)-mean(q(:))).^2) Sr = sum((q(:)-qhat(:)).^2) r2 = (St - Sr) / St