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

Final Exam_B 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
13 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=ba
ii) c=a\b
iii) c=1./a
2. (15) Provide the necessary Matlab code(s) to approximatley locate the
minimum of the function f(x)=xcos(x)ontheinterval[0,π/2].
3. (15) Apply one step of the bisection method to the problem of finding
a zero of
f(x)=xsin(x)cos(x)
on the interval [0,π/2]. Note that f(0) = 1andthatf(π/2) = π/2.
You do not have to write any Matlab code for this problem.
4. (15) The Maclaurin expansion of exp(z)is
exp(z)=1+z+z2
2! +z3
3! +...
Writ e a M a t l a b s c r i p t .m file 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)
is smaller (in modulus) than the prescribed tolerance.
1
pf2

Partial preview of the text

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

AOE/ESM 2074 – Introduction to Computational

Methods

Final Exam

13 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 = b ∗ a ii) c = a\b′ iii) c = 1./a

  1. (15) Provide the necessary Matlab code(s) to approximatley locate the minimum of the function f (x) = −x cos(x) on the interval [0, π/2].
  2. (15) Apply one step of the bisection method to the problem of finding a zero of f (x) = x ∗ sin(x) − cos(x) on the interval [0, π/2]. Note that f (0) = −1 and that f (π/2) = π/2. You do not have to write any Matlab code for this problem.
  3. (15) The Maclaurin expansion of exp(z) is

exp(z) = 1 + z +

z^2 2!

z^3 3!

Write a Matlab script .m file 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) is smaller (in modulus) than the prescribed tolerance.

  1. (10) Given a Matlab array a with size(a) = [5, 9] provide a single Matlab expression 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. (10) Write a function .m file whose input argument is a one-dimensional array x and output argument consists of 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)
  3. (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 as 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 includingphysical units of the quantities.
  4. (10) You are given an ascii file that includes many lines of data with comments. Each data line include a time field, a density field and a velocity field but the fields may be in any order. That is, lines may look like

time = 123.4, velocity= 456.7, density = 1. velocity = 470.2, , density= 1.18, 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 density 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.