Linear Equations - Computational Science - Exam, Exams of Computational Physics

This is the exam of Computational Science and its key important points are: Linear Equations, Acceleration Due to Gravity, Single Matrix Equation, Matlab Function, Division of Matrices, Standard Error, Function of Time, Logical Operations, Differential Equation

Typology: Exams

2012/2013

Uploaded on 02/20/2013

salagame
salagame 🇮🇳

4

(3)

36 documents

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
93/81
THE UNIVERSITY OF SYDNEY
FACULTIES OF ARTS, EDUCATION, ENGINEERING AND SCIENCE
COSC 1001 COMPUTATIONAL SCIENCE IN MATLAB
COSC 1901 COMPUTATIONAL SCIENCE IN MATLAB (ADVANCED)
NOVEMBER 2010 TIME ALLOWED: 90 MINUTES
ALL QUESTIONS HAVE THE VALUE SHOWN
INSTRUCTIONS:
Students in COSC 1001 should attempt questions 1, 2, and 3.
Students in COSC 1901 should attempt questions 1, 2, and 4.
This exam is not open-book.
Non-programmable calculators are permitted.
pf3
pf4
pf5

Partial preview of the text

Download Linear Equations - Computational Science - Exam and more Exams Computational Physics in PDF only on Docsity!

THE UNIVERSITY OF SYDNEY

FACULTIES OF ARTS, EDUCATION, ENGINEERING AND SCIENCE

COSC 1001 – COMPUTATIONAL SCIENCE IN MATLAB

COSC 1901 – COMPUTATIONAL SCIENCE IN MATLAB (ADVANCED)

NOVEMBER 2010 TIME ALLOWED: 90 MINUTES

ALL QUESTIONS HAVE THE VALUE SHOWN

INSTRUCTIONS:

• Students in COSC 1001 should attempt questions 1, 2, and 3.

• Students in COSC 1901 should attempt questions 1, 2, and 4.

• This exam is not open-book.

• Non-programmable calculators are permitted.

  1. All students should attempt the next 2 questions.

In an experiment designed to accurately measure the acceleration due to gravity, a ball is dropped down an evacuated tube where three identical photo-sensors time the passing of the ball. The photo-sensors are positioned at 0, 1 and 3 m down the tube. The motion of the ball in the pipe can be described by the equation:

gt^2 + bt + c = 2y. (1)

In this equation, g is the acceleration due to gravity, y represents the position of a sensor down the tube and b and c are constants that relate to how the ball is dropped.

(a) In one experiment, a ball passes the sensors at 0.07, 0.53 and 0.85 seconds. Write down the three linear equations representing these constraints, and express these equations as a single matrix equation.

(b) Using the matlab function inv, write down a series of MATLAB commands to solve for the vector containing g, b and c.

(c) Write a MATLAB function that takes as input a vector containing the three times that the ball passes the sensors and outputs the acceleration due to gravity. Your answer should involve the division of matrices.

(d) After running 9 experiments using your function, results have been stored in a row vector g. Write a MATLAB command (or series of commands) that displays the best estimate for g based on these 9 experiments, and the standard error of your estimate. Make your code general, so that it would work for vectors g of any length greater than 2. (10 marks)

  1. This question is for COSC 1001 students only

(a) The (x, y) coordinates of an object as a function of time t are given by

x(t) = e−t y(t) = t(2 − t)

for 0 ≤ t ≤ 2. Write down a short MATLAB program which uses vector and logical operations to compute the time at which the object is furthest to the origin. The program should also determine the minimum distance. Note: for full marks your program should not use for or while loops.

(b) Write down the output of the following MATLAB commands.

(i) a=0:1; b=4:-1/2:3.1; sum([a; b]) (ii) clear for i=1:3: x(i)=iˆ2; end find(x>2*i)

(iii) b=[2 3 5 6 8 9]; y=[2 0 7 -1 -4 6]; b(y>0) (10 marks)

  1. This question is for COSC 1901 students only

When modelling the transfer of heat along a rod or bar, the temperature of the rod is given by the following differential equation:

∂T

∂t

= α(x)

∂^2 T

∂x^2

where α(x) is a parameter describing the thermal condictivity and geometry of the rod. Consider a rod of length 1 where the two ends are fixed to heat reservoirs at temperature 0, giving boundary conditions T (0) = 0 and T (1) = 0. This can be formulated as an eigenvalue problem by setting T (x, t) = Tx(x)Tt(t) and settting each side to kTx(x)Tt(t) separately. This is similar to the problem of the vibrating wire covered in lectures, except that in this case the solution to the time dependence is given by Tt(t) = exp(kt) where we find that k < 0.

(a) Setting α(x) = 1 m^2 /s (i.e. a constant), write down a series of MATLAB commands that solves this eigenvalue problem for Tx with the rod split up into N segments, for instance N equal to 9.

(b) Two distributions of intial temperature of the rod are shown below. Distribution A happens to be a scalar multiple of an eigenvector with eigenvalue 0.014, and distribution B is a scalar multiple of an eigenvector of eigenvalue 0.33. In or- der the eigenvalues are 0.014,0.054,0.12,0.21,0.33... Describe quantitatively, with reference to Equation 2, the time evolution of these two temperature distributions.

0 0.2 0.4 0.6 0.8 1 0

x

T

Distribution A: Eigenvalue 0.

0 0.2 0.4 0.6 0.8 1 −0.

−0.

−0.

−0.

0

x

T

Distribution B: Eigenvalue 0.