Acceleration Due to Gravity - Computational Science - Solved Exam, Exams of Computational Physics

This is the Solved Exam of Computational Science which includes Matrix Manipulation Functions, Acceleration Due to Gravity, Normal Distribution, Normalised Expression, Exponential with Several Bins, Acceptable Code, Normal Distribution etc. Key important points are: Acceleration Due to Gravity, Application of Linear Algebra, Built-In Matrix Manipulation Functions, Matrix Methods, User-Defined Functions, Matrix Datatype, Accuracy of Statistics

Typology: Exams

2012/2013

Uploaded on 02/20/2013

salagame
salagame 🇮🇳

4

(3)

36 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
COSC1001/1901 (Semester Two, 2010) Exam Solutions and Marking Scheme
Computational Science in MATLAB
COSC1001 (Normal) & COSC1901 (Advanced)
Exam Solutions and Marking Scheme
1. Measuring acceleration due to gravity
This question assesses week 8 (“Review the application of linear algebra to physical prob-
lems”, “Understand the built-in matrix manipulation functions” and “Apply matrix methods
to problems in linear algebra...”), week 3 (“Write user-defined functions”), week 4 (“Under-
stand the matrix datatype”) and week 7 (“Calculate the accuracy of statistics drawn from
limited populations”)
(a) (3 marks)
0.072g+ 0.07b+c= 0 (1)
0.532g+ 0.53b+c= 2 (2)
0.852g+ 0.85b+c= 6 (3)
0.0720.07 1
0.5320.53 1
0.8520.85 1
g
b
c
=
0
2
6
(4)
(b) 3 marks
>> A=[0.07^2 0.07 1; 0.53^2 0.53 1; 0.85^2 0.85 1];
>> y = [0; 2; 6];
>> gbc = inv(A)*y
(c) 2 marks
function g = calcg(t)
% This function computes the acceleration due to gravity, based on
% an experiment that includes sensors placed at 0, 1 and 2 m
A=[t(1)^2 t(1) 1; t(2)^2 t(2) 1; t(3)^2 t(3) 1];
gbc = A\[0; 2; 6];
g=gbc(1);
(d) 2 marks
disp([’g = num2str(mean(g)) +/- num2str(std(g)/length(g))])
1
pf3

Partial preview of the text

Download Acceleration Due to Gravity - Computational Science - Solved Exam and more Exams Computational Physics in PDF only on Docsity!

Computational Science in MATLAB

COSC1001 (Normal) & COSC1901 (Advanced)

Exam Solutions and Marking Scheme

  1. Measuring acceleration due to gravity

This question assesses week 8 (“Review the application of linear algebra to physical prob- lems”, “Understand the built-in matrix manipulation functions” and “Apply matrix methods to problems in linear algebra...”), week 3 (“Write user-defined functions”), week 4 (“Under- stand the matrix datatype”) and week 7 (“Calculate the accuracy of statistics drawn from limited populations”)

(a) (3 marks)

  1. 072 g + 0. 07 b + c = 0 (1)
  2. 532 g + 0. 53 b + c = 2 (2)
  3. 852 g + 0. 85 b + c = 6 (3)

g b c

(b) 3 marks

A=[0.07^2 0.07 1; 0.53^2 0.53 1; 0.85^2 0.85 1]; y = [0; 2; 6]; gbc = inv(A)*y

(c) 2 marks function g = calcg(t) % This function computes the acceleration due to gravity, based on % an experiment that includes sensors placed at 0, 1 and 2 m A=[t(1)^2 t(1) 1; t(2)^2 t(2) 1; t(3)^2 t(3) 1]; gbc = A[0; 2; 6]; g=gbc(1);

(d) 2 marks disp([’g = ’ num2str(mean(g)) ’ +/- ’ num2str(std(g)/length(g))])

  1. Biased Coin This assesses Week 5 (mostly “Generate a sequence and a matrix of random numbers” and “Simulate random processes (e.g. tossing a coin)”) and Week 8 (“Calculate the accuracy of statistics drawn from limited populations”)

(a) (3 marks)

(^00 )

100

200

300

400

500

600

700

(b) (4 marks)

clear trials=1e5; for n=1:trials results(n)=sum(round(rand(1,10)+0.1) ==1)<2; end disp([’Probability of less than 2 heads: ’ num2str(sum(results)/trials)])

(c) (3 marks) Decreasing the number of trials to 1000 would mean that the probability returned would only be given as a percentage to 1 decimal place and would be highly variable.

  1. xy coodinates and example code. This assesses weeks 1 through 4.

(4 marks) (a) t = [0:0.01:2]; x = exp(-t); y = t.*(2-t); d2 = x.^2+y.^2; t(d2==max(d2))

(b) i. (2 marks) 4 4. ii. (2 marks) 4 7 iii. (2 marks) 8 9