Final Exam for Computational Methods | AOE 2074, Exams of Aerospace Engineering

Final Exam Material Type: Exam; Professor: Cliff; Class: Computational Methods; Subject: Aerospace and Ocean Engineerin; University: Virginia Polytechnic Institute And State University; Term: Fall 2000;

Typology: Exams

2019/2020

Uploaded on 11/25/2020

koofers-user-mfn
koofers-user-mfn 🇺🇸

4.3

(3)

9 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
AOE/ESM 2074 Introduction to Computational
Methods
Final Exam
9 December 2000
This is a closed-book examination. Please turn in all your work and this
question sheet.
1. (15) Given a = rand(5,5) and b=[1: 5] decide which of
the following are well-defined. For those cases that are well-defined,
what is size(c) ?
i) c=ab
ii) c=a\b
iii) c=1./a
2. (10) Given a Matlab array awith size(a) = [4, 8] provide an ex-
pression for the sub-array consisting of the first and last rows and the
odd-numbered columns of a. For an extra five points, write this so
that it will work for any rectangular array.
3. (15) Provide the necessary Matlab code(s) to approximate the numer-
ical value of the following definite integral
I=π
0
x3cos(x2)dx
4. (15) Apply one step of the bisection method to the problem of finding
a zero of
f(x)=cos(x)xsin(x)
on the interval [0/2]. Note that f(0) = 1 and that f(π/2) = π/2.
1
pf2

Partial preview of the text

Download Final Exam for Computational Methods | AOE 2074 and more Exams Aerospace Engineering in PDF only on Docsity!

AOE/ESM 2074 – Introduction to Computational

Methods

Final Exam

9 December 2000

This is a closed-book examination. Please turn in all your work and this question sheet.

  1. (15) Given a = rand(5,5) and b = [ 1 : 5 ] decide which of the followingare well-defined. For those cases that are well-defined, what is size(c)?

i) c = a′^ ∗ b ii) c = a\b iii) c = 1./a

  1. (10) Given a Matlab array a with size(a) = [4, 8] provide an ex- pression for the sub-array consistingof the first and last rows and the odd-numbered columns of a. For an extra five points, write this so that it will work for any rectangular array.
  2. (15) Provide the necessary Matlab code(s) to approximate the numer- ical value of the followingdefinite integral

I =

∫ (^) π

0

x^3 cos(x^2 ) dx

  1. (15) Apply one step of the bisection method to the problem of finding a zero of f (x) = cos(x) − x ∗ sin(x) on the interval [0, π/2]. Note that f (0) = 1 and that f (π/2) = −π/2.
  1. (15) The Maclaurin expansion of exp(z) is

exp(z) = 1 + z + z^2 2!

z^3 3!

Write a Matlab script .m file so that will ask the user for a value of z (possibly complex), ask the reader for a (positive) tolerance and sum the series until the next term (the first term not included in the sum) becomes smaller (in modulus) than the prescribed tolerance.

  1. (10) Write a function .m file that will accept a real 1 × n array x and return three numbers: the minimum, the maximum and the average. The first line of the function is function [x min, x max, x avg] = mma(x)
  2. (10) A rectangular flat plate is instrumented with thermocouples (tem- perature sensors) to measure the temperature(s) on the plate. The sen- sors are arranged in a regular grid at locations (xı, y) ; ı = 1, 2 ,... , m ,  = 1 , 2 ,... n. The reading(in Celsius) from the sensors have been im- ported in Matlab in an m × n array t. The correspondingarrays for the sensor locations (in meters) are also available as x (1 × m) and y (1 × n). Write a Matlab code segment to generate a surface plot of the temperature. Include commands to label the axes and the plot with appropriate information.
  3. (10) You are given an ascii file that includes many lines of data with comments. Each data line include a time field and a velocity field but the fields may be in any order. That is, lines may look like

time = 123.4, velocity = 456. velocity = 470.2, time = 125.

To capture this information you will use the Matlab fgetl command to assign a line of data to a character array str input. You are to provide a Matlab code segment that will find the word velocity in this array and then find the next equal sign (=). Your code should result in the location within the character array str input that has the desired equal sign. Provide a brief discussion of what each line in your code segment is doing.