eng77-spring02-final-unknown-exam

# eng77-spring02-final-unknown-exam - Page 1 of 14 E77N...

This preview shows pages 1–4. Sign up to view the full content.

Page 1 of 14 E77N Final/Name:_______________________________ UNIVERSITY OF CALIFORNIA, COLLEGE OF ENGINEERING E77N: INTRODUCTION TO COMPUTER PROGRAMMING FOR SCIENTISTS AND ENGINEERS Final Exam—May 18, 2002 12:30–3:30 pm TOTAL 100 POINTS Notes: 1. Write your name below and on the top right corner of every page. 2. Check that you have all 14 pages of the test. 3. Please give all your answers only in the spaces provided. 4. You may NOT ask any questions during the exam. 5. Please no cell phones, calculators, or talking during the exam. Your NAME: Your STUDENT ID: Your Signature: For instructor use: 2 3 4 5 6 7 8 9 10 11 12 13 14

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Page 2 of 14 E77N Final/Name:_______________________________ Problem 1 (2 points) In the following table of temperature versus time, readings are missing at 2 and 5 hrs. Write three MATLAB statements that use linear interpolation to estimate the temperature at those two times. Time, hrs 1 2 3 4 5 6 7 Temperature, ˚C 10 ? 18 24 ? 21 20 >> time = >> temp = >> Problem 2 (6 points) The number of twists y required to break a certain rod is a function of the percentage x 1 and x 2 of each of two chemical components present in the rod. Write a MATLAB program that determines coefficients a 0 , a 1 , and a 2 by fitting the data given in the table below to equation y = a 0 + a 1 exp x 1 + a 2 x 2 2 () . Number of twists y 40 51 65 72 38 46 53 67 31 39 48 56 Percentage of component 1 x 1 1 2 3 4 1 2 3 4 1 2 3 4 Percentage of component 2 x 2 1 1 1 1 2 2 2 2 3 3 3 3
Page 3 of 14 E77N Final/Name:_______________________________ Problem 3 (4 points) Given the following MATLAB function function v =velocity(t) v = 2 * t + 1; what will be the result from the following MATLAB commands (a) >> quad('velocity', 0, 1) __________________________ (b) >> diff(velocity([0:2])) __________________________ Problem 4 (3 points) The curve below represents a function y = f ( x ). Show graphically, on the same diagram, how the trapezoidal rule evaluates the integral with the step size of 0.2.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## eng77-spring02-final-unknown-exam - Page 1 of 14 E77N...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online